Belle II Software light-2406-ragdoll
|
Internal class to store string -> index maps for extra info stored in Particle. More...
#include <ParticleExtraInfoMap.h>
Public Types | |
typedef std::map< std::string, unsigned int > | IndexMap |
string -> index map. | |
Public Member Functions | |
const IndexMap & | getMap (unsigned int mapID) const |
Return reference to map with given ID. | |
unsigned int | getIndex (unsigned int mapID, const std::string &name) const |
Find index for name in the given map, or return 0 if not found. | |
unsigned int | getMapForNewVar (const std::string &name) |
Return map ID to a map that has 'name' as first entry. | |
unsigned int | getMapForNewVar (const std::string &name, unsigned int oldMapID, unsigned int insertIndex) |
Return map ID to a map that has 'name' at place 'insertIndex' and is compatible with previous map (in oldMapID) | |
unsigned int | getNMaps () const |
How many maps do we use? | |
Private Member Functions | |
ClassDef (ParticleExtraInfoMap, 1) | |
Internal class to store string -> index maps for user-defined variables in Particle. | |
Static Private Member Functions | |
static bool | isCompatible (const IndexMap &oldMap, const IndexMap &map, unsigned int insertIndex) |
check if all entries in 'oldMap' prior to insertIndex are found in 'map' (with same idx). | |
Private Attributes | |
std::vector< IndexMap > | m_maps |
List of string -> index maps. | |
Internal class to store string -> index maps for extra info stored in Particle.
An object of this class is used to store all strings used to identify the values added using Particle::addExtraInfo() and keeps Particles fairly light (only values and a map ID are stored directly). The necessary indirection is handled automatically by Particle::getExtraInfo().
Modules registering a StoreArray<Particle> should always register a StoreObjPtr<ParticleExtraInfoMap> to allow storing additional information.
Definition at line 29 of file ParticleExtraInfoMap.h.
typedef std::map<std::string, unsigned int> IndexMap |
string -> index map.
Definition at line 32 of file ParticleExtraInfoMap.h.
|
inline |
Definition at line 34 of file ParticleExtraInfoMap.h.
unsigned int getIndex | ( | unsigned int | mapID, |
const std::string & | name | ||
) | const |
Find index for name in the given map, or return 0 if not found.
Definition at line 14 of file ParticleExtraInfoMap.cc.
|
inline |
unsigned int getMapForNewVar | ( | const std::string & | name | ) |
Return map ID to a map that has 'name' as first entry.
Creates a new map if necessary.
Definition at line 25 of file ParticleExtraInfoMap.cc.
unsigned int getMapForNewVar | ( | const std::string & | name, |
unsigned int | oldMapID, | ||
unsigned int | insertIndex | ||
) |
Return map ID to a map that has 'name' at place 'insertIndex' and is compatible with previous map (in oldMapID)
Will reuse old map or another existing map if compatible, creates a new map if necessary.
Definition at line 42 of file ParticleExtraInfoMap.cc.
|
inline |
|
staticprivate |
check if all entries in 'oldMap' prior to insertIndex are found in 'map' (with same idx).
Definition at line 85 of file ParticleExtraInfoMap.cc.
|
private |
List of string -> index maps.
Definition at line 61 of file ParticleExtraInfoMap.h.