Represents a range of arithmetic types.
More...
#include <Range.h>
|
| Range (InfType inf, SupType sup) |
| Constructor.
|
|
template<class VariableType> |
bool | contains (const VariableType &x) const |
| Method used by the filter tools to decide on the fate of the pair.
|
|
void | persist (TTree *t, const std::string &branchName, const std::string &variableName) |
| Creates and sets the addresses of the leaves to store the inf and sup values.
|
|
void | setBranchAddress (TTree *t, const std::string &branchName, const std::string &) |
| Setting the branch address for a filter in a TTree.
|
|
InfType | getInf (void) const |
| Accessor to the inf of the set.
|
|
SupType | getSup (void) const |
| Accessor to the sup of the set.
|
|
std::string | getNameAndReference (std::vector< std::pair< char, void * > > *pointers=nullptr, const std::string &varname="X") |
| generates a "name" and fills the vector with the variable references
|
|
|
const char * | c_infSuffix = "_inf" |
| Char suffix used to indicate the infimum of the set.
|
|
const char * | c_supSuffix = "_sup" |
| Char suffix used to indicate the supremum of the set.
|
|
InfType | m_inf |
| Infimum of the set.
|
|
SupType | m_sup |
| Supremum of the set.
|
|
template<typename InfType, typename SupType>
class Belle2::Range< InfType, SupType >
Represents a range of arithmetic types.
Range is used in conjunction with the SelectionVariable to define one of the building blocks of the Filters
Definition at line 29 of file Range.h.
◆ Range() [1/2]
template<typename InfType, typename SupType>
Range |
( |
InfType | inf, |
|
|
SupType | sup ) |
|
inline |
Constructor.
Definition at line 42 of file Range.h.
42: m_inf(inf), m_sup(sup) {};
◆ Range() [2/2]
template<typename InfType, typename SupType>
Definition at line 44 of file Range.h.
44: m_inf(0.), m_sup(0.) {};
◆ contains()
template<typename InfType, typename SupType>
template<class VariableType>
bool contains |
( |
const VariableType & | x | ) |
const |
|
inline |
Method used by the filter tools to decide on the fate of the pair.
- Parameters
-
x | is the result of some SelectionVariable applied to a pair of objects. The return value is true if x belongs to the open set ( m_min, m_sup ) |
Definition at line 51 of file Range.h.
51{ return m_inf < x && x < m_sup ;};
◆ getInf()
template<typename InfType, typename SupType>
InfType getInf |
( |
void | | ) |
const |
|
inline |
Accessor to the inf of the set.
Definition at line 90 of file Range.h.
◆ getNameAndReference()
template<typename InfType, typename SupType>
std::string getNameAndReference |
( |
std::vector< std::pair< char, void * > > * | pointers = nullptr, |
|
|
const std::string & | varname = "X" ) |
|
inline |
generates a "name" and fills the vector with the variable references
- Parameters
-
pointers | pointer to vector which contains a pair of char which indicates the type object pointed to and the actual pointers to the bounds, if equal to nullptr it will not be filled |
varname | optional name of the filter this range is attached to make the output look nicer |
Definition at line 101 of file Range.h.
102 {
103 std::string minVal = std::to_string(m_inf);
104 std::string maxVal = std::to_string(m_sup);
105
106 if (pointers != nullptr) {
107
108 minVal = "#" + std::to_string(pointers->size());
110 maxVal = "#" + std::to_string(pointers->size());
112 }
113 return ("(" + minVal + " < " + varname + " < " + maxVal + ")");
114 }
char TBranchLeafType(const char *)
Overloading TBranchLeafType to be able to get identifier 'C' for type char*.
◆ getSup()
template<typename InfType, typename SupType>
SupType getSup |
( |
void | | ) |
const |
|
inline |
Accessor to the sup of the set.
Definition at line 93 of file Range.h.
◆ persist()
template<typename InfType, typename SupType>
void persist |
( |
TTree * | t, |
|
|
const std::string & | branchName, |
|
|
const std::string & | variableName ) |
|
inline |
Creates and sets the addresses of the leaves to store the inf and sup values.
- Parameters
-
t | the pointer to the TTree that will contain the TBranch of this range. |
branchName | the name of the TBranch that will host this range. |
variableName | the name of the selection variable this range is applied to. |
The leaves will be named as the selection variable name with the "_inf"/"_sup" suffixes for the inf/sup value.
Definition at line 62 of file Range.h.
63 {
64
65 std::string leafList;
66 leafList += variableName;
67 leafList += c_infSuffix;
68 leafList += "/";
70 leafList += ":";
71 leafList += variableName;
72 leafList += c_supSuffix;
73 leafList += "/";
75 TBranch* branch = new TBranch(t, branchName.c_str(), & m_inf, leafList.c_str());
76 t->GetListOfBranches()->Add(branch);
77 }
◆ setBranchAddress()
template<typename InfType, typename SupType>
void setBranchAddress |
( |
TTree * | t, |
|
|
const std::string & | branchName, |
|
|
const std::string & | ) |
|
inline |
Setting the branch address for a filter in a TTree.
- Parameters
-
t | : the TTree in which the branch address shall be set |
branchName | : name of the branch |
Definition at line 83 of file Range.h.
85 {
86 if (t->SetBranchAddress(branchName.c_str(), & m_inf) < 0) B2FATAL("Range: branch address not valid");
87 }
◆ c_infSuffix
template<typename InfType, typename SupType>
const char* c_infSuffix = "_inf" |
|
private |
Char suffix used to indicate the infimum of the set.
Definition at line 31 of file Range.h.
◆ c_supSuffix
template<typename InfType, typename SupType>
const char* c_supSuffix = "_sup" |
|
private |
Char suffix used to indicate the supremum of the set.
Definition at line 33 of file Range.h.
◆ m_inf
template<typename InfType, typename SupType>
Infimum of the set.
Definition at line 36 of file Range.h.
◆ m_sup
template<typename InfType, typename SupType>
Supremum of the set.
Definition at line 38 of file Range.h.
The documentation for this class was generated from the following file:
- tracking/trackFindingVXD/filterMap/filterFramework/include/Range.h