Belle II Software  release-08-01-10
CutHelpers.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #pragma once
10 
11 #include <string>
12 #include <vector>
13 
14 namespace Belle2 {
23  unsigned long int findMatchedParenthesis(std::string str, char open = '[', char close = ']');
24 
28  std::vector<std::string> splitOnDelimiterAndConserveParenthesis(std::string str, char delimiter, char open, char close);
29 
33  unsigned long int findIgnoringParenthesis(std::string str, std::string pattern, unsigned int begin = 0);
34 
38  bool almostEqualFloat(const float& a, const float& b);
39 
43  bool almostEqualDouble(const double& a, const double& b);
44 
46 }
bool almostEqualFloat(const float &a, const float &b)
Helper function to test if two floats are almost equal.
Definition: CutHelpers.cc:19
unsigned long int findIgnoringParenthesis(std::string str, std::string pattern, unsigned int begin=0)
Returns the position of a pattern in a string ignoring everything that is in parenthesis.
Definition: CutHelpers.cc:49
unsigned long int findMatchedParenthesis(std::string str, char open='[', char close=']')
Returns position of the matched closing parenthesis if the first character in the given string contai...
Definition: CutHelpers.cc:33
std::vector< std::string > splitOnDelimiterAndConserveParenthesis(std::string str, char delimiter, char open, char close)
Split into std::vector on delimiter ignoring delimiters between parenthesis.
Definition: CutHelpers.cc:81
bool almostEqualDouble(const double &a, const double &b)
Helper function to test if two doubles are almost equal.
Definition: CutHelpers.cc:26
Abstract base class for different kinds of events.