ATLAS Offline Software
Loading...
Searching...
No Matches
LArRoIMap Class Reference

Mapping between calorimeter trigger id to offline/online Identifier. More...

#include <LArRoIMap.h>

Collaboration diagram for LArRoIMap:

Public Types

typedef unsigned int TT_ID
typedef HWIdentifier COLL_ID

Public Member Functions

 LArRoIMap (TT_ID layer_hash_max)
 Constructor.
TT_ID trigTowerID (const Identifier &channel_id) const
 Translate offline channel identifier to trigger tower ID.
TT_ID trigTowerID (const HWIdentifier &id) const
 Translate online channel identifier to trigger tower ID.
const std::vector< COLL_ID > & collectionID (const TT_ID &id) const
 Get list of robIds for a given trigger tower ID.
bool validID (const TT_ID &tt_id) const
 Check validity of a trigger tower ID.
void addEntry (const Identifier &id, const HWIdentifier &sigId, const HWIdentifier &robId, TT_ID hashid_sam)
 Add a new entry to the map.

Private Attributes

TT_ID m_layer_hash_max
 Maximum hash ID.
std::unordered_map< Identifier, TT_IDm_offmap
 Map from offline ID to trigger tower ID.
std::unordered_map< Identifier, TT_IDm_onlmap
 Map from online ID to trigger tower ID.
std::unordered_map< TT_ID, std::vector< COLL_ID > > m_roimap
 Map from trigger tower ID to list of ROBs.

Detailed Description

Mapping between calorimeter trigger id to offline/online Identifier.

Definition at line 30 of file LArRoIMap.h.

Member Typedef Documentation

◆ COLL_ID

Definition at line 35 of file LArRoIMap.h.

◆ TT_ID

typedef unsigned int LArRoIMap::TT_ID

Definition at line 34 of file LArRoIMap.h.

Constructor & Destructor Documentation

◆ LArRoIMap()

LArRoIMap::LArRoIMap ( TT_ID layer_hash_max)

Constructor.

Parameters
layer_hash_maxMaximum hash value.

Definition at line 23 of file LArRoIMap.cxx.

24 : m_layer_hash_max (layer_hash_max)
25{
26}
TT_ID m_layer_hash_max
Maximum hash ID.
Definition LArRoIMap.h:85

Member Function Documentation

◆ addEntry()

void LArRoIMap::addEntry ( const Identifier & id,
const HWIdentifier & sigId,
const HWIdentifier & robId,
TT_ID hashid_sam )

Add a new entry to the map.

Parameters
idOffline channel ID.
sigIdOnline channel ID.
robID.
hashid_samTrigger tower ID.

Definition at line 91 of file LArRoIMap.cxx.

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}
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
std::unordered_map< Identifier, TT_ID > m_onlmap
Map from online ID to trigger tower ID.
Definition LArRoIMap.h:91

◆ collectionID()

const std::vector< LArRoIMap::COLL_ID > & LArRoIMap::collectionID ( const TT_ID & id) const

Get list of robIds for a given trigger tower ID.

Definition at line 59 of file LArRoIMap.cxx.

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}

◆ trigTowerID() [1/2]

LArRoIMap::TT_ID LArRoIMap::trigTowerID ( const HWIdentifier & id) const

Translate online channel identifier to trigger tower ID.

Definition at line 45 of file LArRoIMap.cxx.

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}

◆ trigTowerID() [2/2]

LArRoIMap::TT_ID LArRoIMap::trigTowerID ( const Identifier & channel_id) const

Translate offline channel identifier to trigger tower ID.

Definition at line 32 of file LArRoIMap.cxx.

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}

◆ validID()

bool LArRoIMap::validID ( const TT_ID & tt_id) const

Check validity of a trigger tower ID.

Definition at line 78 of file LArRoIMap.cxx.

79{
80 return m_roimap.find (RoIid) != m_roimap.end();
81}

Member Data Documentation

◆ m_layer_hash_max

TT_ID LArRoIMap::m_layer_hash_max
private

Maximum hash ID.

Definition at line 85 of file LArRoIMap.h.

◆ m_offmap

std::unordered_map<Identifier, TT_ID> LArRoIMap::m_offmap
private

Map from offline ID to trigger tower ID.

Definition at line 88 of file LArRoIMap.h.

◆ m_onlmap

std::unordered_map<Identifier, TT_ID> LArRoIMap::m_onlmap
private

Map from online ID to trigger tower ID.

Definition at line 91 of file LArRoIMap.h.

◆ m_roimap

std::unordered_map<TT_ID, std::vector<COLL_ID> > LArRoIMap::m_roimap
private

Map from trigger tower ID to list of ROBs.

Definition at line 94 of file LArRoIMap.h.


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