 |
Belle II Software
release-05-01-25
|
13 #include <tracking/spacePointCreation/MCVXDPurityInfo.h>
14 #include <tracking/spacePointCreation/PurityCalculatorTools.h>
15 #include <tracking/trackFindingVXD/filterMap/filterFramework/TBranchLeafType.h>
17 #include <tracking/spacePointCreation/SpacePoint.h>
32 class ObserverCheckMCPurity {
37 static std::map<std::string, double*>
s_results;
47 static std::map<std::string, bool*>
s_wasUsed;
75 template<
class Var,
class RangeType>
77 typename Var::variableType fResult,
78 const RangeType& range,
79 const typename Var::argumentType&,
80 const typename Var::argumentType&,
81 const typename Var::argumentType&)
86 generalNotify<Var, RangeType>(fResult, range);
91 template<
class Var,
class RangeType>
92 static void notify(
const Var&,
93 typename Var::variableType fResult,
94 const RangeType& range,
95 const typename Var::argumentType&,
96 const typename Var::argumentType&)
101 generalNotify<Var, RangeType>(fResult, range);
114 template <
class Var,
class Range,
typename ... types >
117 auto varName = var.name();
119 auto newResult =
new double;
120 s_results.insert(std::make_pair(varName, newResult));
123 auto newAccepted =
new bool(
false);
127 auto newWasUsed =
new bool;
128 s_wasUsed.insert(std::make_pair(varName, newWasUsed));
162 static void prepare(
const SpacePoint& outerHit,
163 const SpacePoint& innerHit)
170 std::vector<const Belle2::SpacePoint*> hits = {&outerHit, &innerHit};
173 std::vector<Belle2::MCVXDPurityInfo> particlesFound;
176 auto purityPack = particlesFound.at(0).getPurity();
182 *(entry.second) =
false;
189 template <
typename ... types >
199 template <
typename ... types >
200 static void collect(
const types& ...)
216 template<
class Var,
class RangeType>
217 static void generalNotify(
typename Var::variableType fResult,
218 const RangeType& range)
221 auto varName = Var().name();
222 *(
s_results.at(varName)) =
double(fResult);
char TBranchLeafType(const char *)
Overloading TBranchLeafType to be able to get identifier 'C' for type char*.
static void generalNotify(typename Var::variableType fResult, const RangeType &range)
unified part of the notifier function.
static SpacePoint s_innerHitOfTwo
stores the inner hit of a two-hit-combination.
static double s_mainPurity
purity for the dominating particleID.
static std::map< std::string, double * > s_results
stores the results calculated (->value) for a selectionVariableName (->Key).
static void terminate(const types &...)
static method used by the observed object to terminate the observer.
static void notify(const Var &, typename Var::variableType fResult, const RangeType &range, const typename Var::argumentType &, const typename Var::argumentType &, const typename Var::argumentType &)
notifier which finds the mcParticles attached to given triplet of spacePoints and determines the puri...
static std::map< std::string, bool * > s_wasAccepted
stores if hits were accepted (->value) for a selectionVariableName (->Key).
SpacePoint typically is build from 1 PXDCluster or 1-2 SVDClusters.
static SpacePoint s_centerHitOfThree
stores the center hit of a three-hit-combination.
static void collect(const types &...)
fill the tree.
ObserverCheckMCPurity()
empty constructor:
static std::map< std::string, bool * > s_wasUsed
stores if the filter was actually used this time (->value) for a selectionVariableName (->Key).
Abstract base class for different kinds of events.
Represents a range of arithmetic types.
static SpacePoint s_outerHitOfThree
stores the outer hit of a three-hit-combination.
static TTree * s_ttree
a ttree to store all the collected data.
static void prepare(const SpacePoint &outerHit, const SpacePoint &innerHit)
static method used by the observed object to reset the stored values of the observer.
static SpacePoint s_outerHitOfTwo
stores the outer hit of a two-hit-combination.
static bool initialize(Var var, Range, const types &...)
static method used by the observed object to initialize the observer.
static int s_mainMCParticleID
dominating mcParticleID.
static std::vector< Belle2::MCVXDPurityInfo > createPurityInfosVec(const std::vector< const Belle2::SpacePoint * > &spacePoints)
create a vector of MCVXDPurityInfos objects for a std::vector<Belle2::SpacePoints>.
static SpacePoint s_innerHitOfThree
stores the inner hit of a three-hit-combination.