11#include <tracking/trackFindingVXD/filterMap/filterFramework/TBranchLeafType.h>
13#include <framework/logging/Logger.h>
29 template<
typename MaxType >
48 template<
class VariableType >
49 inline bool contains(
const VariableType& x)
const {
return x <=
m_max;};
61 void persist(TTree* t,
const std::string& branchName,
const std::string& variableName)
65 leafList += variableName;
69 TBranch* branch =
new TBranch(t, branchName.c_str(), &
m_max, leafList.c_str());
70 t->GetListOfBranches()->Add(branch);
80 if (t->SetBranchAddress(branchName.c_str(), &
m_max) < 0) B2FATAL(
"ClosedUpperBoundedSet: branch address not valid!");
93 const std::string& varname =
"X")
95 std::string maxVal = std::to_string(
m_max);
97 if (pointers !=
nullptr) {
99 maxVal =
"#" + std::to_string(pointers->size());
102 return (
"(" + varname +
" <= " + maxVal +
")");
Represents an upper bounded set of arithmetic types.
ClosedUpperBoundedSet()
constructor without argument
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
maximum 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.
ClosedUpperBoundedSet(MaxType max)
constructor
void setBranchAddress(TTree *t, const std::string &branchName, const std::string &)
Set the branch address of the specified leafes to the data members.
MaxType getSup(void) const
Accessor to the sup of the set (which is also 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.