Belle II Software  release-08-01-10
CountContainer Class Reference

a container for counting accepted and rejected stuff, just delivers some interfaces to make the code more readable More...

Collaboration diagram for CountContainer:

Classes

struct  AcceptRejectPair
 simple struct for counting accepted and rejected cases. More...
 

Public Types

typedef std::vector< int > Particles
 a vector containing IDs
 
typedef std::pair< bool, ParticlesKey
 key for the internal container of this map More...
 

Public Member Functions

 CountContainer ()
 constructor.
 
void clear ()
 clear container
 
unsigned int size ()
 size of container
 
bool IncreaseCounter (Key &aKey, bool accepted)
 accepts a key (first parameter) and if given key was accepted by the filter (second parameter)
 
AcceptRejectPair ReturnResult (const Key &givenKey)
 for given key, the function returns the result found. More...
 
AcceptRejectPair ReturnResult (const Particles &givenKey)
 for given key, the function returns the result found. More...
 
void PrintResults (const string &identifier="unknown")
 for easy printing of results collected so far
 

Static Public Member Functions

template<class ContainerType >
static void uniqueIdentifier (ContainerType &particles)
 cleans a container of double entries
 
static std::string key2str (const Key &aKey)
 small helper for easily printing vectors
 
static std::string key2str (const Key *aKey)
 small helper for easily printing vectors
 
template<class Type >
static std::string vec2str (const vector< Type > &vec)
 small helper for easily printing vectors
 

Protected Attributes

std::map< Key, AcceptRejectPairm_container
 collects the data
 

Detailed Description

a container for counting accepted and rejected stuff, just delivers some interfaces to make the code more readable

Definition at line 204 of file observers.cc.

Member Typedef Documentation

◆ Key

typedef std::pair< bool, Particles > Key

key for the internal container of this map

.first is a bool which is true, if combination was from the same particle which was primary .second vector of IDs (e.g. PDG or mcParticleIDs)

Definition at line 217 of file observers.cc.

Member Function Documentation

◆ ReturnResult() [1/2]

AcceptRejectPair ReturnResult ( const Key givenKey)
inline

for given key, the function returns the result found.

If key was not found in container, a AcceptRejectPair with 0, 0 is returned

Definition at line 277 of file observers.cc.

◆ ReturnResult() [2/2]

AcceptRejectPair ReturnResult ( const Particles givenKey)
inline

for given key, the function returns the result found.

If key was not found in container, a AcceptRejectPair with 0, 0 is returned

Definition at line 292 of file observers.cc.


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