11#include <tracking/trackFindingVXD/filterMap/filterFramework/TBranchLeafType.h>
15#include <framework/logging/Logger.h>
28 template<
typename InfType,
typename SupType>
50 template<
class VariableType>
62 void persist(TTree* t,
const std::string& branchName,
const std::string& variableName)
66 leafList += variableName;
71 leafList += variableName;
75 TBranch* branch =
new TBranch(t, branchName.c_str(), &
m_inf, leafList.c_str());
76 t->GetListOfBranches()->Add(branch);
86 if (t->SetBranchAddress(branchName.c_str(), &
m_inf) < 0) B2FATAL(
"Range: branch address not valid");
101 std::string
getNameAndReference(std::vector<std::pair<char, void*>>* pointers =
nullptr,
const std::string& varname =
"X")
103 std::string minVal = std::to_string(
m_inf);
104 std::string maxVal = std::to_string(
m_sup);
106 if (pointers !=
nullptr) {
108 minVal =
"#" + std::to_string(pointers->size());
110 maxVal =
"#" + std::to_string(pointers->size());
113 return (
"(" + minVal +
" < " + varname +
" < " + maxVal +
")");
Represents a range of arithmetic types.
SupType m_sup
Supremum of the set.
Range(InfType inf, SupType sup)
Constructor.
SupType getSup(void) const
Accessor to the sup of the set.
const char * c_supSuffix
Char suffix used to indicate the supremum of the set.
const char * c_infSuffix
Char suffix used to indicate the infimum of the set.
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.
InfType m_inf
Infimum 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
bool contains(const VariableType &x) const
Method used by the filter tools to decide on the fate of the pair.
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.
char TBranchLeafType(const char *)
Overloading TBranchLeafType to be able to get identifier 'C' for type char*.
Abstract base class for different kinds of events.