 |
Belle II Software
release-05-01-25
|
13 #include <tracking/trackFindingVXD/filterMap/filterFramework/TBranchLeafType.h>
17 #include <framework/logging/Logger.h>
30 template<
typename SupType >
31 class UpperBoundedSet {
47 template<
class VariableType >
59 void persist(TTree* t,
const std::string& branchName,
const std::string& variableName)
63 leafList += variableName;
67 TBranch* branch =
new TBranch(t, branchName.c_str() , &
m_sup, leafList.c_str());
68 t->GetListOfBranches()->Add(branch);
78 if (t->SetBranchAddress(branchName, &
m_sup) < 0) B2FATAL(
"UpperBoundedSet: branch address not valid!");
90 std::string
getNameAndReference(std::vector<std::pair<char, void*>>* pointers =
nullptr,
const std::string& varname =
"X")
92 std::string maxVal = std::to_string(
m_sup);
94 if (pointers !=
nullptr) {
96 maxVal =
"#" + std::to_string(pointers->size());
99 return (
"(" + varname +
" < " + maxVal +
")");
char TBranchLeafType(const char *)
Overloading TBranchLeafType to be able to get identifier 'C' for type char*.
void setBranchAddress(TTree *t, const std::string &branchName, const std::string &)
Setting the branch address for a filter in a TTree.
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.
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
Abstract base class for different kinds of events.
SupType m_sup
Supremum of the set.
UpperBoundedSet()
Constructor without argument.
bool contains(const VariableType &x) const
Method used by the filter tools to decide on the fate of the pair.