Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Private Attributes | List of all members
CSCcablingSvc Class Reference

#include <CSCcablingSvc.h>

Inheritance diagram for CSCcablingSvc:
Collaboration diagram for CSCcablingSvc:

Public Member Functions

virtual StatusCode initialize () override
 
bool onlineId (const uint16_t subdetectorID, const uint16_t offlineID, uint32_t &rodId) const
 map offline ROD identifier to online ID More...
 
bool onlineId (const uint16_t offlineID, uint16_t &rodId) const
 
bool offlineId (const uint32_t onlineIdentifier, uint16_t &rodId) const
 reverse map of online ID into offline ROD ID More...
 
bool is_rodId (const uint16_t rodId) const
 check that we have the correct online ROD id More...
 
bool is_offlineRodId (const uint16_t rodId) const
 check that we have the correct offline ROD id More...
 
uint16_t collectionId (const uint16_t subdetectorId, const uint16_t rodId) const
 calculate the collection Identifier More...
 
unsigned int nSide () const
 
unsigned int nROD () const
 
unsigned int maxId () const
 
void hash2Rob (const unsigned int &, uint32_t &) const
 map PRD collection ID into short ROB ID, e.g. More...
 
void hash2RobFull (const unsigned int &, uint32_t &) const
 map PRD collection ID into full ROB ID (with subdetector ID), e.g. More...
 
void hash2Rod (const unsigned int &, uint32_t &) const
 map PRD collection ID into offline ROD ID More...
 
void hash2SubdetectorId (const unsigned int &, uint32_t &) const
 map PRD collection ID into subdetector ID, i.e. More...
 
void hash2CollectionId (const unsigned int &, uint16_t &) const
 map PRD collection ID into RDO collection ID More...
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Private Attributes

unsigned int m_side {2}
 
unsigned int m_rod {16}
 
unsigned int m_max {32}
 
Gaudi::Property< bool > m_run1 {this, "Run1Cabling", false}
 

Detailed Description

Definition at line 18 of file CSCcablingSvc.h.

Member Function Documentation

◆ collectionId()

uint16_t CSCcablingSvc::collectionId ( const uint16_t  subdetectorId,
const uint16_t  rodId 
) const

calculate the collection Identifier

Definition at line 180 of file CSCcablingSvc.cxx.

180  {
181 
182  uint16_t subId = (subDetectorId == 0x6A) ? 0 : 1;
183  uint16_t onlineColId = subId*this->nROD()+rodId;
184 
185  // new offline Rod range 0x10 - 0x1F Oct. 2014
186  // double number of rods
187  if((rodId & 0x10) == 0x10){
188  onlineColId = subId*this->nROD() + rodId - 16;
189  } else {
190  onlineColId = subId*this->nROD() + rodId;
191  }
192 
193  return onlineColId;
194 }

◆ hash2CollectionId()

void CSCcablingSvc::hash2CollectionId ( const unsigned int &  hashid,
uint16_t &  collectionid 
) const

map PRD collection ID into RDO collection ID

Definition at line 357 of file CSCcablingSvc.cxx.

357  {
358  uint32_t rodid = 0xffff;
359  hash2Rod(hashid, rodid);
360 
361  uint32_t subdetectorid = 0;
362  hash2SubdetectorId(hashid, subdetectorid);
363 
364  collectionid = collectionId(subdetectorid, rodid);
365 }

◆ hash2Rob()

void CSCcablingSvc::hash2Rob ( const unsigned int &  hashid,
uint32_t &  robid 
) const

map PRD collection ID into short ROB ID, e.g.

0x81

Definition at line 196 of file CSCcablingSvc.cxx.

196  {
197  if(m_run1){
198  switch (hashid){
199  case 0:
200  case 16:
201  case 8:
202  case 24:
203  robid = 0x05;
204  break;
205  case 1:
206  case 17:
207  case 9:
208  case 25:
209  robid = 0x07;
210  break;
211  case 2:
212  case 18:
213  case 10:
214  case 26:
215  robid = 0x09;
216  break;
217  case 3:
218  case 19:
219  case 11:
220  case 27:
221  robid = 0x11;
222  break;
223  case 4:
224  case 20:
225  case 12:
226  case 28:
227  robid = 0x15;
228  break;
229  case 5:
230  case 21:
231  case 13:
232  case 29:
233  robid = 0x17;
234  break;
235  case 6:
236  case 22:
237  case 14:
238  case 30:
239  robid = 0x19;
240  break;
241  case 7:
242  case 23:
243  case 15:
244  case 31:
245  robid = 0x21;
246  break;
247  default:
248  robid = 0xffff;
249  break;
250  }
251  } else {
252  switch (hashid){
253  case 16:
254  case 24:
255  robid = 0x80;
256  break;
257  case 17:
258  case 25:
259  robid = 0x82;
260  break;
261  case 18:
262  case 26:
263  robid = 0x84;
264  break;
265  case 19:
266  case 27:
267  robid = 0x86;
268  break;
269  case 20:
270  case 28:
271  robid = 0x88;
272  break;
273  case 21:
274  case 29:
275  robid = 0x8a;
276  break;
277  case 22:
278  case 30:
279  robid = 0x8c;
280  break;
281  case 23:
282  case 31:
283  robid = 0x8e;
284  break;
285  case 0:
286  case 8:
287  robid = 0x81;
288  break;
289  case 1:
290  case 9:
291  robid = 0x83;
292  break;
293  case 2:
294  case 10:
295  robid = 0x85;
296  break;
297  case 3:
298  case 11:
299  robid = 0x87;
300  break;
301  case 4:
302  case 12:
303  robid = 0x89;
304  break;
305  case 5:
306  case 13:
307  robid = 0x8b;
308  break;
309  case 6:
310  case 14:
311  robid = 0x8d;
312  break;
313  case 7:
314  case 15:
315  robid = 0x8f;
316  break;
317  default:
318  robid = 0xffff;
319  break;
320  }
321  }
322 }

◆ hash2RobFull()

void CSCcablingSvc::hash2RobFull ( const unsigned int &  hashid,
uint32_t &  robid 
) const

map PRD collection ID into full ROB ID (with subdetector ID), e.g.

0x6a0081

Definition at line 347 of file CSCcablingSvc.cxx.

347  {
348  uint32_t shortRobID = 0xffff;
349  hash2Rob(hashid, shortRobID);
350 
351  uint32_t subdetectorid = 0;
352  hash2SubdetectorId(hashid, subdetectorid);
353 
354  robid = (subdetectorid << 16) | shortRobID;
355 }

◆ hash2Rod()

void CSCcablingSvc::hash2Rod ( const unsigned int &  hashid,
uint32_t &  rodid 
) const

map PRD collection ID into offline ROD ID

Definition at line 326 of file CSCcablingSvc.cxx.

326  {
327  if(m_run1){
328  rodid = hashid & 7;
329  } else {
330  if (hashid<8)
331  rodid = hashid;
332  else if (hashid<24)
333  rodid = hashid-8;
334  else
335  rodid = hashid-16;
336  rodid |= 0x10;
337  }
338 }

◆ hash2SubdetectorId()

void CSCcablingSvc::hash2SubdetectorId ( const unsigned int &  hashid,
uint32_t &  subdetectorid 
) const

map PRD collection ID into subdetector ID, i.e.

0x69 or 0x6a

Definition at line 340 of file CSCcablingSvc.cxx.

340  {
341  if ((hashid >= 8 && hashid <= 15) || (hashid >= 24))
342  subdetectorid = 0x69;
343  else
344  subdetectorid = 0x6a;
345 }

◆ initialize()

StatusCode CSCcablingSvc::initialize ( )
overridevirtual

Definition at line 19 of file CSCcablingSvc.cxx.

19  {
20 
21  // Retrieve geometry config information from the database (RUN1, RUN2, etc...)
22  SmartIF<IRDBAccessSvc> rdbAccess{service("RDBAccessSvc")};
23  ATH_CHECK( rdbAccess.isValid() );
24 
25  SmartIF<IGeoModelSvc> geoModel{service("GeoModelSvc")};
26  if (!geoModel) {
27  ATH_MSG_ERROR( "Could not locate GeoModelSvc" );
28  } else {
29  // check the DetDescr version
30  std::string atlasVersion = geoModel->atlasVersion();
31 
32  IRDBRecordset_ptr atlasCommonRec = rdbAccess->getRecordsetPtr("AtlasCommon",atlasVersion,"ATLAS");
33  if(atlasCommonRec->size()==0) {
34  m_run1 = true;
35  } else {
36  std::string configVal = (*atlasCommonRec)[0]->getString("CONFIG");
37  if(configVal=="RUN1"){
38  m_run1 = true;
39  } else if(configVal=="RUN2" || configVal=="RUN3" || configVal=="RUN4") {
40  m_run1 = false;
41  } else {
42  ATH_MSG_FATAL("Unexpected value for geometry config read from the database: " << configVal);
43  return StatusCode::FAILURE;
44  }
45  }
46  }
47  m_rod = (m_run1 ? 8 : 16);
48  m_max = m_side * m_rod;
49 
50  return StatusCode::SUCCESS;
51 }

◆ is_offlineRodId()

bool CSCcablingSvc::is_offlineRodId ( const uint16_t  rodId) const

check that we have the correct offline ROD id

Definition at line 169 of file CSCcablingSvc.cxx.

169  {
170 
171  bool check = rodId == 0x0 || rodId == 0x1 || rodId == 0x2 || rodId == 0x3 ||
172  rodId == 0x4 || rodId == 0x5 || rodId == 0x6 || rodId == 0x7;
173 
174  // new offline Rod range 0x10 - 0x1F Oct. 2014
175  if((0x10 & rodId)==0x10) check = true;
176  return check;
177 }

◆ is_rodId()

bool CSCcablingSvc::is_rodId ( const uint16_t  rodId) const

check that we have the correct online ROD id

Definition at line 157 of file CSCcablingSvc.cxx.

157  {
158 
159  bool check = rodId == 0x5 || rodId == 0x7 || rodId == 0x9 || rodId == 0x11 ||
160  rodId == 0x15 || rodId == 0x17 || rodId == 0x19 || rodId == 0x21;
161 
162  // new online Rod 0x80 - 0x8F range Oct. 2014
163  if((rodId & 0x70) == 0) check = true;
164 
165  return check;
166 }

◆ maxId()

unsigned int CSCcablingSvc::maxId ( ) const
inline

Definition at line 42 of file CSCcablingSvc.h.

42 { return m_max; }

◆ msg() [1/2]

MsgStream& AthCommonMsg< Service >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< Service >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< Service >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ nROD()

unsigned int CSCcablingSvc::nROD ( ) const
inline

Definition at line 41 of file CSCcablingSvc.h.

41 { return m_rod; }

◆ nSide()

unsigned int CSCcablingSvc::nSide ( ) const
inline

Definition at line 40 of file CSCcablingSvc.h.

40 { return m_side; }

◆ offlineId()

bool CSCcablingSvc::offlineId ( const uint32_t  onlineIdentifier,
uint16_t &  rodId 
) const

reverse map of online ID into offline ROD ID

Definition at line 105 of file CSCcablingSvc.cxx.

105  {
106  bool check = true;
107  uint16_t id = onlineIdentifier & 0xFFFF;
108  switch ( id ) {
109  case 0x0005 :
110  rodId = 0x0;
111  break;
112  case 0x0007 :
113  rodId = 0x1;
114  break;
115  case 0x0009 :
116  rodId = 0x2;
117  break;
118  case 0x0011 :
119  rodId = 0x3;
120  break;
121  case 0x0015 :
122  rodId = 0x4; // slot 13 reserved
123  break;
124  case 0x0017 :
125  rodId = 0x5;
126  break;
127  case 0x0019 :
128  rodId = 0x6;
129  break;
130  case 0x0021 :
131  rodId = 0x7;
132  break;
133  case 0x000A :
134  rodId = 0x0; // cosmic test simulation
135  break;
136  case 0x000C :
137  rodId = 0x1; // cosmic test simulation
138  break;
139  default :
140  check = false;
141  rodId = 0xFFFF;
142  }
143  // new online Rod 0x80 - 0x8F range Oct. 2014
144  if(!check && (id & 0x70) == 0){
145  check = true;
146  if( id & 1 ) {
147  rodId = (((id & 0xf) >> 1) | 0x10);
148  } else {
149  rodId = (((id & 0xf) >> 1) | 0x18);
150  }
151  }
152 
153  return check;
154 }

◆ onlineId() [1/2]

bool CSCcablingSvc::onlineId ( const uint16_t  offlineID,
uint16_t &  rodId 
) const

Definition at line 63 of file CSCcablingSvc.cxx.

63  {
64 
65  bool check = true;
66  switch ( offlineID ) {
67  case 0x0 :
68  rodId = 0x0005;
69  break;
70  case 0x1 :
71  rodId = 0x0007;
72  break;
73  case 0x2 :
74  rodId = 0x0009;
75  break;
76  case 0x3 :
77  rodId = 0x0011;
78  break;
79  case 0x4 :
80  rodId = 0x0015; // slot 13 reserved
81  break;
82  case 0x5 :
83  rodId = 0x0017;
84  break;
85  case 0x6 :
86  rodId = 0x0019;
87  break;
88  case 0x7 :
89  rodId = 0x0021;
90  break;
91  default :
92  check = false;
93  rodId = 0xFFFF;
94  }
95 
96  if((offlineID & 0x1F) & 0x10){
97  check = true;
98  // uses Rod Ids in 0x10 - 0x1F
99  rodId = 0x80 | (0xF & offlineID);
100  }
101  return check;
102 }

◆ onlineId() [2/2]

bool CSCcablingSvc::onlineId ( const uint16_t  subdetectorID,
const uint16_t  offlineID,
uint32_t &  rodId 
) const

map offline ROD identifier to online ID

Definition at line 54 of file CSCcablingSvc.cxx.

54  {
55 
56  bool check = subDetectorID == 0x6A || subDetectorID == 0x69;
57  uint16_t id = 0xFFFF;
58  check = check && this->onlineId(offlineID, id);
59  rodId = (subDetectorID << 16) | id;
60  return check;
61 }

Member Data Documentation

◆ m_max

unsigned int CSCcablingSvc::m_max {32}
private

Definition at line 63 of file CSCcablingSvc.h.

◆ m_rod

unsigned int CSCcablingSvc::m_rod {16}
private

Definition at line 62 of file CSCcablingSvc.h.

◆ m_run1

Gaudi::Property<bool> CSCcablingSvc::m_run1 {this, "Run1Cabling", false}
private

Definition at line 65 of file CSCcablingSvc.h.

◆ m_side

unsigned int CSCcablingSvc::m_side {2}
private

Definition at line 61 of file CSCcablingSvc.h.


The documentation for this class was generated from the following files:
CSCcablingSvc::m_run1
Gaudi::Property< bool > m_run1
Definition: CSCcablingSvc.h:65
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
CSCcablingSvc::m_rod
unsigned int m_rod
Definition: CSCcablingSvc.h:62
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
CSCcablingSvc::onlineId
bool onlineId(const uint16_t subdetectorID, const uint16_t offlineID, uint32_t &rodId) const
map offline ROD identifier to online ID
Definition: CSCcablingSvc.cxx:54
CSCcablingSvc::m_max
unsigned int m_max
Definition: CSCcablingSvc.h:63
CSCcablingSvc::hash2Rod
void hash2Rod(const unsigned int &, uint32_t &) const
map PRD collection ID into offline ROD ID
Definition: CSCcablingSvc.cxx:326
CSCcablingSvc::nROD
unsigned int nROD() const
Definition: CSCcablingSvc.h:41
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
CSCcablingSvc::hash2Rob
void hash2Rob(const unsigned int &, uint32_t &) const
map PRD collection ID into short ROB ID, e.g.
Definition: CSCcablingSvc.cxx:196
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CSCcablingSvc::collectionId
uint16_t collectionId(const uint16_t subdetectorId, const uint16_t rodId) const
calculate the collection Identifier
Definition: CSCcablingSvc.cxx:180
IRDBRecordset_ptr
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
Definition: IRDBAccessSvc.h:25
CSCcablingSvc::hash2SubdetectorId
void hash2SubdetectorId(const unsigned int &, uint32_t &) const
map PRD collection ID into subdetector ID, i.e.
Definition: CSCcablingSvc.cxx:340
LArNewCalib_Delay_OFC_Cali.check
check
Definition: LArNewCalib_Delay_OFC_Cali.py:267
python.CaloAddPedShiftConfig.default
default
Definition: CaloAddPedShiftConfig.py:43
CSCcablingSvc::m_side
unsigned int m_side
Definition: CSCcablingSvc.h:61