11#include <tracking/trackFindingVXD/filterMap/filterFramework/TBranchLeafType.h>
15#include <framework/logging/Logger.h>
28 template<
typename SupType >
45 template<
class VariableType >
57 void persist(TTree* t,
const std::string& branchName,
const std::string& variableName)
61 leafList += variableName;
65 TBranch* branch =
new TBranch(t, branchName.c_str(), &
m_sup, leafList.c_str());
66 t->GetListOfBranches()->Add(branch);
76 if (t->SetBranchAddress(branchName, &
m_sup) < 0) B2FATAL(
"UpperBoundedSet: branch address not valid!");
88 std::string
getNameAndReference(std::vector<std::pair<char, void*>>* pointers =
nullptr,
const std::string& varname =
"X")
90 std::string maxVal = std::to_string(
m_sup);
92 if (pointers !=
nullptr) {
94 maxVal =
"#" + std::to_string(pointers->size());
97 return (
"(" + varname +
" < " + maxVal +
")");
Represents an upper bounded set of arithmetic types.
SupType m_sup
Supremum of the set.
UpperBoundedSet()
Constructor without argument.
SupType getSup(void) const
Accessor to the sup 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 sup value.
UpperBoundedSet(SupType sup)
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 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.
char TBranchLeafType(const char *)
Overloading TBranchLeafType to be able to get identifier 'C' for type char*.
Abstract base class for different kinds of events.