ATLAS Offline Software
Loading...
Searching...
No Matches
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
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
bool is_rodId (const uint16_t rodId) const
 check that we have the correct online ROD id
bool is_offlineRodId (const uint16_t rodId) const
 check that we have the correct offline ROD id
uint16_t collectionId (const uint16_t subdetectorId, const uint16_t rodId) const
 calculate the collection Identifier
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.
void hash2RobFull (const unsigned int &, uint32_t &) const
 map PRD collection ID into full ROB ID (with subdetector ID), e.g.
void hash2Rod (const unsigned int &, uint32_t &) const
 map PRD collection ID into offline ROD ID
void hash2SubdetectorId (const unsigned int &, uint32_t &) const
 map PRD collection ID into subdetector ID, i.e.
void hash2CollectionId (const unsigned int &, uint16_t &) const
 map PRD collection ID into RDO collection ID
MsgStream & msg () 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 176 of file CSCcablingSvc.cxx.

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

◆ hash2CollectionId()

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

map PRD collection ID into RDO collection ID

Definition at line 353 of file CSCcablingSvc.cxx.

353 {
354 uint32_t rodid = 0xffff;
355 hash2Rod(hashid, rodid);
356
357 uint32_t subdetectorid = 0;
358 hash2SubdetectorId(hashid, subdetectorid);
359
360 collectionid = collectionId(subdetectorid, rodid);
361}
void hash2Rod(const unsigned int &, uint32_t &) const
map PRD collection ID into offline ROD ID
uint16_t collectionId(const uint16_t subdetectorId, const uint16_t rodId) const
calculate the collection Identifier
void hash2SubdetectorId(const unsigned int &, uint32_t &) const
map PRD collection ID into subdetector ID, i.e.
setEventNumber uint32_t

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

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

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

343 {
344 uint32_t shortRobID = 0xffff;
345 hash2Rob(hashid, shortRobID);
346
347 uint32_t subdetectorid = 0;
348 hash2SubdetectorId(hashid, subdetectorid);
349
350 robid = (subdetectorid << 16) | shortRobID;
351}
void hash2Rob(const unsigned int &, uint32_t &) const
map PRD collection ID into short ROB ID, e.g.

◆ hash2Rod()

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

map PRD collection ID into offline ROD ID

Definition at line 322 of file CSCcablingSvc.cxx.

322 {
323 if(m_run1){
324 rodid = hashid & 7;
325 } else {
326 if (hashid<8)
327 rodid = hashid;
328 else if (hashid<24)
329 rodid = hashid-8;
330 else
331 rodid = hashid-16;
332 rodid |= 0x10;
333 }
334}

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

336 {
337 if ((hashid >= 8 && hashid <= 15) || (hashid >= 24))
338 subdetectorid = 0x69;
339 else
340 subdetectorid = 0x6a;
341}

◆ initialize()

StatusCode CSCcablingSvc::initialize ( )
overridevirtual

Definition at line 15 of file CSCcablingSvc.cxx.

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

◆ is_offlineRodId()

bool CSCcablingSvc::is_offlineRodId ( const uint16_t rodId) const

check that we have the correct offline ROD id

Definition at line 165 of file CSCcablingSvc.cxx.

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

◆ is_rodId()

bool CSCcablingSvc::is_rodId ( const uint16_t rodId) const

check that we have the correct online ROD id

Definition at line 153 of file CSCcablingSvc.cxx.

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

◆ maxId()

unsigned int CSCcablingSvc::maxId ( ) const
inline

Definition at line 42 of file CSCcablingSvc.h.

42{ return m_max; }

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

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

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

◆ onlineId() [1/2]

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

Definition at line 59 of file CSCcablingSvc.cxx.

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

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

50 {
51
52 bool check = subDetectorID == 0x6A || subDetectorID == 0x69;
53 uint16_t id = 0xFFFF;
54 check = check && this->onlineId(offlineID, id);
55 rodId = (subDetectorID << 16) | id;
56 return check;
57}
bool onlineId(const uint16_t subdetectorID, const uint16_t offlineID, uint32_t &rodId) const
map offline ROD identifier to online ID

Member Data Documentation

◆ m_max

unsigned int CSCcablingSvc::m_max {32}
private

Definition at line 63 of file CSCcablingSvc.h.

63{32};

◆ m_rod

unsigned int CSCcablingSvc::m_rod {16}
private

Definition at line 62 of file CSCcablingSvc.h.

62{16};

◆ m_run1

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

Definition at line 65 of file CSCcablingSvc.h.

65{this, "Run1Cabling", false};

◆ m_side

unsigned int CSCcablingSvc::m_side {2}
private

Definition at line 61 of file CSCcablingSvc.h.

61{2};

The documentation for this class was generated from the following files: