Belle II Software  release-08-01-10
Range< InfType, SupType > Class Template Reference

Represents a range of arithmetic types. More...

#include <Range.h>

Public Member Functions

 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. More...
 
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. More...
 
void setBranchAddress (TTree *t, const std::string &branchName, const std::string &)
 Setting the branch address for a filter in a TTree. More...
 
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 More...
 

Private Attributes

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.
 

Detailed Description

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.

Member Function Documentation

◆ contains()

bool contains ( const VariableType &  x) const
inline

Method used by the filter tools to decide on the fate of the pair.

Parameters
xis 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 ;};
SupType m_sup
Supremum of the set.
Definition: Range.h:38
InfType m_inf
Infimum of the set.
Definition: Range.h:36

◆ getNameAndReference()

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
pointerspointer 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
varnameoptional name of the filter this range is attached to make the output look nicer

Definition at line 101 of file Range.h.

◆ persist()

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
tthe pointer to the TTree that will contain the TBranch of this range.
branchNamethe name of the TBranch that will host this range.
variableNamethe 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.

◆ setBranchAddress()

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.


The documentation for this class was generated from the following file: