Belle II Software development
ObserverInfo Class Reference

Helper class that stores the information an Observer stores: i.e. More...

#include <ObserverInfo.h>

Inheritance diagram for ObserverInfo:

Public Member Functions

 ObserverInfo ()
 constructor
 
 ~ObserverInfo ()
 destructor
 
void clear ()
 resets all member variables
 
FilterInfo getFilterInfo (std::string const &key)
 returns the filter info with the requested key
 
std::string getFilterName (int i)
 function to access the filter infos directly, as indirect access seems not to work within the Draw of root:
 
double getFilterResult (std::string const &key)
 returns the requested filter result
 
bool getFilterAccepted (std::string const &key)
 returns if the filter was accepted
 
double getFilterUsed (std::string const &key)
 returns if the filter was used
 
void addFilterInfo (FilterInfo info)
 add a new filter info:
 
std::vector< SpacePointInfogetHits ()
 returns the vector of spacepoints which have been used to evaluate the filters
 
SpacePointInfo getHit (int i)
 Returns the i-th hit.
 
void setHits (const std::vector< SpacePointInfo > &newHits)
 sets the hits the filter has been evaluated with
 
int getMainMCParticleID ()
 return the MCParticle ID of the related MCParticle
 
void setMainMCParticleID (int id)
 set the MCParticle id
 
double getMainPurity ()
 returns the purity
 
void setMainPurity (double val)
 sets the purity
 

Private Member Functions

 ClassDef (ObserverInfo, 1)
 Needed to make the ROOT object storable.
 

Private Attributes

std::vector< FilterInfom_filterInfos
 stores the information for each Filter
 
std::vector< SpacePointInfom_hits
 stores the hits used in the filter, should have the order as used in the filter from outer to inner!
 
int m_mainMCParticleID
 dominating mcParticleID.
 
double m_mainPurity
 purity for the dominating particleID.
 

Detailed Description

Helper class that stores the information an Observer stores: i.e.

all the responses of the subfilters contained in a Filter.

Definition at line 24 of file ObserverInfo.h.

Constructor & Destructor Documentation

◆ ObserverInfo()

constructor

Definition at line 12 of file ObserverInfo.cc.

12 :
14 m_hits(),
16 m_mainPurity(-1.)
17{
18};
std::vector< SpacePointInfo > m_hits
stores the hits used in the filter, should have the order as used in the filter from outer to inner!
Definition: ObserverInfo.h:125
int m_mainMCParticleID
dominating mcParticleID.
Definition: ObserverInfo.h:128
double m_mainPurity
purity for the dominating particleID.
Definition: ObserverInfo.h:131
std::vector< FilterInfo > m_filterInfos
stores the information for each Filter
Definition: ObserverInfo.h:122

◆ ~ObserverInfo()

destructor

Definition at line 20 of file ObserverInfo.cc.

21{
22};

Member Function Documentation

◆ addFilterInfo()

void addFilterInfo ( FilterInfo  info)
inline

add a new filter info:

Parameters
infothe filterinfo to be added

Definition at line 86 of file ObserverInfo.h.

86{ m_filterInfos.push_back(info); };

◆ clear()

void clear ( )
inline

resets all member variables

Definition at line 32 of file ObserverInfo.h.

33 {
34 m_filterInfos.clear();
35 m_hits.clear();
36 m_mainMCParticleID = -666;
37 m_mainPurity = 0;
38 };

◆ getFilterAccepted()

bool getFilterAccepted ( std::string const &  key)
inline

returns if the filter was accepted

Parameters
keyname under which filter was stored

Definition at line 70 of file ObserverInfo.h.

71 {
72 return getFilterInfo(key).getWasAccepted();
73 }
bool getWasAccepted()
returns if the event was accepted
Definition: FilterInfo.h:48
FilterInfo getFilterInfo(std::string const &key)
returns the filter info with the requested key
Definition: ObserverInfo.h:43

◆ getFilterInfo()

FilterInfo getFilterInfo ( std::string const &  key)
inline

returns the filter info with the requested key

Parameters
keyname of the key for that filter

Definition at line 43 of file ObserverInfo.h.

44 {
45 for (int i = 0; i < (int) m_filterInfos.size(); i++)
46 if (m_filterInfos.at(i).getName() == key) return m_filterInfos.at(i);
47 //if nothing was found return an empty object
48 return FilterInfo();
49 };

◆ getFilterName()

std::string getFilterName ( int  i)
inline

function to access the filter infos directly, as indirect access seems not to work within the Draw of root:

Parameters
ithe index under which the filter was stored in m_filterinfos

Definition at line 54 of file ObserverInfo.h.

55 {
56 return (0 <= i && i < (int)m_filterInfos.size()) ? m_filterInfos[i].getName() : std::string("");
57 }

◆ getFilterResult()

double getFilterResult ( std::string const &  key)
inline

returns the requested filter result

Parameters
keythe key under which the filter was stored

Definition at line 62 of file ObserverInfo.h.

63 {
64 return getFilterInfo(key).getResult();
65 }
double getResult()
returns the result of the filtervariable attached to this filter
Definition: FilterInfo.h:46

◆ getFilterUsed()

double getFilterUsed ( std::string const &  key)
inline

returns if the filter was used

Parameters
keykey under which filter was stored

Definition at line 78 of file ObserverInfo.h.

79 {
80 return getFilterInfo(key).getWasUsed();
81 }
bool getWasUsed()
returns if filter was evaluated
Definition: FilterInfo.h:50

◆ getHit()

SpacePointInfo getHit ( int  i)
inline

Returns the i-th hit.

Parameters
ihit index

Definition at line 94 of file ObserverInfo.h.

95 {
96 if (i < 0 || i > (int)m_hits.size()) return SpacePointInfo(); // return a dummy object
97 else return m_hits[i];
98 };

◆ getHits()

std::vector< SpacePointInfo > getHits ( )
inline

returns the vector of spacepoints which have been used to evaluate the filters

Definition at line 89 of file ObserverInfo.h.

89{ return m_hits; };

◆ getMainMCParticleID()

int getMainMCParticleID ( )
inline

return the MCParticle ID of the related MCParticle

Definition at line 106 of file ObserverInfo.h.

106{return m_mainMCParticleID;};

◆ getMainPurity()

double getMainPurity ( )
inline

returns the purity

Definition at line 114 of file ObserverInfo.h.

114{ return m_mainPurity; };

◆ setHits()

void setHits ( const std::vector< SpacePointInfo > &  newHits)
inline

sets the hits the filter has been evaluated with

Parameters
newHitsvector of spacepoint which have been used in this filter

Definition at line 103 of file ObserverInfo.h.

103{ m_hits = newHits; };

◆ setMainMCParticleID()

void setMainMCParticleID ( int  id)
inline

set the MCParticle id

Parameters
idthe new id

Definition at line 111 of file ObserverInfo.h.

111{ m_mainMCParticleID = id; };

◆ setMainPurity()

void setMainPurity ( double  val)
inline

sets the purity

Parameters
valnew value of the purity

Definition at line 119 of file ObserverInfo.h.

119{ m_mainPurity = val; };

Member Data Documentation

◆ m_filterInfos

std::vector<FilterInfo> m_filterInfos
private

stores the information for each Filter

Definition at line 122 of file ObserverInfo.h.

◆ m_hits

std::vector<SpacePointInfo> m_hits
private

stores the hits used in the filter, should have the order as used in the filter from outer to inner!

Definition at line 125 of file ObserverInfo.h.

◆ m_mainMCParticleID

int m_mainMCParticleID
private

dominating mcParticleID.

Definition at line 128 of file ObserverInfo.h.

◆ m_mainPurity

double m_mainPurity
private

purity for the dominating particleID.

Definition at line 131 of file ObserverInfo.h.


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