ATLAS Offline Software
Loading...
Searching...
No Matches
LArRoIMap.cxx
Go to the documentation of this file.
1/*
2 * Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration.
3 */
14
15
17
18
24 : m_layer_hash_max (layer_hash_max)
25{
26}
27
28
33{
34 auto it = m_offmap.find (channel_id);
35 if (it == m_offmap.end()) {
36 return m_layer_hash_max + 1;
37 }
38 return it->second;
39}
40
41
46{
47 auto it = m_onlmap.find (id);
48 if (it == m_onlmap.end()) {
49 return m_layer_hash_max + 1;
50 }
51 return it->second;
52}
53
54
58const std::vector<LArRoIMap::COLL_ID>&
59LArRoIMap::collectionID (const TT_ID& RoIid) const
60{
61 auto it = m_roimap.find(RoIid);
62 if(it !=m_roimap.end()) {
63 return it->second;
64 }
65
66 // It is expected to have request that may not be in the map.
67 // Not all TTs have all samplings. For example, at eta>1.8, there is no
68 // presampler.
69
70 static const std::vector<COLL_ID> v ;
71 return v;
72}
73
74
78bool LArRoIMap::validID (const TT_ID& RoIid ) const
79{
80 return m_roimap.find (RoIid) != m_roimap.end();
81}
82
83
92 const HWIdentifier& sigId,
93 const HWIdentifier& robId,
94 TT_ID hashid_sam)
95{
96 m_offmap[id] = hashid_sam;
97 m_onlmap[sigId] = hashid_sam;
98 std::vector<COLL_ID>& v = m_roimap[hashid_sam];
99 if (std::find (v.begin(), v.end(), robId) == v.end()) {
100 v.push_back (robId);
101 }
102}
Mapping between calorimeter trigger id to offline/online Identifier.
std::unordered_map< Identifier, TT_ID > m_offmap
Map from offline ID to trigger tower ID.
Definition LArRoIMap.h:88
std::unordered_map< TT_ID, std::vector< COLL_ID > > m_roimap
Map from trigger tower ID to list of ROBs.
Definition LArRoIMap.h:94
LArRoIMap(TT_ID layer_hash_max)
Constructor.
Definition LArRoIMap.cxx:23
std::unordered_map< Identifier, TT_ID > m_onlmap
Map from online ID to trigger tower ID.
Definition LArRoIMap.h:91
bool validID(const TT_ID &tt_id) const
Check validity of a trigger tower ID.
Definition LArRoIMap.cxx:78
TT_ID trigTowerID(const Identifier &channel_id) const
Translate offline channel identifier to trigger tower ID.
Definition LArRoIMap.cxx:32
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
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
unsigned int TT_ID
Definition LArRoIMap.h:34
TT_ID m_layer_hash_max
Maximum hash ID.
Definition LArRoIMap.h:85