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

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

◆ hash2CollectionId()

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

map PRD collection ID into RDO collection ID

Definition at line 378 of file CSCcablingSvc.cxx.

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

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

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

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

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

◆ hash2Rod()

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

map PRD collection ID into offline ROD ID

Definition at line 347 of file CSCcablingSvc.cxx.

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

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

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

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

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

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

◆ is_rodId()

bool CSCcablingSvc::is_rodId ( const uint16_t  rodId) const

check that we have the correct online ROD id

Definition at line 178 of file CSCcablingSvc.cxx.

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

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

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

◆ onlineId() [1/2]

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

Definition at line 84 of file CSCcablingSvc.cxx.

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

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

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

◆ 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
IRDBAccessSvc::getRecordsetPtr
virtual IRDBRecordset_ptr getRecordsetPtr(const std::string &node, const std::string &tag, const std::string &tag2node="", const std::string &connName="ATLASDD")=0
Provides access to the Recordset object containing HVS-tagged data.
IGeoModelSvc
Definition: IGeoModelSvc.h:17
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:75
CSCcablingSvc::m_max
unsigned int m_max
Definition: CSCcablingSvc.h:73
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
CSCcablingSvc::hash2Rod
void hash2Rod(const unsigned int &, uint32_t &) const
map PRD collection ID into offline ROD ID
Definition: CSCcablingSvc.cxx:347
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:88
IRDBAccessSvc
IRDBAccessSvc is an abstract interface to the athena service that provides the following functionalit...
Definition: IRDBAccessSvc.h:45
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
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:217
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:201
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:361
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
CSCcablingSvc::m_run1
bool m_run1
Definition: CSCcablingSvc.h:74
LArNewCalib_Delay_OFC_Cali.check
check
Definition: LArNewCalib_Delay_OFC_Cali.py:208
CSCcablingSvc::m_side
unsigned int m_side
Definition: CSCcablingSvc.h:71
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
python.CaloScaleNoiseConfig.default
default
Definition: CaloScaleNoiseConfig.py:79
IID_ICSCcablingSvc
const InterfaceID IID_ICSCcablingSvc("CSCcablingSvc", 1, 0)
IGeoModelSvc::atlasVersion
virtual const std::string & atlasVersion() const =0