ATLAS Offline Software
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
TRT_CablingData Class Reference

#include <TRT_CablingData.h>

Collaboration diagram for TRT_CablingData:

Classes

struct  idpair
 

Public Member Functions

 TRT_CablingData ()
 
virtual ~TRT_CablingData ()
 
void zero_identifierForAllStraws (int rod, const std::vector< Identifier > &tempbuff)
 
void zero_identifierHashForAllStraws (int rod, const std::vector< IdentifierHash > &tempbuff)
 
void set_identifierForAllStraws (int rod, int bufferPosition, Identifier strawID)
 
void set_identifierForAllStraws (Identifier strawID)
 
void set_identifierHashForAllStraws (int rod, int bufferPosition, IdentifierHash hashId)
 
void set_identifierHashForAllStraws (IdentifierHash hashId)
 
Identifier get_identifierForAllStraws (int rod, int bufferPosition) const
 
IdentifierHash get_identifierHashForAllStraws (int rod, int bufferPosition) const
 
Identifier get_identifierForAllStraws (int shift) const
 
IdentifierHash get_identifierHashForAllStraws (int shift) const
 
uint32_t get_BufferOffset (Identifier StrawId)
 
void add_collID (uint32_t rob_id, std::vector< IdentifierHash > *vectID)
 
const std::vector< IdentifierHash > & get_collID (int shift)
 
void add_allRobs (uint32_t sidROB)
 
const std::vector< uint32_t > & get_allRods () const
 

Private Types

typedef std::pair< Identifier, IdentifierHashidandhash_t
 
typedef std::vector< idandhash_toffsetvec_t
 
typedef std::vector< offsetvec_trodvec_t
 
typedef std::map< unsigned int, rodvec_trodmap_t
 

Private Member Functions

idandhash_tfind_idandhash (int rod, int bufferPosition)
 
const idandhash_tfind_idandhash (int rod, int bufferPosition) const
 

Private Attributes

std::vector< uint32_t > m_allRobs
 
std::vector< Identifierm_identifierForAllStraws
 
std::vector< IdentifierHashm_identifierHashForAllStraws
 
std::vector< idpairm_BufferOffsetForAllIdentifiers
 
bool m_bofai_sorted
 
std::map< uint32_t, std::vector< IdentifierHash > * > m_collID
 
rodmap_t m_rodoffset_to_id
 

Detailed Description

Definition at line 18 of file TRT_CablingData.h.

Member Typedef Documentation

◆ idandhash_t

Definition at line 102 of file TRT_CablingData.h.

◆ offsetvec_t

typedef std::vector<idandhash_t> TRT_CablingData::offsetvec_t
private

Definition at line 103 of file TRT_CablingData.h.

◆ rodmap_t

typedef std::map<unsigned int, rodvec_t> TRT_CablingData::rodmap_t
private

Definition at line 105 of file TRT_CablingData.h.

◆ rodvec_t

typedef std::vector<offsetvec_t> TRT_CablingData::rodvec_t
private

Definition at line 104 of file TRT_CablingData.h.

Constructor & Destructor Documentation

◆ TRT_CablingData()

TRT_CablingData::TRT_CablingData ( )

Definition at line 18 of file TRT_CablingData.cxx.

19  : m_bofai_sorted (true)
20 {
21 }

◆ ~TRT_CablingData()

TRT_CablingData::~TRT_CablingData ( )
virtual

Definition at line 24 of file TRT_CablingData.cxx.

25 {
26  for (std::map< uint32_t, std::vector<IdentifierHash> *>::iterator i =
27  m_collID.begin();
28  i != m_collID.end();
29  ++i)
30  delete i->second;
31 }

Member Function Documentation

◆ add_allRobs()

void TRT_CablingData::add_allRobs ( uint32_t  sidROB)

Definition at line 181 of file TRT_CablingData.cxx.

182 {
183  m_allRobs.push_back(sidROB);
184 }

◆ add_collID()

void TRT_CablingData::add_collID ( uint32_t  rob_id,
std::vector< IdentifierHash > *  vectID 
)

Definition at line 168 of file TRT_CablingData.cxx.

169 {
170  m_collID[rob_id] = vectID;
171 }

◆ find_idandhash() [1/2]

TRT_CablingData::idandhash_t & TRT_CablingData::find_idandhash ( int  rod,
int  bufferPosition 
)
private

Definition at line 49 of file TRT_CablingData.cxx.

50 {
51  assert (rod >= 0);
52  assert (bufferPosition >= 0);
53  unsigned int rodhi = ((unsigned)rod & 0xffff0000) >> 16;
54  unsigned int rodlo = (rod & 0x0000ffff);
55  rodvec_t& rodvec = m_rodoffset_to_id[rodhi];
56  if (rodvec.size() <= rodlo)
57  rodvec.resize (rodlo + 1);
58  offsetvec_t& offsetvec = rodvec[rodlo];
59  if (offsetvec.size() <= (unsigned)bufferPosition)
60  offsetvec.resize (bufferPosition+1);
61  return offsetvec[bufferPosition];
62 }

◆ find_idandhash() [2/2]

const TRT_CablingData::idandhash_t & TRT_CablingData::find_idandhash ( int  rod,
int  bufferPosition 
) const
private

Definition at line 65 of file TRT_CablingData.cxx.

66 {
67  assert (rod >= 0);
68  assert (bufferPosition >= 0);
69  unsigned int rodhi = ((unsigned)rod & 0xffff0000) >> 16;
70  unsigned int rodlo = (rod & 0x0000ffff);
71  auto it = m_rodoffset_to_id.find (rodhi);
72  if (it != m_rodoffset_to_id.end()) {
73  const rodvec_t& rodvec = it->second;
74  if (rodlo < rodvec.size()) {
75  const offsetvec_t& offsetvec = rodvec[rodlo];
76  if ((unsigned)bufferPosition < offsetvec.size())
77  return offsetvec[bufferPosition];
78  }
79  }
80 
81  static const idandhash_t dum;
82  return dum;
83 }

◆ get_allRods()

const std::vector< uint32_t > & TRT_CablingData::get_allRods ( ) const

Definition at line 187 of file TRT_CablingData.cxx.

188 {
189  return m_allRobs;
190 }

◆ get_BufferOffset()

uint32_t TRT_CablingData::get_BufferOffset ( Identifier  StrawId)

Definition at line 146 of file TRT_CablingData.cxx.

147 {
148  // cout << "get m_BufferOffsetForAllIdentifiers["
149  // << std::hex << StrawId << std::dec
150  // << "] = " << m_BufferOffsetForAllIdentifiers[StrawId] << endl;
151 
152  if (!m_bofai_sorted) {
155  m_bofai_sorted = true;
156  }
157 
159  std::lower_bound (m_BufferOffsetForAllIdentifiers.begin(),
161  StrawId);
162  assert (i != m_BufferOffsetForAllIdentifiers.end() && i->first == StrawId);
163  return i->second;
164 }

◆ get_collID()

const std::vector< IdentifierHash > & TRT_CablingData::get_collID ( int  shift)

Definition at line 175 of file TRT_CablingData.cxx.

176 {
177  return *m_collID[shift];
178 }

◆ get_identifierForAllStraws() [1/2]

Identifier TRT_CablingData::get_identifierForAllStraws ( int  rod,
int  bufferPosition 
) const

Definition at line 120 of file TRT_CablingData.cxx.

122 {
123  return find_idandhash (rod, bufferPosition).first;
124 }

◆ get_identifierForAllStraws() [2/2]

Identifier TRT_CablingData::get_identifierForAllStraws ( int  shift) const

Definition at line 134 of file TRT_CablingData.cxx.

135 {
136  return m_identifierForAllStraws[shift];
137 }

◆ get_identifierHashForAllStraws() [1/2]

IdentifierHash TRT_CablingData::get_identifierHashForAllStraws ( int  rod,
int  bufferPosition 
) const

Definition at line 126 of file TRT_CablingData.cxx.

128 {
129  return find_idandhash (rod, bufferPosition).second;
130 }

◆ get_identifierHashForAllStraws() [2/2]

IdentifierHash TRT_CablingData::get_identifierHashForAllStraws ( int  shift) const

Definition at line 140 of file TRT_CablingData.cxx.

141 {
142  return m_identifierHashForAllStraws[shift];
143 }

◆ set_identifierForAllStraws() [1/2]

void TRT_CablingData::set_identifierForAllStraws ( Identifier  strawID)

Definition at line 100 of file TRT_CablingData.cxx.

101 {
102  m_identifierForAllStraws.push_back(strawID);
103 }

◆ set_identifierForAllStraws() [2/2]

void TRT_CablingData::set_identifierForAllStraws ( int  rod,
int  bufferPosition,
Identifier  strawID 
)

Definition at line 86 of file TRT_CablingData.cxx.

88 {
89  find_idandhash (rod, bufferPosition).first = strawID;
90  m_BufferOffsetForAllIdentifiers.emplace_back(strawID, bufferPosition);
91  m_bofai_sorted = false;
92 
93  // cout << "set m_BufferOffsetForAllIdentifiers["
94  // << std::hex << strawID << std::dec
95  // << "] = " << bufferPosition << endl;
96 }

◆ set_identifierHashForAllStraws() [1/2]

void TRT_CablingData::set_identifierHashForAllStraws ( IdentifierHash  hashId)

Definition at line 114 of file TRT_CablingData.cxx.

115 {
116  m_identifierHashForAllStraws.push_back(hashId);
117 }

◆ set_identifierHashForAllStraws() [2/2]

void TRT_CablingData::set_identifierHashForAllStraws ( int  rod,
int  bufferPosition,
IdentifierHash  hashId 
)

Definition at line 107 of file TRT_CablingData.cxx.

109 {
110  find_idandhash (rod, bufferPosition).second = hashId;
111 }

◆ zero_identifierForAllStraws()

void TRT_CablingData::zero_identifierForAllStraws ( int  rod,
const std::vector< Identifier > &  tempbuff 
)

Definition at line 34 of file TRT_CablingData.cxx.

36 {
37  return;
38 }

◆ zero_identifierHashForAllStraws()

void TRT_CablingData::zero_identifierHashForAllStraws ( int  rod,
const std::vector< IdentifierHash > &  tempbuff 
)

Definition at line 41 of file TRT_CablingData.cxx.

43 {
44  return;
45 }

Member Data Documentation

◆ m_allRobs

std::vector<uint32_t> TRT_CablingData::m_allRobs
private

Definition at line 77 of file TRT_CablingData.h.

◆ m_bofai_sorted

bool TRT_CablingData::m_bofai_sorted
private

Definition at line 96 of file TRT_CablingData.h.

◆ m_BufferOffsetForAllIdentifiers

std::vector<idpair> TRT_CablingData::m_BufferOffsetForAllIdentifiers
private

Definition at line 95 of file TRT_CablingData.h.

◆ m_collID

std::map< uint32_t, std::vector<IdentifierHash> *> TRT_CablingData::m_collID
private

Definition at line 100 of file TRT_CablingData.h.

◆ m_identifierForAllStraws

std::vector<Identifier> TRT_CablingData::m_identifierForAllStraws
private

Definition at line 80 of file TRT_CablingData.h.

◆ m_identifierHashForAllStraws

std::vector<IdentifierHash> TRT_CablingData::m_identifierHashForAllStraws
private

Definition at line 83 of file TRT_CablingData.h.

◆ m_rodoffset_to_id

rodmap_t TRT_CablingData::m_rodoffset_to_id
private

Definition at line 106 of file TRT_CablingData.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
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::m_bofai_sorted
bool m_bofai_sorted
Definition: TRT_CablingData.h:96
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
skel.it
it
Definition: skel.GENtoEVGEN.py:396
xAOD::unsigned
unsigned
Definition: RingSetConf_v1.cxx:662
TRT_CablingData::m_BufferOffsetForAllIdentifiers
std::vector< idpair > m_BufferOffsetForAllIdentifiers
Definition: TRT_CablingData.h:95
lumiFormat.i
int i
Definition: lumiFormat.py:85
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::offsetvec_t
std::vector< idandhash_t > offsetvec_t
Definition: TRT_CablingData.h:103
TRT_CablingData::m_identifierForAllStraws
std::vector< Identifier > m_identifierForAllStraws
Definition: TRT_CablingData.h:80
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
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
TRT_CablingData::rodvec_t
std::vector< offsetvec_t > rodvec_t
Definition: TRT_CablingData.h:104
TRT_CablingData::m_allRobs
std::vector< uint32_t > m_allRobs
Definition: TRT_CablingData.h:77