ATLAS Offline Software
LArRoIMap.h
Go to the documentation of this file.
1 // This file's extension implies that it's C, but it's really -*- C++ -*-.
2 /*
3  * Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration.
4  */
17 #ifndef LARRECCONDITIONS_LARROIMAP_H
18 #define LARRECCONDITIONS_LARROIMAP_H
19 
20 
21 #include "Identifier/Identifier.h"
23 #include <vector>
24 #include <unordered_map>
25 
26 
30 class LArRoIMap
31 {
32 public:
33  // TT_ID is TT hashId + sam coded in unsigned int, (sam+ hash<<2)
34  typedef unsigned int TT_ID;
35  typedef HWIdentifier COLL_ID ;
36 
37 
42  LArRoIMap (TT_ID layer_hash_max);
43 
44 
48  TT_ID trigTowerID (const Identifier& channel_id ) const;
49 
50 
54  TT_ID trigTowerID (const HWIdentifier& id ) const;
55 
56 
60  const std::vector<COLL_ID>& collectionID(const TT_ID& id) const ;
61 
62 
66  bool validID(const TT_ID& tt_id) const ;
67 
68 
69 
77  void addEntry (const Identifier& id,
78  const HWIdentifier& sigId,
79  const HWIdentifier& robId,
80  TT_ID hashid_sam);
81 
82 
83 private:
86 
88  std::unordered_map<Identifier, TT_ID> m_offmap;
89 
91  std::unordered_map<Identifier, TT_ID> m_onlmap;
92 
94  std::unordered_map<TT_ID, std::vector<COLL_ID> > m_roimap;
95 };
96 
97 
98 #include "AthenaKernel/CondCont.h"
99 CLASS_DEF( LArRoIMap, 13658032, 1)
100 CONDCONT_DEF( LArRoIMap, 125932578 );
101 
102 
103 #endif // not LARRECCONDITIONS_LARROIMAP_H
LArRoIMap::m_layer_hash_max
TT_ID m_layer_hash_max
Maximum hash ID.
Definition: LArRoIMap.h:85
CondCont.h
Hold mappings of ranges to condition objects.
LArRoIMap::addEntry
void addEntry(const Identifier &id, const HWIdentifier &sigId, const HWIdentifier &robId, TT_ID hashid_sam)
Add a new entry to the map.
Definition: LArRoIMap.cxx:91
LArRoIMap::m_roimap
std::unordered_map< TT_ID, std::vector< COLL_ID > > m_roimap
Map from trigger tower ID to list of ROBs.
Definition: LArRoIMap.h:94
HWIdentifier
Definition: HWIdentifier.h:13
LArRoIMap::m_offmap
std::unordered_map< Identifier, TT_ID > m_offmap
Map from offline ID to trigger tower ID.
Definition: LArRoIMap.h:88
CONDCONT_DEF
CONDCONT_DEF(LArRoIMap, 125932578)
LArRoIMap::COLL_ID
HWIdentifier COLL_ID
Definition: LArRoIMap.h:35
LArRoIMap::validID
bool validID(const TT_ID &tt_id) const
Check validity of a trigger tower ID.
Definition: LArRoIMap.cxx:78
createCoolChannelIdFile.channel_id
channel_id
Definition: createCoolChannelIdFile.py:52
LArRoIMap::LArRoIMap
LArRoIMap(TT_ID layer_hash_max)
Constructor.
Definition: LArRoIMap.cxx:23
HWIdentifier.h
LArRoIMap::m_onlmap
std::unordered_map< Identifier, TT_ID > m_onlmap
Map from online ID to trigger tower ID.
Definition: LArRoIMap.h:91
LArRoIMap::TT_ID
unsigned int TT_ID
Definition: LArRoIMap.h:34
LArRoIMap
Mapping between calorimeter trigger id to offline/online Identifier.
Definition: LArRoIMap.h:31
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:64
LArRoIMap::trigTowerID
TT_ID trigTowerID(const Identifier &channel_id) const
Translate offline channel identifier to trigger tower ID.
Definition: LArRoIMap.cxx:32
LArRoIMap::collectionID
const std::vector< COLL_ID > & collectionID(const TT_ID &id) const
Get list of robIds for a given trigger tower ID.
Definition: LArRoIMap.cxx:59
Identifier
Definition: IdentifierFieldParser.cxx:14