Belle II Software development
ObserverCheckFilters Class Reference

this observer searches logs the response for each of SelectionVariables used in the filters If the pointer to the StoreArray is set the results will be put into the datastore More...

#include <ObserverCheckFilters.h>

Public Member Functions

 ObserverCheckFilters ()
 empty constructor:
 

Static Public Member Functions

static bool initialize (const StoreArray< ObserverInfo > &aStoreArray)
 get a copy of a storearray
 
template<class Var , class Range , typename ... types>
static bool initialize (Var, Range, const types &...)
 this function is needed by the Filters.h but has no task for this observer
 
static SpacePointInfo convertSpacePoint (const SpacePoint &aSpacePoint)
 convert a SpacePiont into a version that can be stored in the datastore
 
static void prepare (const SpacePoint &outerHit, const SpacePoint &innerHit)
 static method used by the observed object to reset the stored values of the observer.
 
template<typename ... types>
static void terminate (const types &...)
 static method used by the observed object to terminate the observer.
 
template<typename ... types>
static void collect (const types &...)
 fill the storearray

 
template<class Var , class RangeType >
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 purities for them.
 
template<class Var , class RangeType >
static void notify (const Var &, typename Var::variableType fResult, const RangeType &range, const typename Var::argumentType &, const typename Var::argumentType &)
 notifier which finds the mcParticles attached to given pair of spacePoints and determines the purities for them.
 

Static Public Attributes

static ObserverInfo s_observerInfo = ObserverInfo()
 container that stores the results calculated for a selectionVariableName, has to be static due to the way the observers is called
 
static StoreArray< ObserverInfos_storeArray = StoreArray<ObserverInfo>()
 hold a storearray to have access to the datastore
 

Static Protected Member Functions

template<class Var , class RangeType >
static void generalNotify (typename Var::variableType fResult, const RangeType &range)
 unified part of the notifier function.
 

Detailed Description

this observer searches logs the response for each of SelectionVariables used in the filters If the pointer to the StoreArray is set the results will be put into the datastore

Definition at line 31 of file ObserverCheckFilters.h.

Constructor & Destructor Documentation

◆ ObserverCheckFilters()

empty constructor:

Definition at line 42 of file ObserverCheckFilters.h.

42{};

Member Function Documentation

◆ collect()

static void collect ( const types &  ...)
inlinestatic

fill the storearray

Definition at line 116 of file ObserverCheckFilters.h.

117 {
118 // append a copy to the storearray
119 s_storeArray.appendNew(s_observerInfo);
120 }
static StoreArray< ObserverInfo > s_storeArray
hold a storearray to have access to the datastore
static ObserverInfo s_observerInfo
container that stores the results calculated for a selectionVariableName, has to be static due to the...

◆ convertSpacePoint()

static SpacePointInfo convertSpacePoint ( const SpacePoint aSpacePoint)
inlinestatic

convert a SpacePiont into a version that can be stored in the datastore

Definition at line 62 of file ObserverCheckFilters.h.

63 {
64 SpacePointInfo spInfo;
65 spInfo.setPosition(aSpacePoint.getPosition());
66 spInfo.setPositionError(aSpacePoint.getPositionError());
67 spInfo.setNormalizedLocalU(aSpacePoint.getNormalizedLocalU());
68 spInfo.setNormalizedLocalV(aSpacePoint.getNormalizedLocalV());
69 spInfo.setClustersAssignedU(aSpacePoint.getIfClustersAssigned().first);
70 spInfo.setClustersAssignedV(aSpacePoint.getIfClustersAssigned().second);
71 spInfo.setVxdID(aSpacePoint.getVxdID());
72 spInfo.setSensorType((int)aSpacePoint.getType());
73 spInfo.setQualityIndicator(aSpacePoint.getQualityEstimation());
74 spInfo.setIsAssigned(aSpacePoint.getAssignmentState());
75 return spInfo;
76 }

◆ generalNotify()

static void generalNotify ( typename Var::variableType  fResult,
const RangeType &  range 
)
inlinestaticprotected

unified part of the notifier function.

Stores filter-specific things.

Definition at line 164 of file ObserverCheckFilters.h.

166 {
167 // store the data retrieved:
168 FilterInfo info(Var().name(), double(fResult), range.contains(fResult), true);
170 }
void addFilterInfo(FilterInfo info)
add a new filter info:
Definition: ObserverInfo.h:86

◆ initialize() [1/2]

static bool initialize ( const StoreArray< ObserverInfo > &  aStoreArray)
inlinestatic

get a copy of a storearray

Definition at line 47 of file ObserverCheckFilters.h.

48 {
50 return true;
51 }

◆ initialize() [2/2]

static bool initialize ( Var  ,
Range  ,
const types &  ... 
)
inlinestatic

this function is needed by the Filters.h but has no task for this observer

Definition at line 55 of file ObserverCheckFilters.h.

56 {
57 return true;
58 }

◆ notify() [1/2]

static void notify ( const Var &  ,
typename Var::variableType  fResult,
const RangeType &  range,
const typename Var::argumentType &  ,
const typename Var::argumentType &   
)
inlinestatic

notifier which finds the mcParticles attached to given pair of spacePoints and determines the purities for them.

Definition at line 141 of file ObserverCheckFilters.h.

146 {
147 // // create input-container for purity-check:
148 // std::vector<const Belle2::SpacePoint*> spacePoints = {&outerHit, &innerHit};
149
150 generalNotify<Var, RangeType>(fResult, range);
151 }

◆ notify() [2/2]

static void notify ( const Var &  ,
typename Var::variableType  fResult,
const RangeType &  range,
const typename Var::argumentType &  ,
const typename Var::argumentType &  ,
const typename Var::argumentType &   
)
inlinestatic

notifier which finds the mcParticles attached to given triplet of spacePoints and determines the purities for them.

Definition at line 125 of file ObserverCheckFilters.h.

131 {
132 // create input-container for purity-check:
133 // std::vector<const Belle2::SpacePoint*> spacePoints = {&outerHit, &centerHit, &innerHit};
134
135 generalNotify<Var, RangeType>(fResult, range);
136 }

◆ prepare()

static void prepare ( const SpacePoint outerHit,
const SpacePoint innerHit 
)
inlinestatic

static method used by the observed object to reset the stored values of the observer.

Definition at line 81 of file ObserverCheckFilters.h.

83 {
84 // discard all previous data
86 std::vector<SpacePointInfo> hitsinfo = { ObserverCheckFilters::convertSpacePoint(outerHit),
88 };
89 s_observerInfo.setHits(hitsinfo);
90
91
92 // collect purity for each particle attached to the hits
93 // TODO: this is code used in the ObserverCheckMCPurity check if the following code
94 /*
95 std::vector<const Belle2::SpacePoint*> hits = {&outerHit, &innerHit};
96 std::vector<Belle2::MCVXDPurityInfo> particlesFound;
97 // TODO: check if it can cope with real data (no MC particles)!
98 particlesFound = createPurityInfosVec(hits);
99 // the dominating-particle is the uppermost one:
100 auto purityPack = particlesFound.at(0).getPurity(); //that part does not look safe to be used on data!
101 s_mainMCParticleID = purityPack.first;
102 s_mainPurity = purityPack.second;
103 */
104 }
static SpacePointInfo convertSpacePoint(const SpacePoint &aSpacePoint)
convert a SpacePiont into a version that can be stored in the datastore
void setHits(const std::vector< SpacePointInfo > &newHits)
sets the hits the filter has been evaluated with
Definition: ObserverInfo.h:103
void clear()
resets all member variables
Definition: ObserverInfo.h:32
B2Vector3D outerHit(0, 0, 0)
testing out of range behavior

◆ terminate()

static void terminate ( const types &  ...)
inlinestatic

static method used by the observed object to terminate the observer.

Definition at line 109 of file ObserverCheckFilters.h.

110 {
111 }

Member Data Documentation

◆ s_observerInfo

ObserverInfo s_observerInfo = ObserverInfo()
static

container that stores the results calculated for a selectionVariableName, has to be static due to the way the observers is called

Definition at line 36 of file ObserverCheckFilters.h.

◆ s_storeArray

StoreArray< ObserverInfo > s_storeArray = StoreArray<ObserverInfo>()
static

hold a storearray to have access to the datastore

Definition at line 39 of file ObserverCheckFilters.h.


The documentation for this class was generated from the following files: