9#include <analysis/dataobjects/ParticleExtraInfoMap.h>
18 auto it = map.find(name);
27 const unsigned int insertIndex = 1;
28 for (
unsigned int iMap = 0; iMap <
m_maps.size(); iMap++) {
29 const auto it =
m_maps[iMap].find(name);
30 if (it !=
m_maps[iMap].end() and it->second == insertIndex)
35 map[name] = insertIndex;
47 const unsigned int lastIndexInOldMap = oldMap.size();
48 if (lastIndexInOldMap + 1 == insertIndex) {
50 m_maps[oldMapID][name] = insertIndex;
53 auto oldMapIter = oldMap.find(name);
54 if (oldMapIter != oldMap.end()) {
55 if (oldMapIter->second == insertIndex) {
60 for (
unsigned int iMap = 0; iMap <
m_maps.size(); iMap++) {
62 const auto it = map.find(name);
63 if (it != map.end() and it->second == insertIndex) {
74 for (
const auto& pair : oldMap) {
75 if (pair.second < insertIndex)
76 map[pair.first] = pair.second;
78 map[name] = insertIndex;
87 for (
const auto& pair : oldMap) {
88 if (pair.second < insertIndex) {
89 const auto it = map.find(pair.first);
90 if (it == map.end() or it->second != pair.second) {
unsigned int getMapForNewVar(const std::string &name)
Return map ID to a map that has 'name' as first entry.
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.
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).
std::vector< IndexMap > m_maps
List of string -> index maps.
std::map< std::string, unsigned int > IndexMap
string -> index map.
Abstract base class for different kinds of events.