 |
Belle II Software
release-05-01-25
|
13 #include <tracking/trackFindingVXD/filterMap/filterFramework/TBranchLeafType.h>
17 #include <framework/logging/Logger.h>
31 template<
typename MinType >
32 class ClosedLowerBoundedSet {
46 template<
class VariableType >
47 inline bool contains(
const VariableType& x)
const {
return m_min <= x ;};
58 void persist(TTree* t,
const std::string& branchName,
const std::string& variableName)
62 leafList += variableName;
65 TBranch* branch =
new TBranch(t, branchName.c_str() , &
m_min, leafList.c_str());
66 t->GetListOfBranches()->Add(branch);
76 if (t->SetBranchAddress(branchName.c_str(), &
m_min) < 0) B2FATAL(
"ClosedLowerBoundedSet: branch address not valid");
88 std::string
getNameAndReference(std::vector< std::pair<char, void*> >* pointers =
nullptr,
const std::string& varname =
"X")
90 std::string minVal = std::to_string(
m_min);
92 if (pointers !=
nullptr) {
94 minVal =
"#" + std::to_string(pointers->size());
97 return (
"(" + minVal +
" <= " + varname +
")");
char TBranchLeafType(const char *)
Overloading TBranchLeafType to be able to get identifier 'C' for type char*.
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
MinType m_min
the minimum value for this range
ClosedLowerBoundedSet()
Constructor without argument.
bool contains(const VariableType &x) const
Method used by the filter tools to decide on the fate of the pair.
void persist(TTree *t, const std::string &branchName, const std::string &variableName)
Creates and sets the addresses of the leaves to store the min value.
Abstract base class for different kinds of events.
void setBranchAddress(TTree *t, const std::string &branchName, const std::string &)
sets the branch address for m_min
MinType getInf(void) const
Accessor to the inf of the set (which coincides with the min)