ATLAS Offline Software
Public Member Functions | Static 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

 CSCcablingSvc (const std::string &name, ISvcLocator *sl)
 
virtual ~CSCcablingSvc ()=default
 
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvIF)
 
virtual StatusCode initialize (void)
 
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
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 

Private Attributes

unsigned int m_side
 
unsigned int m_rod
 
unsigned int m_max
 
bool m_run1
 

Detailed Description

Definition at line 23 of file CSCcablingSvc.h.

Constructor & Destructor Documentation

◆ CSCcablingSvc()

CSCcablingSvc::CSCcablingSvc ( const std::string &  name,
ISvcLocator *  sl 
)

Definition at line 18 of file CSCcablingSvc.cxx.

19  : ::AthService(name,sl), m_side(2), m_rod(16), m_max(32)
20 {
21 
22  declareProperty("Run1Cabling", m_run1 = false);
23 }

◆ ~CSCcablingSvc()

virtual CSCcablingSvc::~CSCcablingSvc ( )
virtualdefault

Member Function Documentation

◆ collectionId()

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

calculate the collection Identifier

Definition at line 200 of file CSCcablingSvc.cxx.

200  {
201 
202  uint16_t subId = (subDetectorId == 0x6A) ? 0 : 1;
203  uint16_t onlineColId = subId*this->nROD()+rodId;
204 
205  // new offline Rod range 0x10 - 0x1F Oct. 2014
206  // double number of rods
207  if((rodId & 0x10) == 0x10){
208  onlineColId = subId*this->nROD() + rodId - 16;
209  } else {
210  onlineColId = subId*this->nROD() + rodId;
211  }
212 
213  return onlineColId;
214 }

◆ hash2CollectionId()

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

map PRD collection ID into RDO collection ID

Definition at line 377 of file CSCcablingSvc.cxx.

377  {
378  uint32_t rodid = 0xffff;
379  hash2Rod(hashid, rodid);
380 
381  uint32_t subdetectorid = 0;
382  hash2SubdetectorId(hashid, subdetectorid);
383 
384  collectionid = collectionId(subdetectorid, rodid);
385 }

◆ 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 216 of file CSCcablingSvc.cxx.

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

◆ 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 367 of file CSCcablingSvc.cxx.

367  {
368  uint32_t shortRobID = 0xffff;
369  hash2Rob(hashid, shortRobID);
370 
371  uint32_t subdetectorid = 0;
372  hash2SubdetectorId(hashid, subdetectorid);
373 
374  robid = (subdetectorid << 16) | shortRobID;
375 }

◆ hash2Rod()

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

map PRD collection ID into offline ROD ID

Definition at line 346 of file CSCcablingSvc.cxx.

346  {
347  if(m_run1){
348  rodid = hashid & 7;
349  } else {
350  if (hashid<8)
351  rodid = hashid;
352  else if (hashid<24)
353  rodid = hashid-8;
354  else
355  rodid = hashid-16;
356  rodid |= 0x10;
357  }
358 }

◆ 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 360 of file CSCcablingSvc.cxx.

360  {
361  if ((hashid >= 8 && hashid <= 15) || (hashid >= 24))
362  subdetectorid = 0x69;
363  else
364  subdetectorid = 0x6a;
365 }

◆ initialize()

StatusCode CSCcablingSvc::initialize ( void  )
virtual

Definition at line 36 of file CSCcablingSvc.cxx.

36  {
37 
38  ATH_MSG_DEBUG ( " in initialize()" );
40 
41  // Retrieve geometry config information from the database (RUN1, RUN2, etc...)
42  SmartIF<IRDBAccessSvc> rdbAccess{service("RDBAccessSvc")};
43  ATH_CHECK( rdbAccess.isValid() );
44 
45  SmartIF<IGeoModelSvc> geoModel{service("GeoModelSvc")};
46  if (!geoModel) {
47  ATH_MSG_ERROR( "Could not locate GeoModelSvc" );
48  } else {
49  // check the DetDescr version
50  std::string atlasVersion = geoModel->atlasVersion();
51 
52  IRDBRecordset_ptr atlasCommonRec = rdbAccess->getRecordsetPtr("AtlasCommon",atlasVersion,"ATLAS");
53  if(atlasCommonRec->size()==0) {
54  m_run1 = true;
55  } else {
56  std::string configVal = (*atlasCommonRec)[0]->getString("CONFIG");
57  if(configVal=="RUN1"){
58  m_run1 = true;
59  } else if(configVal=="RUN2" || configVal=="RUN3" || configVal=="RUN4") {
60  m_run1 = false;
61  } else {
62  ATH_MSG_FATAL("Unexpected value for geometry config read from the database: " << configVal);
63  return StatusCode::FAILURE;
64  }
65  }
66  }
67  m_rod = (m_run1 ? 8 : 16);
68  m_max = m_side * m_rod;
69 
70  return StatusCode::SUCCESS;
71 }

◆ interfaceID()

static const InterfaceID& CSCcablingSvc::interfaceID ( )
inlinestatic

Definition at line 29 of file CSCcablingSvc.h.

29 { return IID_ICSCcablingSvc; }

◆ is_offlineRodId()

bool CSCcablingSvc::is_offlineRodId ( const uint16_t  rodId) const

check that we have the correct offline ROD id

Definition at line 189 of file CSCcablingSvc.cxx.

189  {
190 
191  bool check = rodId == 0x0 || rodId == 0x1 || rodId == 0x2 || rodId == 0x3 ||
192  rodId == 0x4 || rodId == 0x5 || rodId == 0x6 || rodId == 0x7;
193 
194  // new offline Rod range 0x10 - 0x1F Oct. 2014
195  if((0x10 & rodId)==0x10) check = true;
196  return check;
197 }

◆ is_rodId()

bool CSCcablingSvc::is_rodId ( const uint16_t  rodId) const

check that we have the correct online ROD id

Definition at line 177 of file CSCcablingSvc.cxx.

177  {
178 
179  bool check = rodId == 0x5 || rodId == 0x7 || rodId == 0x9 || rodId == 0x11 ||
180  rodId == 0x15 || rodId == 0x17 || rodId == 0x19 || rodId == 0x21;
181 
182  // new online Rod 0x80 - 0x8F range Oct. 2014
183  if((rodId & 0x70) == 0) check = true;
184 
185  return check;
186 }

◆ maxId()

unsigned int CSCcablingSvc::maxId ( ) const
inline

Definition at line 52 of file CSCcablingSvc.h.

52 { 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 51 of file CSCcablingSvc.h.

51 { return m_rod; }

◆ nSide()

unsigned int CSCcablingSvc::nSide ( ) const
inline

Definition at line 50 of file CSCcablingSvc.h.

50 { 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 125 of file CSCcablingSvc.cxx.

125  {
126  bool check = true;
127  uint16_t id = onlineIdentifier & 0xFFFF;
128  switch ( id ) {
129  case 0x0005 :
130  rodId = 0x0;
131  break;
132  case 0x0007 :
133  rodId = 0x1;
134  break;
135  case 0x0009 :
136  rodId = 0x2;
137  break;
138  case 0x0011 :
139  rodId = 0x3;
140  break;
141  case 0x0015 :
142  rodId = 0x4; // slot 13 reserved
143  break;
144  case 0x0017 :
145  rodId = 0x5;
146  break;
147  case 0x0019 :
148  rodId = 0x6;
149  break;
150  case 0x0021 :
151  rodId = 0x7;
152  break;
153  case 0x000A :
154  rodId = 0x0; // cosmic test simulation
155  break;
156  case 0x000C :
157  rodId = 0x1; // cosmic test simulation
158  break;
159  default :
160  check = false;
161  rodId = 0xFFFF;
162  }
163  // new online Rod 0x80 - 0x8F range Oct. 2014
164  if(!check && (id & 0x70) == 0){
165  check = true;
166  if( id & 1 ) {
167  rodId = (((id & 0xf) >> 1) | 0x10);
168  } else {
169  rodId = (((id & 0xf) >> 1) | 0x18);
170  }
171  }
172 
173  return check;
174 }

◆ onlineId() [1/2]

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

Definition at line 83 of file CSCcablingSvc.cxx.

83  {
84 
85  bool check = true;
86  switch ( offlineID ) {
87  case 0x0 :
88  rodId = 0x0005;
89  break;
90  case 0x1 :
91  rodId = 0x0007;
92  break;
93  case 0x2 :
94  rodId = 0x0009;
95  break;
96  case 0x3 :
97  rodId = 0x0011;
98  break;
99  case 0x4 :
100  rodId = 0x0015; // slot 13 reserved
101  break;
102  case 0x5 :
103  rodId = 0x0017;
104  break;
105  case 0x6 :
106  rodId = 0x0019;
107  break;
108  case 0x7 :
109  rodId = 0x0021;
110  break;
111  default :
112  check = false;
113  rodId = 0xFFFF;
114  }
115 
116  if((offlineID & 0x1F) & 0x10){
117  check = true;
118  // uses Rod Ids in 0x10 - 0x1F
119  rodId = 0x80 | (0xF & offlineID);
120  }
121  return check;
122 }

◆ 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 74 of file CSCcablingSvc.cxx.

74  {
75 
76  bool check = subDetectorID == 0x6A || subDetectorID == 0x69;
77  uint16_t id = 0xFFFF;
78  check = check && this->onlineId(offlineID, id);
79  rodId = (subDetectorID << 16) | id;
80  return check;
81 }

◆ queryInterface()

StatusCode CSCcablingSvc::queryInterface ( const InterfaceID &  riid,
void **  ppvIF 
)
virtual

Definition at line 25 of file CSCcablingSvc.cxx.

25  {
26 
27  if( IID_ICSCcablingSvc.versionMatch(riid) ) {
28  *ppvIF = (CSCcablingSvc*)this;
29  } else {
30  return ::AthService::queryInterface(riid, ppvIF);
31  }
32 
33  return StatusCode::SUCCESS;
34 }

Member Data Documentation

◆ m_max

unsigned int CSCcablingSvc::m_max
private

Definition at line 73 of file CSCcablingSvc.h.

◆ m_rod

unsigned int CSCcablingSvc::m_rod
private

Definition at line 72 of file CSCcablingSvc.h.

◆ m_run1

bool CSCcablingSvc::m_run1
private

Definition at line 74 of file CSCcablingSvc.h.

◆ m_side

unsigned int CSCcablingSvc::m_side
private

Definition at line 71 of file CSCcablingSvc.h.


The documentation for this class was generated from the following files:
AthService::AthService
AthService()
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
CSCcablingSvc::m_rod
unsigned int m_rod
Definition: CSCcablingSvc.h:72
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
initialize
void initialize()
Definition: run_EoverP.cxx:894
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:74
CSCcablingSvc::m_max
unsigned int m_max
Definition: CSCcablingSvc.h:73
CSCcablingSvc::hash2Rod
void hash2Rod(const unsigned int &, uint32_t &) const
map PRD collection ID into offline ROD ID
Definition: CSCcablingSvc.cxx:346
CSCcablingSvc::nROD
unsigned int nROD() const
Definition: CSCcablingSvc.h:51
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
CSCcablingSvc
Definition: CSCcablingSvc.h:23
CSCcablingSvc::hash2Rob
void hash2Rob(const unsigned int &, uint32_t &) const
map PRD collection ID into short ROB ID, e.g.
Definition: CSCcablingSvc.cxx:216
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:200
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:360
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
CSCcablingSvc::m_run1
bool m_run1
Definition: CSCcablingSvc.h:74
LArNewCalib_Delay_OFC_Cali.check
check
Definition: LArNewCalib_Delay_OFC_Cali.py:267
CSCcablingSvc::m_side
unsigned int m_side
Definition: CSCcablingSvc.h:71
python.CaloScaleNoiseConfig.default
default
Definition: CaloScaleNoiseConfig.py:79
IID_ICSCcablingSvc
const InterfaceID IID_ICSCcablingSvc("CSCcablingSvc", 1, 0)