11#include <tracking/trackFindingVXD/filterMap/filterFramework/TBranchLeafType.h>
15#include <framework/logging/Logger.h>
31 template<
typename MinType,
typename MaxType>
45 template<
class VariableType >
57 void persist(TTree* t,
const std::string& branchName,
const std::string& variableName)
61 leafList += variableName;
65 leafList += variableName;
68 TBranch* branch =
new TBranch(t, branchName.c_str(), &
m_min, leafList.c_str());
69 t->GetListOfBranches()->Add(branch);
80 if (t->SetBranchAddress(branchName.c_str(), &
m_min) < 0) B2FATAL(
"ClosedRange: branch address not valid");
96 const std::string& varname =
"X")
98 std::string minVal = std::to_string(
m_min);
99 std::string maxVal = std::to_string(
m_max);
101 if (pointers !=
nullptr) {
103 minVal =
"#" + std::to_string(pointers->size());
105 maxVal =
"#" + std::to_string(pointers->size());
108 return (
"(" + minVal +
" <= " + varname +
" <= " + maxVal +
")");
Represents a closed set of arithmetic types.
MinType m_min
the minimum of this range
MinType getInf(void) const
Accessor to the inf of the set (which is also the min)
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.
MaxType m_max
the maximum of this range
ClosedRange(MinType min, MaxType max)
Constructor.
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
bool contains(const VariableType &x) const
Method used by the filter tools to decide if accept a combination.
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.
MaxType getSup(void) const
Accessor to the sup of the set (which is alsto the max)
char TBranchLeafType(const char *)
Overloading TBranchLeafType to be able to get identifier 'C' for type char*.
Abstract base class for different kinds of events.