 |
Belle II Software
release-05-01-25
|
13 #include <tracking/trackFindingVXD/filterMap/filterFramework/TBranchLeafType.h>
17 #include <framework/logging/Logger.h>
33 template<
typename MinType,
typename MaxType>
47 template<
class VariableType >
48 inline bool contains(
const VariableType& x)
const {
return m_min <= x && x <=
m_max ;};
59 void persist(TTree* t,
const std::string& branchName,
const std::string& variableName)
63 leafList += variableName;
67 leafList += variableName;
70 TBranch* branch =
new TBranch(t, branchName.c_str() , &
m_min, leafList.c_str());
71 t->GetListOfBranches()->Add(branch);
82 if (t->SetBranchAddress(branchName.c_str(), &
m_min) < 0) B2FATAL(
"ClosedRange: branch address not valid");
98 const std::string& varname =
"X")
100 std::string minVal = std::to_string(
m_min);
101 std::string maxVal = std::to_string(
m_max);
103 if (pointers !=
nullptr) {
105 minVal =
"#" + std::to_string(pointers->size());
107 maxVal =
"#" + std::to_string(pointers->size());
110 return (
"(" + minVal +
" <= " + varname +
" <= " + maxVal +
")");
char TBranchLeafType(const char *)
Overloading TBranchLeafType to be able to get identifier 'C' for type char*.
void persist(TTree *t, const std::string &branchName, const std::string &variableName)
Creates and sets the addresses of the leaves to store the min and max values.
bool contains(const VariableType &x) const
Method used by the filter tools to decide if accept a combination.
MinType m_min
the minimum of this range
Abstract base class for different kinds of events.
ClosedRange(MinType min, MaxType max)
Constructor.
void setBranchAddress(TTree *t, const std::string &branchName, const std::string &)
sets branch addresses of the given tree to the m_min and m_msx.
MinType getInf(void) const
Accessor to the inf of the set (which is also the min)
MaxType getSup(void) const
Accessor to the sup of the set (which is alsto the max)
MaxType m_max
the maximum of this range
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