ATLAS Offline Software
Loading...
Searching...
No Matches
ZdcCablingService Class Reference

#include <ZdcCablingService.h>

Collaboration diagram for ZdcCablingService:

Public Member Functions

Identifier h2s_channel_id (int crate, int channel) const
int hwid2side (int crate, int channel) const
int hwid2module (int crate, int channel) const
int hwid2type (int crate, int channel) const
int hwid2channel (int crate, int channel) const
int hwid2gain (int crate, int channel) const
int hwid2delay (int crate, int channel) const
int hwid2hv (int crate, int channel) const

Static Public Member Functions

static const ZdcCablingServicegetInstance ()
 get pointer to service instance
static void deleteInstance ()
 delete service instance

Protected Member Functions

 ZdcCablingService (const ZdcID *zdcID)
 Default constructor protected.
virtual ~ZdcCablingService ()
 Destructor protected.

Private Member Functions

void setConnected (int ppm, int channel)
void fillConnectionTables ()
void fillDB ()
int crate_index_lookup (int &crate) const

Private Attributes

bool m_dbFilled
int m_side_db [4][64] {}
int m_module_db [4][64] {}
int m_type_db [4][64] {}
int m_gain_db [4][64] {}
int m_delay_db [4][64] {}
int m_channel_db [4][64] {}
int m_hv_db [4][64] {}
int m_ppm_db [16] {}
int m_crate_index [4] {}
int m_ncrate {}
const ZdcIDm_zdcID
int m_connected [16][16] {}

Detailed Description

Definition at line 18 of file ZdcCablingService.h.

Constructor & Destructor Documentation

◆ ZdcCablingService()

ZdcCablingService::ZdcCablingService ( const ZdcID * zdcID)
protected

Default constructor protected.

Definition at line 28 of file ZdcCablingService.cxx.

29 : m_dbFilled(0) , m_zdcID(zdcID) //, m_zdcHWID(zdcHWID)
30{
31
32 ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "ZdcCablingSevice");
33 if (!m_zdcID) {
34 if (detStore->retrieve (m_zdcID).isFailure()) {
35 std::abort();
36 }
37 }
38
40 fillDB();
41
42}
const ZdcID * m_zdcID

◆ ~ZdcCablingService()

ZdcCablingService::~ZdcCablingService ( )
protectedvirtual

Destructor protected.

Definition at line 250 of file ZdcCablingService.cxx.

251{
252}

Member Function Documentation

◆ crate_index_lookup()

int ZdcCablingService::crate_index_lookup ( int & crate) const
inlineprivate

Definition at line 92 of file ZdcCablingService.h.

93 {
94 int ic=0;
95 while (1)
96 {
97 if (m_crate_index[ic]==crate) return ic;
98 ic++;
99 if (ic==m_ncrate) return -1;
100 }
101 return -1;
102 }
int ic
Definition grepfile.py:33

◆ deleteInstance()

void ZdcCablingService::deleteInstance ( )
static

delete service instance

Definition at line 21 of file ZdcCablingService.cxx.

22{
23}

◆ fillConnectionTables()

void ZdcCablingService::fillConnectionTables ( )
private

Definition at line 439 of file ZdcCablingService.cxx.

440{
441 // mapping from module (offline id) to drawer (onile id)
442 // NC - not connected
443 //const int NC = 65;
444 //const int PB = 0;
445 // PB - possibly broken E3, but for the moment assume that this channel is still alive
446
447}

◆ fillDB()

void ZdcCablingService::fillDB ( )
private

Definition at line 44 of file ZdcCablingService.cxx.

45{
46
47 if (m_dbFilled) return;
48 m_dbFilled = true;
49
50 int side_db[16][16] = {
51 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
52 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
53 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
54 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
55 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
56 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
57 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
58 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
59 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
60 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
61 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
62 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
63 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
64 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
65 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
66 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}
67 };
68
69 /* //original version Nov 2009
70
71 int module_db[8][16] =
72 {
73 {1,1,1,1,0,0,0,0,3,3,3,3,2,2,2,2},
74 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
75 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
76 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
77 {1,1,1,1,0,0,0,0,3,3,3,3,2,2,2,2},
78 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
79 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
80 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}
81 };
82 */
83
84 int module_db[16][16] =
85 {
86 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
87 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
88 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
89 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
90 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
91 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
92 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
93 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
94 {3,3,3,3,0,0,0,0,1,1,1,1,2,2,2,2},
95 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
96 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
97 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
98 {3,3,3,3,0,0,0,0,1,1,1,1,2,2,2,2},
99 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
100 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
101 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}
102 };
103
104 int type_db[16][16] =
105 {
106 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
107 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
108 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
109 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
110 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
111 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
112 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
113 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
114 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
115 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
116 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
117 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
118 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
119 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
120 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
121 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}
122 };
123
124 int channel_db[16][16] =
125 {
126 {8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15},
127 {24,24,25,25,26,26,27,27,28,28,29,29,30,30,31,31},
128 {40,40,41,41,42,42,43,43,44,44,45,45,46,46,47,47},
129 {56,56,57,57,58,58,59,59,60,60,61,61,62,62,63,63},
130 {0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7},
131 {16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23},
132 {32,32,33,33,34,34,35,35,36,36,37,37,38,38,39,39},
133 {48,48,49,49,50,50,51,51,52,52,53,53,54,54,55,55},
134 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
135 {1,1,5,5,0,0,4,4,3,3,7,7,2,2,6,6},
136 {12,12,8,8,13,13,9,9,14,14,10,10,15,15,11,11},
137 {20,20,16,16,21,21,17,17,22,22,18,18,23,23,19,19},
138 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
139 {1,1,5,5,0,0,4,4,3,3,7,7,2,2,6,6},
140 {12,12,8,8,13,13,9,9,14,14,10,10,15,15,11,11},
141 {20,20,16,16,21,21,17,17,22,22,18,18,23,23,19,19},
142 };
143
144 /*
145 // the old one
146 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
147 {4,4,0,0,5,5,1,1,6,6,2,2,7,7,3,3},
148 {9,9,13,13,8,8,12,12,11,11,15,15,10,10,14,14},
149 {17,17,21,21,16,16,20,20,19,19,23,23,18,18,22,22}
150 */
151
152 int gain_db[16][16] =
153 {
154 {1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0}, // EM Pix
155 {1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0}, // EM Pix
156 {1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0}, // EM Pix
157 {1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0}, // EM Pix
158 {1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0}, // EM Pix
159 {1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0}, // EM Pix
160 {1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0}, // EM Pix
161 {1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0}, // EM Pix
162 {1,1,0,0,0,0,1,1,1,1,0,0,1,1,0,0}, // HAD2,EM,HAD0,HAD1
163 {0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1}, // HAD0 Pix
164 {0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1}, // HAD0 Pix
165 {0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1}, // HAD0 Pix
166 {1,1,0,0,0,0,1,1,1,1,0,0,1,1,0,0}, // HAD2,EM,HAD0,HAD1
167 {0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1}, // HAD0 Pix
168 {0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1}, // HAD0 Pix
169 {0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1} // HAD0 Pix
170 };
171
172 int delay_db[16][16] =
173 {
174 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
175 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
176 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
177 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
178 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
179 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
180 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
181 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
182 //{1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0},
183 {1,0,1,0,0,1,0,1,1,0,1,0,1,0,1,0},
184 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
185 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
186 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
187 //{1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0},
188 {1,0,1,0,0,1,0,1,1,0,1,0,1,0,1,0},
189 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
190 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
191 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
192 };
193
194 int hv_db[16][16] =
195 {
196 {224,224,224,224,212,212,212,212,213,213,213,213,214,214,214,214},
197 {221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221},
198 {222,222,222,222,222,222,222,222,222,222,222,222,222,222,222,222},
199 {223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223},
200 {224,224,224,224,212,212,212,212,213,213,213,213,214,214,214,214},
201 {221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221},
202 {222,222,222,222,222,222,222,222,222,222,222,222,222,222,222,222},
203 {223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223},
204 {224,224,224,224,212,212,212,212,213,213,213,213,214,214,214,214},
205 {221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221},
206 {222,222,222,222,222,222,222,222,222,222,222,222,222,222,222,222},
207 {223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223},
208 {224,224,224,224,212,212,212,212,213,213,213,213,214,214,214,214},
209 {221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221},
210 {222,222,222,222,222,222,222,222,222,222,222,222,222,222,222,222},
211 {223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223}
212 };
213
214 int ppm_db[16] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16};
215
216 // this is a mess. need to derive crate_index and m_crate_index from the crate_db, but not right this second
217 //int crate_db[8] = {12,12,12,12,14,14,14,14};
218 int crate_index[16] ={0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3};
219 m_ncrate = 4;
220 m_crate_index[0] = 10;
221 m_crate_index[1] = 11;
222 m_crate_index[2] = 12;
223 m_crate_index[3] = 14;
224
225 // lookup table side/module/type/channel/gain/delay
226
227 for (int i = 0; i < 16; i++) {
228 for (int j = 0; j < 16; j++) {
229 int ic = crate_index[i]; // crate index
230 int icc = i * 16 + j - 64 * ic; // channel index
231 m_side_db[ic][icc] = side_db[i][j];
232 m_module_db[ic][icc] = module_db[i][j];
233 m_type_db[ic][icc] = type_db[i][j];
234 m_channel_db[ic][icc] = channel_db[i][j];
235 m_gain_db[ic][icc] = gain_db[i][j];
236 m_delay_db[ic][icc] = delay_db[i][j];
237 m_hv_db[ic][icc] = hv_db[i][j];
238 m_ppm_db[ic] = ppm_db[i];
239 // m_crate_lookup[m_side_db[i][j]][m_module_db[i][j]][m_type_db[i][j]] =
240 // ic;
241 // m_channel_lookup[m_side_db[i][j]][m_module_db[i][j]][m_type_db[i][j]][j][m_gain_db[i][j]][m_delay_db[i][j]]
242 // = icc;
243 }
244 }
245}

◆ getInstance()

const ZdcCablingService * ZdcCablingService::getInstance ( )
static

get pointer to service instance

Definition at line 14 of file ZdcCablingService.cxx.

15{
16 static const ZdcCablingService svc (nullptr);//, nullptr);
17 return &svc;
18}
ZdcCablingService(const ZdcID *zdcID)
Default constructor protected.
AthROOTErrorHandlerSvc * svc

◆ h2s_channel_id()

Identifier ZdcCablingService::h2s_channel_id ( int crate,
int channel ) const

Definition at line 326 of file ZdcCablingService.cxx.

327{
328
329 int side = hwid2side (crate,channel);
330 int module = hwid2module (crate,channel);
331 int type = hwid2type (crate,channel);
332 int chan = hwid2channel (crate,channel);
333
334 //std::cout << "ZCS: side=" << side << " module=" << module << " type=" << type << " chan=" << chan << std::endl;
335 return m_zdcID->channel_id(side,module,type,chan);
336}
int hwid2type(int crate, int channel) const
int hwid2side(int crate, int channel) const
int hwid2channel(int crate, int channel) const
int hwid2module(int crate, int channel) const

◆ hwid2channel()

int ZdcCablingService::hwid2channel ( int crate,
int channel ) const

Definition at line 397 of file ZdcCablingService.cxx.

398{
399 int ic = crate_index_lookup(crate);
400 if (ic<0) return -1;
401
402 int chan = m_channel_db[ic][channel];
403 return chan;
404}
int crate_index_lookup(int &crate) const

◆ hwid2delay()

int ZdcCablingService::hwid2delay ( int crate,
int channel ) const

Definition at line 417 of file ZdcCablingService.cxx.

418{
419
420 int ic = crate_index_lookup(crate);
421 if (ic<0) return -1;
422
423 int delay = m_delay_db[ic][channel];
424 //std::cout << "crate =" << crate << " channel="<<channel<< " ic="<<ic<<" channel="<<channel<<" delay=" << delay<<std::endl;
425 return delay;
426}
double delay(std::size_t d)

◆ hwid2gain()

int ZdcCablingService::hwid2gain ( int crate,
int channel ) const

Definition at line 407 of file ZdcCablingService.cxx.

408{
409 int ic = crate_index_lookup(crate);
410 if (ic<0) return -1;
411
412 int gain = m_gain_db[ic][channel];
413 //std::cout << "crate =" << crate << " channel="<<channel<< " ic="<<ic<<" channel="<<channel<<" gain=" << gain<<std::endl;
414 return gain;
415}

◆ hwid2hv()

int ZdcCablingService::hwid2hv ( int crate,
int channel ) const

Definition at line 428 of file ZdcCablingService.cxx.

429{
430 int ic = crate_index_lookup(crate);
431 if (ic<0) return -1;
432
433 int hv = m_hv_db[ic][channel];
434 return hv;
435}

◆ hwid2module()

int ZdcCablingService::hwid2module ( int crate,
int channel ) const

Definition at line 378 of file ZdcCablingService.cxx.

379{
380 int ic = crate_index_lookup(crate);
381 if (ic<0) return -1;
382
384 return module;
385}

◆ hwid2side()

int ZdcCablingService::hwid2side ( int crate,
int channel ) const

Definition at line 369 of file ZdcCablingService.cxx.

370{
371 int ic = crate_index_lookup(crate);
372 if (ic<0) return -1;
373
374 int side = m_side_db[ic][channel];
375 return side;
376}

◆ hwid2type()

int ZdcCablingService::hwid2type ( int crate,
int channel ) const

Definition at line 387 of file ZdcCablingService.cxx.

388{
389 int ic = crate_index_lookup(crate);
390 if (ic<0) return -1;
391
392 int type = m_type_db[ic][channel];
393 return type;
394}

◆ setConnected()

void ZdcCablingService::setConnected ( int ppm,
int channel )
private

Definition at line 255 of file ZdcCablingService.cxx.

256{
257 m_connected[ppm][channel] = true;
258}

Member Data Documentation

◆ m_channel_db

int ZdcCablingService::m_channel_db[4][64] {}
private

Definition at line 73 of file ZdcCablingService.h.

73{};

◆ m_connected

int ZdcCablingService::m_connected[16][16] {}
private

Definition at line 87 of file ZdcCablingService.h.

87{};

◆ m_crate_index

int ZdcCablingService::m_crate_index[4] {}
private

Definition at line 76 of file ZdcCablingService.h.

76{};

◆ m_dbFilled

bool ZdcCablingService::m_dbFilled
private

Definition at line 67 of file ZdcCablingService.h.

◆ m_delay_db

int ZdcCablingService::m_delay_db[4][64] {}
private

Definition at line 72 of file ZdcCablingService.h.

72{};

◆ m_gain_db

int ZdcCablingService::m_gain_db[4][64] {}
private

Definition at line 71 of file ZdcCablingService.h.

71{};

◆ m_hv_db

int ZdcCablingService::m_hv_db[4][64] {}
private

Definition at line 74 of file ZdcCablingService.h.

74{};

◆ m_module_db

int ZdcCablingService::m_module_db[4][64] {}
private

Definition at line 69 of file ZdcCablingService.h.

69{};

◆ m_ncrate

int ZdcCablingService::m_ncrate {}
private

Definition at line 77 of file ZdcCablingService.h.

77{};

◆ m_ppm_db

int ZdcCablingService::m_ppm_db[16] {}
private

Definition at line 75 of file ZdcCablingService.h.

75{};

◆ m_side_db

int ZdcCablingService::m_side_db[4][64] {}
private

Definition at line 68 of file ZdcCablingService.h.

68{};

◆ m_type_db

int ZdcCablingService::m_type_db[4][64] {}
private

Definition at line 70 of file ZdcCablingService.h.

70{};

◆ m_zdcID

const ZdcID* ZdcCablingService::m_zdcID
private

Definition at line 83 of file ZdcCablingService.h.


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