 |
Belle II Software
release-05-02-19
|
13 #include <tracking/trackFindingVXD/filterMap/filterFramework/TBranchLeafType.h>
15 #include <framework/logging/Logger.h>
31 template<
typename MaxType >
32 class ClosedUpperBoundedSet {
50 template<
class VariableType >
51 inline bool contains(
const VariableType& x)
const {
return x <=
m_max;};
63 void persist(TTree* t,
const std::string& branchName,
const std::string& variableName)
67 leafList += variableName;
71 TBranch* branch =
new TBranch(t, branchName.c_str() , &
m_max, leafList.c_str());
72 t->GetListOfBranches()->Add(branch);
82 if (t->SetBranchAddress(branchName.c_str(), &
m_max) < 0) B2FATAL(
"ClosedUpperBoundedSet: branch address not valid!");
95 const std::string& varname =
"X")
97 std::string maxVal = std::to_string(
m_max);
99 if (pointers !=
nullptr) {
101 maxVal =
"#" + std::to_string(pointers->size());
104 return (
"(" + varname +
" <= " + maxVal +
")");
char TBranchLeafType(const char *)
Overloading TBranchLeafType to be able to get identifier 'C' for type char*.
bool contains(const VariableType &x) const
Method used by the filter tools to decide on the fate of the pair.
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
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)
Abstract base class for different kinds of events.
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
ClosedUpperBoundedSet()
constructor without argument