ATLAS Offline Software
TRT_CablingData.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //
6 // TRT_CablingData class - class for TRT Mapping storing
7 // A.Zalite
8 //
9 #ifndef TRT_CABLINGDATA_H
10 #define TRT_CABLINGDATA_H
11 
12 #include "Identifier/Identifier.h"
14 #include <map>
15 #include <vector>
16 #include <stdint.h>
17 
19 
20 public:
21  //Constructor
23 
24  //Destructor
25  virtual ~TRT_CablingData();
26 
27  // Initialize m_identifierForAllStraws with zeros (TB case)
28  void zero_identifierForAllStraws(int rod, const std::vector<Identifier>& tempbuff);
29 
30  // Initialize m_identifierHashForAllStraws with zeros (TB case)
31  void zero_identifierHashForAllStraws(int rod, const std::vector<IdentifierHash>& tempbuff);
32 
33  // Set value of Identifier for each straw (TB case)
34  void set_identifierForAllStraws(int rod, int bufferPosition,
35  Identifier strawID);
36 
37  // Set value of Identifier for each straw (DC1, DC2)
39 
40  // Set value of IdentifierHash for each straw (TB case)
41  void set_identifierHashForAllStraws(int rod, int bufferPosition,
42  IdentifierHash hashId);
43 
44  // Set value of IdentifierHash for each straw (DC1, DC2)
46 
47  // Get value of Identifier for each straw (TB case)
48  Identifier get_identifierForAllStraws(int rod, int bufferPosition) const;
49 
50  // Get value of IdentifierHash for each straw (TB case)
51  IdentifierHash get_identifierHashForAllStraws(int rod, int bufferPosition) const;
52 
53  // Get value of Identifier for each straw (DC1, DC2)
54  Identifier get_identifierForAllStraws(int shift) const;
55 
56  // Get value of IdentifierHash for each straw (DC1, DC2)
58 
59  // Get buffer offset from Identifier
61 
62 
63  // Add collection IDs for ROB
64  void add_collID(uint32_t rob_id, std::vector<IdentifierHash> * vectID);
65 
66  // Get Identifiers of Collections for the given ROBID
67  const std::vector<IdentifierHash>& get_collID(int shift);
68 
69  // Add SourceID
70  void add_allRobs(uint32_t sidROB);
71 
72  // Get all RODIDs for TRT
73  const std::vector<uint32_t>& get_allRods() const;
74 
75 private:
76  // Source ID for all robs
77  std::vector<uint32_t> m_allRobs;
78 
79  // Identifiers for all straws
80  std::vector<Identifier> m_identifierForAllStraws;
81 
82  // Hashed Identifiers for all straws;
83  std::vector<IdentifierHash> m_identifierHashForAllStraws;
84 
85  // Buffer Offsets for all Identifiers;
86  struct idpair
87  {
89  : first (a), second (b) {}
90  bool operator< (const idpair& other) const { return first < other.first; }
91  bool operator< (const Identifier& other) const { return first < other; }
94  };
95  std::vector<idpair> m_BufferOffsetForAllIdentifiers;
97 
98 
99  // Identifiers for all Collections for RODs
100  std::map< uint32_t, std::vector<IdentifierHash> *> m_collID;
101 
102  typedef std::pair<Identifier, IdentifierHash> idandhash_t;
103  typedef std::vector<idandhash_t> offsetvec_t;
104  typedef std::vector<offsetvec_t> rodvec_t;
105  typedef std::map<unsigned int, rodvec_t> rodmap_t;
107 
108  idandhash_t& find_idandhash (int rod, int bufferPosition);
109  const idandhash_t& find_idandhash (int rod, int bufferPosition) const;
110 };
111 
112 #endif // TRT_CABLINGDATA_H
TRT_CablingData::m_rodoffset_to_id
rodmap_t m_rodoffset_to_id
Definition: TRT_CablingData.h:106
TRT_CablingData::idandhash_t
std::pair< Identifier, IdentifierHash > idandhash_t
Definition: TRT_CablingData.h:102
TRT_CablingData::idpair::operator<
bool operator<(const idpair &other) const
Definition: TRT_CablingData.h:90
TRT_CablingData::m_bofai_sorted
bool m_bofai_sorted
Definition: TRT_CablingData.h:96
TRT_CablingData::set_identifierHashForAllStraws
void set_identifierHashForAllStraws(int rod, int bufferPosition, IdentifierHash hashId)
Definition: TRT_CablingData.cxx:107
TRT_CablingData::TRT_CablingData
TRT_CablingData()
Definition: TRT_CablingData.cxx:18
TRT_CablingData::idpair::second
uint32_t second
Definition: TRT_CablingData.h:93
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
TRT_CablingData::get_allRods
const std::vector< uint32_t > & get_allRods() const
Definition: TRT_CablingData.cxx:187
TRT_CablingData::~TRT_CablingData
virtual ~TRT_CablingData()
Definition: TRT_CablingData.cxx:24
TRT_CablingData::get_collID
const std::vector< IdentifierHash > & get_collID(int shift)
Definition: TRT_CablingData.cxx:175
TRT_CablingData::set_identifierForAllStraws
void set_identifierForAllStraws(int rod, int bufferPosition, Identifier strawID)
Definition: TRT_CablingData.cxx:86
TRT_CablingData::idpair::idpair
idpair(const Identifier &a, uint32_t b)
Definition: TRT_CablingData.h:88
TRT_CablingData::zero_identifierForAllStraws
void zero_identifierForAllStraws(int rod, const std::vector< Identifier > &tempbuff)
Definition: TRT_CablingData.cxx:35
TRT_CablingData::get_identifierHashForAllStraws
IdentifierHash get_identifierHashForAllStraws(int rod, int bufferPosition) const
Definition: TRT_CablingData.cxx:127
TRT_CablingData::add_allRobs
void add_allRobs(uint32_t sidROB)
Definition: TRT_CablingData.cxx:181
TRT_CablingData::get_BufferOffset
uint32_t get_BufferOffset(Identifier StrawId)
Definition: TRT_CablingData.cxx:146
TRT_CablingData::m_BufferOffsetForAllIdentifiers
std::vector< idpair > m_BufferOffsetForAllIdentifiers
Definition: TRT_CablingData.h:95
TRT_CablingData::add_collID
void add_collID(uint32_t rob_id, std::vector< IdentifierHash > *vectID)
Definition: TRT_CablingData.cxx:168
TRT_CablingData::idpair
Definition: TRT_CablingData.h:87
TRT_CablingData::m_collID
std::map< uint32_t, std::vector< IdentifierHash > * > m_collID
Definition: TRT_CablingData.h:100
RunTileMonitoring.rod
rod
Definition: RunTileMonitoring.py:134
TRT_CablingData::rodmap_t
std::map< unsigned int, rodvec_t > rodmap_t
Definition: TRT_CablingData.h:105
TRT_CablingData::offsetvec_t
std::vector< idandhash_t > offsetvec_t
Definition: TRT_CablingData.h:103
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
IdentifierHash.h
TRT_CablingData::get_identifierForAllStraws
Identifier get_identifierForAllStraws(int rod, int bufferPosition) const
Definition: TRT_CablingData.cxx:120
TRT_CablingData::idpair::first
Identifier first
Definition: TRT_CablingData.h:92
TRT_CablingData::m_identifierForAllStraws
std::vector< Identifier > m_identifierForAllStraws
Definition: TRT_CablingData.h:80
a
TList * a
Definition: liststreamerinfos.cxx:10
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
TRT_CablingData
Definition: TRT_CablingData.h:18
TRT_CablingData::m_identifierHashForAllStraws
std::vector< IdentifierHash > m_identifierHashForAllStraws
Definition: TRT_CablingData.h:83
TRT_CablingData::find_idandhash
idandhash_t & find_idandhash(int rod, int bufferPosition)
Definition: TRT_CablingData.cxx:49
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
TRT_CablingData::rodvec_t
std::vector< offsetvec_t > rodvec_t
Definition: TRT_CablingData.h:104
TRT_CablingData::zero_identifierHashForAllStraws
void zero_identifierHashForAllStraws(int rod, const std::vector< IdentifierHash > &tempbuff)
Definition: TRT_CablingData.cxx:42
TRT_CablingData::m_allRobs
std::vector< uint32_t > m_allRobs
Definition: TRT_CablingData.h:77
Identifier
Definition: IdentifierFieldParser.cxx:14