ATLAS Offline Software
Loading...
Searching...
No Matches
L1CaloOfflineTriggerTowerTools.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4// ***************************************************************************
5// * Author: John Morris (john.morris@cern.ch) *
6// * Queen Mary University of London *
7// * *
8
9
10
13
14namespace LVL1 {
15
17 asg::AsgTool( name ),
18 m_l1CaloTTIdTools("LVL1::L1CaloTTIdTools/L1CaloTTIdTools"),
19 m_cells2tt("LVL1::L1CaloCells2TriggerTowers/L1CaloCells2TriggerTowers", this),
20 m_ttSvc("CaloTriggerTowerService"),
21 m_scidtool ("CaloSuperCellIDTool"),
23 m_cablingKey(""),
24 m_tileBadChanTool("TileBadChanTool"),
25 m_rxMapTool("LVL1::L1CaloFcal23Cells2RxMappingTool/L1CaloFcal23Cells2RxMappingTool")
26 {
27 m_caloMgr = 0;
29 m_lvl1Helper = 0;
30 m_larOnlineID = 0;
32 m_tileHWID = 0;
33
34 declareProperty("LArHVNonNomPara",m_LArHVNonNomPara = 1.003);
35 declareProperty("TileBadChanTool", m_tileBadChanTool);
36 declareProperty("RxMappingTool",m_rxMapTool);
37 }
38
39
40
42 // Location, ID and Navigation Information //
44
45 // EM
46
48 Identifier Id = this->emID(tt->eta(),tt->phi());
49 HWIdentifier HWId = m_ttSvc->createTTChannelID(Id);
50 return m_ttOnlineIdHelper->crate(HWId);
51 }
52
54 Identifier Id = this->emID(tt->eta(),tt->phi());
55 HWIdentifier HWId = m_ttSvc->createTTChannelID(Id);
56 return m_ttOnlineIdHelper->module(HWId);
57 }
58
60 Identifier Id = this->emID(tt->eta(),tt->phi());
61 HWIdentifier HWId = m_ttSvc->createTTChannelID(Id);
62 return m_ttOnlineIdHelper->submodule(HWId);
63 }
64
66 Identifier Id = this->emID(tt->eta(),tt->phi());
67 HWIdentifier HWId = m_ttSvc->createTTChannelID(Id);
68 return m_ttOnlineIdHelper->channel(HWId);
69 }
70
72 Identifier Id = this->emID(tt->eta(),tt->phi());
73 HWIdentifier HWId = m_ttSvc->createTTChannelID(Id);
74 L1CaloCoolChannelId coolId = m_ttSvc->createL1CoolChannelId(HWId);
75 return coolId.id();
76 }
77
79 std::vector<int> location;
80 Identifier Id = this->emID(tt->eta(),tt->phi());
81 HWIdentifier HWId = m_ttSvc->createTTChannelID(Id);
82 location.push_back(m_ttOnlineIdHelper->crate(HWId));
83 location.push_back(m_ttOnlineIdHelper->module(HWId));
84 location.push_back(m_ttOnlineIdHelper->submodule(HWId));
85 location.push_back(m_ttOnlineIdHelper->channel(HWId));
86 L1CaloCoolChannelId coolId = m_ttSvc->createL1CoolChannelId(HWId);
87 location.push_back(coolId.id());
88 return location;
89 }
90
91 std::vector<L1CaloRxCoolChannelId> L1CaloOfflineTriggerTowerTools::emReceivers(const TriggerTower* tt) const{
92 Identifier Id = this->emID(tt->eta(),tt->phi());
93 HWIdentifier HWId = m_ttSvc->createTTChannelID(Id);
94 L1CaloCoolChannelId coolId = m_ttSvc->createL1CoolChannelId(HWId);
95 std::vector<L1CaloRxCoolChannelId> rx = m_ttSvc->cnvCoolChannelIdToRxId(coolId);
96
97 std::vector<L1CaloRxCoolChannelId> output;
98
99 // Sort EM Crack recievers. End cap first, barrel second
100 if(rx.size() == 3){
101
102 // For the EM crack region, there are 3 recievers.
103 // 1 Rx have Crate 0 or 1 - correspond to the barrel before the Octopus cable magic - ignore
104 // 2 Rx have Crate 2 or 3 - correspond to the Rx we want:
105 // 1 Rx has inputConn() == 0 - EMEC receiver
106 // 1 Rx has inputConn() == 2 - Barrel receiver
107
108
109 typedef std::vector<L1CaloRxCoolChannelId>::const_iterator Itr_Id;
110 std::vector<L1CaloRxCoolChannelId> rx2;
111 for(Itr_Id a=rx.begin();a!=rx.end();++a){
112 if((*a).crate() == 2 || (*a).crate() == 3){ // Select only interesting recievers
113 rx2.push_back(*a);
114 }
115 }
116
117 if(rx2.size() == 2){
118
119 unsigned int inputA = rx2.at(0).inputConn();
120 unsigned int inputB = rx2.at(1).inputConn();
121
122 // End cap first, barrel second
123 if(inputA == 2 && inputB == 0){
124 output.push_back(rx2.at(1));
125 output.push_back(rx2.at(0));
126 }
127 if(inputA == 0 && inputB == 2){
128 output.push_back(rx2.at(0));
129 output.push_back(rx2.at(1));
130 }
131 }
132
133 }
134
135 if(rx.size() == 1){
136 output.push_back(rx.at(0));
137 }
138
139 return output;
140 }
141
142 std::vector<unsigned int> L1CaloOfflineTriggerTowerTools::emRxId(const TriggerTower* tt) const{
143 typedef std::vector<L1CaloRxCoolChannelId>::const_iterator Itr;
144 std::vector<L1CaloRxCoolChannelId> rx = this->emReceivers(tt);
145 std::vector<unsigned int> output;
146 for(Itr i=rx.begin();i!=rx.end();++i){
147 output.push_back( (*i).id() );
148 }
149 return output;
150 }
151
152 // Had
153
155 Identifier Id = this->hadID(tt->eta(),tt->phi());
156 HWIdentifier HWId = m_ttSvc->createTTChannelID(Id);
157 return m_ttOnlineIdHelper->crate(HWId);
158 }
159
161 Identifier Id = this->hadID(tt->eta(),tt->phi());
162 HWIdentifier HWId = m_ttSvc->createTTChannelID(Id);
163 return m_ttOnlineIdHelper->module(HWId);
164 }
165
167 Identifier Id = this->hadID(tt->eta(),tt->phi());
168 HWIdentifier HWId = m_ttSvc->createTTChannelID(Id);
169 return m_ttOnlineIdHelper->submodule(HWId);
170 }
171
173 Identifier Id = this->hadID(tt->eta(),tt->phi());
174 HWIdentifier HWId = m_ttSvc->createTTChannelID(Id);
175 return m_ttOnlineIdHelper->channel(HWId);
176 }
177
179 Identifier Id = this->hadID(tt->eta(),tt->phi());
180 HWIdentifier HWId = m_ttSvc->createTTChannelID(Id);
181 L1CaloCoolChannelId coolId = m_ttSvc->createL1CoolChannelId(HWId);
182 return coolId.id();
183 }
184
186 std::vector<int> location;
187 Identifier Id = this->hadID(tt->eta(),tt->phi());
188 HWIdentifier HWId = m_ttSvc->createTTChannelID(Id);
189 location.push_back(m_ttOnlineIdHelper->crate(HWId));
190 location.push_back(m_ttOnlineIdHelper->module(HWId));
191 location.push_back(m_ttOnlineIdHelper->submodule(HWId));
192 location.push_back(m_ttOnlineIdHelper->channel(HWId));
193 L1CaloCoolChannelId coolId = m_ttSvc->createL1CoolChannelId(HWId);
194 location.push_back(coolId.id());
195 return location;
196 }
197
199 Identifier Id = this->hadID(tt->eta(),tt->phi());
200 if(m_lvl1Helper->is_tile(Id) == true){
201 return 1;
202 }
203 return 0;
204 }
205
206 std::vector<L1CaloRxCoolChannelId> L1CaloOfflineTriggerTowerTools::hadReceivers(const TriggerTower* tt) const{
207 Identifier Id = this->hadID(tt->eta(),tt->phi());
208 HWIdentifier HWId = m_ttSvc->createTTChannelID(Id);
209 L1CaloCoolChannelId coolId = m_ttSvc->createL1CoolChannelId(HWId);
210 std::vector<L1CaloRxCoolChannelId> rx = m_ttSvc->cnvCoolChannelIdToRxId(coolId);
211
212 std::vector<L1CaloRxCoolChannelId> output;
213
214 // Sort FCAL 23 recievers. Always have -ve eta first and +ve eta second
215 if(rx.size() == 2){
216
217 // Odd receiver is lowest |eta|
218 unsigned int inputPairA = rx.at(0).inputPair();
219 unsigned int inputPairB = rx.at(1).inputPair();
220
221 bool oddA(false),oddB(false);
222 if(inputPairA % 2 != 0){oddA = true;}
223 if(inputPairB % 2 != 0){oddB = true;}
224
225 if(oddA == true && oddB == false){
226 output.push_back(rx.at(0));
227 output.push_back(rx.at(1));
228 }
229 if(oddA == false && oddB == true){
230 output.push_back(rx.at(1));
231 output.push_back(rx.at(0));
232 }
233
234 }
235 if(rx.size() == 1){
236 output.push_back(rx.at(0));
237 }
238
239 return output;
240 }
241
242
243 std::vector<unsigned int> L1CaloOfflineTriggerTowerTools::hadRxId(const TriggerTower* tt) const{
244 typedef std::vector<L1CaloRxCoolChannelId>::const_iterator Itr;
245 std::vector<L1CaloRxCoolChannelId> rx = this->hadReceivers(tt);
246 std::vector<unsigned int> output;
247 for(Itr i=rx.begin();i!=rx.end();++i){
248 output.push_back( (*i).id() );
249 }
250 return output;
251 }
252
253
255 // Energy, Et and Layer Information //
257
258 // EM
259
260 std::vector<const CaloCell*> L1CaloOfflineTriggerTowerTools::emCells(const TriggerTower* tt) const{
261 Identifier Id = this->emID(tt->eta(),tt->phi());
262 return m_cells2tt->caloCells(Id);
263 }
264
266 Identifier Id = this->emID(tt->eta(),tt->phi());
267 std::vector<const CaloCell*> cells = m_cells2tt->caloCells(Id);
268 return cells.size();
269 }
270
272 Identifier Id = this->emID(tt->eta(),tt->phi());
273 std::vector<int> v;
274 std::vector<std::vector<const CaloCell*> > cells = m_cells2tt->caloCellsByLayer(Id);
275 for(Itr_vvCaloCells i=cells.begin();i!=cells.end();++i){
276 v.push_back((*i).size());
277 }
278 return v;
279 }
280
282 Identifier Id = this->emID(tt->eta(),tt->phi());
283 std::vector<int> v;
284 std::vector<std::vector<const CaloCell*> > cells = this->sortEMCrackCells(m_cells2tt->caloCells(Id));
285 for(Itr_vvCaloCells i=cells.begin();i!=cells.end();++i){
286 v.push_back((*i).size());
287 }
288 return v;
289 }
290
291 std::vector<std::vector<int> > L1CaloOfflineTriggerTowerTools::emNCellsByReceiverByLayer(const TriggerTower* tt) const{
292 Identifier Id = this->emID(tt->eta(),tt->phi());
293 std::vector<L1CaloRxCoolChannelId> rx = this->emReceivers(tt);
294 std::vector<int> v1;
295 std::vector<int> v2;
296 std::vector<std::vector<int> > v;
297 std::vector<std::vector<const CaloCell*> > cells = m_cells2tt->caloCellsByLayer(Id);
298 for(Itr_vvCaloCells i=cells.begin();i!=cells.end();++i){
299 if ((*i).empty()) continue;
300 if (rx.size() == 2) {
301 std::vector<std::vector<const CaloCell*> > cellsRx = this->sortEMCrackCells((*i));
302 for(Itr_vvCaloCells j=cellsRx.begin();j!=cellsRx.end();++j){
303 if ((*j).empty()) continue;
304 if (j == cellsRx.begin()) v1.push_back((*j).size());
305 else v2.push_back((*j).size());
306 }
307 } else if (rx.size() == 1) v1.push_back((*i).size());
308 }
309 v.push_back(std::move(v1));
310 if (rx.size() == 2) v.push_back(std::move(v2));
311 return v;
312 }
313
315 Identifier Id = this->emID(tt->eta(),tt->phi());
316 return m_cells2tt->layerNames(Id);
317 }
318
320 Identifier Id = this->emID(tt->eta(),tt->phi());
321 std::vector<L1CaloRxCoolChannelId> rx = this->emReceivers(tt);
322 std::vector<int> v1;
323 std::vector<int> v2;
324 std::vector<std::vector<int> > v;
325 std::vector<std::vector<const CaloCell*> > cells = m_cells2tt->caloCellsByLayer(Id);
326 for(Itr_vvCaloCells i=cells.begin();i!=cells.end();++i){
327 if ((*i).empty()) continue;
328 if (rx.size() == 2) {
329 std::vector<std::vector<const CaloCell*> > cellsRx = this->sortEMCrackCells((*i));
330 for(Itr_vvCaloCells j=cellsRx.begin();j!=cellsRx.end();++j){
331 if ((*j).empty()) continue;
332 if (j == cellsRx.begin()) v1.push_back(m_cells2tt->layerNames((*j)[0]));
333 else v2.push_back(m_cells2tt->layerNames((*j)[0]));
334 }
335 } else if (rx.size() == 1) v1.push_back(m_cells2tt->layerNames((*i)[0]));
336 }
337 v.push_back(std::move(v1));
338 if (rx.size() == 2) v.push_back(std::move(v2));
339 return v;
340 }
341
343 Identifier Id = this->emID(tt->eta(),tt->phi());
344 return m_cells2tt->energy( m_cells2tt->caloCells(Id) );
345 }
346
348 Identifier Id = this->emID(tt->eta(),tt->phi());
349 std::vector<std::vector<const CaloCell*> > cells = m_cells2tt->caloCellsByLayer(Id);
350 std::vector<float> eByLayer;
351 for(Itr_vvCaloCells i=cells.begin();i!=cells.end();++i){
352 eByLayer.push_back( m_cells2tt->energy( *i ) );
353 }
354 return eByLayer;
355 }
356
357 std::vector<float> L1CaloOfflineTriggerTowerTools::emTTCellsEnergyByReceiver(const TriggerTower* tt,const int mode) const{
358 // Mode 0 : Return vector<float> even if it has 1 entry. Equivelent to emTTCellsEnergy
359 // Mode 1 : Return vecotr<float> only if size is > 2. D3PDs don't need this
360 std::vector<float> output;
361 std::vector<L1CaloRxCoolChannelId> rx = this->emReceivers(tt);
362 Identifier Id = this->emID(tt->eta(),tt->phi());
363 std::vector<const CaloCell*> cells = m_cells2tt->caloCells(Id);
364
365 if(rx.size() == 2){
366 std::vector<std::vector<const CaloCell*> > vvcells = this->sortEMCrackCells(cells);
367 for(Itr_vvCaloCells i=vvcells.begin();i!=vvcells.end();++i){
368 output.push_back( m_cells2tt->energy( (*i) ) );
369 }
370 }
371
372 if(rx.size() == 1 && mode == 0){
373 output.push_back( m_cells2tt->energy( cells ) );
374 }
375
376 return output;
377 }
378
380 Identifier Id = this->emID(tt->eta(),tt->phi());
381 return m_cells2tt->et( m_cells2tt->caloCells(Id) );
382 }
383
385 Identifier Id = this->emID(tt->eta(),tt->phi());
386 std::vector<std::vector<const CaloCell*> > cells = m_cells2tt->caloCellsByLayer(Id);
387 std::vector<float> eByLayer;
388 for(Itr_vvCaloCells i=cells.begin();i!=cells.end();++i){
389 eByLayer.push_back( m_cells2tt->et( *i ) );
390 }
391 return eByLayer;
392 }
393
394 std::vector<float> L1CaloOfflineTriggerTowerTools::emTTCellsEtByReceiver(const TriggerTower* tt,const int mode) const{
395 // Mode 0 : Return vector<float> even if it has 1 entry. Equivelent to emTTCellsEt
396 // Mode 1 : Return vecotr<float> only if size is > 2. D3PDs don't need this
397 std::vector<float> output;
398 std::vector<L1CaloRxCoolChannelId> rx = this->emReceivers(tt);
399 Identifier Id = this->emID(tt->eta(),tt->phi());
400 std::vector<const CaloCell*> cells = m_cells2tt->caloCells(Id);
401
402 if(rx.size() == 2){
403 std::vector<std::vector<const CaloCell*> > vvcells = this->sortEMCrackCells(cells);
404 for(Itr_vvCaloCells i=vvcells.begin();i!=vvcells.end();++i){
405 output.push_back( m_cells2tt->et( (*i) ) );
406 }
407 }
408
409 if(rx.size() == 1 && mode == 0){
410 output.push_back( m_cells2tt->et( cells ) );
411 }
412
413 return output;
414 }
415
416
417 std::vector<std::vector<const CaloCell*> > L1CaloOfflineTriggerTowerTools::sortEMCrackCells(const std::vector<const CaloCell*> &cells) const{
418 std::vector<std::vector<const CaloCell*> > output;
419 std::vector<const CaloCell*> emb;
420 std::vector<const CaloCell*> emec;
421
422 // End Cap first, Barrel second
423
424 for(Itr_vCaloCells i=cells.begin();i!=cells.end();++i){
425 int layer = m_cells2tt->layerNames(*i);
426
427 if( layer <= 3){
428 emb.push_back( (*i) );
429 }
430 if( layer >= 4){
431 emec.push_back( (*i) );
432 }
433 }
434
435 output.push_back(std::move(emec));
436 output.push_back(std::move(emb));
437 return output;
438 }
439
440 // Had
441
442 std::vector<const CaloCell*> L1CaloOfflineTriggerTowerTools::hadCells(const TriggerTower* tt) const{
443 Identifier Id = this->hadID(tt->eta(),tt->phi());
444 return m_cells2tt->caloCells(Id);
445 }
446
448 Identifier Id = this->hadID(tt->eta(),tt->phi());
449 std::vector<const CaloCell*> cells = m_cells2tt->caloCells(Id);
450 return cells.size();
451 }
452
454 Identifier Id = this->hadID(tt->eta(),tt->phi());
455 std::vector<int> v;
456 std::vector<std::vector<const CaloCell*> > cells = m_cells2tt->caloCellsByLayer(Id);
457 for(Itr_vvCaloCells i=cells.begin();i!=cells.end();++i){
458 v.push_back((*i).size());
459 }
460 return v;
461 }
462
464 std::vector<unsigned int> rx = this->hadRxId(tt);
465 Identifier Id = this->hadID(tt->eta(),tt->phi());
466
467 std::vector<int> v;
468 std::vector<std::vector<const CaloCell*> > cells = this->sortFCAL23Cells(m_cells2tt->caloCells(Id),rx);
469 for(Itr_vvCaloCells i=cells.begin();i!=cells.end();++i){
470 v.push_back((*i).size());
471 }
472 return v;
473 }
474
475 std::vector<std::vector<int> > L1CaloOfflineTriggerTowerTools::hadNCellsByReceiverByLayer(const TriggerTower* tt) const{
476 Identifier Id = this->hadID(tt->eta(),tt->phi());
477 std::vector<unsigned int> rx = this->hadRxId(tt);
478 std::vector<int> v1;
479 std::vector<int> v2;
480 std::vector<std::vector<int> > v;
481 std::vector<std::vector<const CaloCell*> > cells = m_cells2tt->caloCellsByLayer(Id);
482 for(Itr_vvCaloCells i=cells.begin();i!=cells.end();++i){
483 if ((*i).empty()) continue;
484 if (rx.size() == 2) {
485 std::vector<std::vector<const CaloCell*> > cellsRx = this->sortFCAL23Cells((*i),rx);
486 for(Itr_vvCaloCells j=cellsRx.begin();j!=cellsRx.end();++j){
487 if ((*j).empty()) continue;
488 if (j == cellsRx.begin()) v1.push_back((*j).size());
489 else v2.push_back((*j).size());
490 }
491 } else if (rx.size() == 1) v1.push_back((*i).size());
492 }
493 v.push_back(std::move(v1));
494 if (rx.size() == 2) v.push_back(std::move(v2));
495 return v;
496 }
497
499 Identifier Id = this->hadID(tt->eta(),tt->phi());
500 return m_cells2tt->layerNames(Id);
501 }
502
504 Identifier Id = this->hadID(tt->eta(),tt->phi());
505 std::vector<unsigned int> rx = this->hadRxId(tt);
506 std::vector<int> v1;
507 std::vector<int> v2;
508 std::vector<std::vector<int> > v;
509 std::vector<std::vector<const CaloCell*> > cells = m_cells2tt->caloCellsByLayer(Id);
510 for(Itr_vvCaloCells i=cells.begin();i!=cells.end();++i){
511 if ((*i).empty()) continue;
512 if (rx.size() == 2) {
513 std::vector<std::vector<const CaloCell*> > cellsRx = this->sortFCAL23Cells((*i),rx);
514 for(Itr_vvCaloCells j=cellsRx.begin();j!=cellsRx.end();++j){
515 if ((*j).empty()) continue;
516 if (j == cellsRx.begin()) v1.push_back(m_cells2tt->layerNames((*j)[0]));
517 else v2.push_back(m_cells2tt->layerNames((*j)[0]));
518 }
519 } else if (rx.size() == 1) v1.push_back(m_cells2tt->layerNames((*i)[0]));
520 }
521 v.push_back(std::move(v1));
522 if (rx.size() == 2) v.push_back(std::move(v2));
523 return v;
524 }
525
527 Identifier Id = this->hadID(tt->eta(),tt->phi());
528 return m_cells2tt->energy( m_cells2tt->caloCells(Id) );
529 }
530
532 Identifier Id = this->hadID(tt->eta(),tt->phi());
533 std::vector<std::vector<const CaloCell*> > cells = m_cells2tt->caloCellsByLayer(Id);
534 std::vector<float> eByLayer;
535 for(Itr_vvCaloCells i=cells.begin();i!=cells.end();++i){
536 eByLayer.push_back( m_cells2tt->energy( *i ) );
537 }
538 return eByLayer;
539 }
540
541 std::vector<float> L1CaloOfflineTriggerTowerTools::hadTTCellsEnergyByReceiver(const TriggerTower* tt,const int mode) const{
542 // Mode 0 : Return vector<float> even if it has 1 entry. Equivelent to hadTTCellsEnergy
543 // Mode 1 : Return vecotr<float> only if size is > 2. D3PDs don't need this
544 std::vector<float> output;
545 std::vector<unsigned int> rx = this->hadRxId(tt);
546 Identifier Id = this->hadID(tt->eta(),tt->phi());
547 std::vector<const CaloCell*> cells = m_cells2tt->caloCells(Id);
548
549 if(rx.size() == 2){
550 std::vector<std::vector<const CaloCell*> > vvcells = this->sortFCAL23Cells(cells,rx);
551 for(Itr_vvCaloCells i=vvcells.begin();i!=vvcells.end();++i){
552 output.push_back( m_cells2tt->energy( (*i) ) );
553 }
554 }
555
556 if(rx.size() == 1 && mode == 0){
557 output.push_back( m_cells2tt->energy( cells ) );
558 }
559
560 return output;
561 }
562
564 Identifier Id = this->hadID(tt->eta(),tt->phi());
565 return m_cells2tt->et( m_cells2tt->caloCells(Id) );
566 }
567
569 Identifier Id = this->hadID(tt->eta(),tt->phi());
570 std::vector<std::vector<const CaloCell*> > cells = m_cells2tt->caloCellsByLayer(Id);
571 std::vector<float> eByLayer;
572 for(Itr_vvCaloCells i=cells.begin();i!=cells.end();++i){
573 eByLayer.push_back( m_cells2tt->et( *i ) );
574 }
575 return eByLayer;
576 }
577
578
579 std::vector<float> L1CaloOfflineTriggerTowerTools::hadTTCellsEtByReceiver(const TriggerTower* tt,const int mode) const{
580 // Mode 0 : Return vector<float> even if it has 1 entry. Equivelent to hadTTCellsEt
581 // Mode 1 : Return vecotr<float> only if size is > 2. D3PDs don't need this
582 std::vector<float> output;
583 std::vector<unsigned int> rx = this->hadRxId(tt);
584 Identifier Id = this->hadID(tt->eta(),tt->phi());
585 std::vector<const CaloCell*> cells = m_cells2tt->caloCells(Id);
586
587 if(rx.size() == 2){
588 std::vector<std::vector<const CaloCell*> > vvcells = this->sortFCAL23Cells(cells,rx);
589 for(Itr_vvCaloCells i=vvcells.begin();i!=vvcells.end();++i){
590 output.push_back( m_cells2tt->et( (*i) ) );
591 }
592 }
593
594 if(rx.size() == 1 && mode == 0){
595 output.push_back( m_cells2tt->et( cells ) );
596 }
597
598 return output;
599 }
600
602 Identifier Id = this->hadID(tt->eta(),tt->phi());
603 if(m_lvl1Helper->is_tile(Id) == false){return 0.0;}
604 else{
605 IdTTL1CellMapType::const_iterator ttL1Cell(map.find(Id));
606 IdTTL1CellMapType::const_iterator ttL1Cell_E(map.end());
607 if(ttL1Cell != ttL1Cell_E){
608 return ((ttL1Cell->second)->eneTower()) * 1e-3;
609 }
610 return 0.0;
611 }
612 }
613
614 std::vector<std::vector<const CaloCell*> > L1CaloOfflineTriggerTowerTools::sortFCAL23Cells(const std::vector<const CaloCell*> &cells,
615 const double eta) const{
616 std::vector<std::vector<const CaloCell*> > output;
617
618 std::vector<const CaloCell*> fcal2A;
619 std::vector<const CaloCell*> fcal2B;
620 std::vector<const CaloCell*> fcal3A;
621 std::vector<const CaloCell*> fcal3B;
622 double absEta = fabs(eta);
623
624 for(Itr_vCaloCells i=cells.begin();i!=cells.end();++i){
625 int layer = m_cells2tt->layerNames(*i);
626 const CaloDetDescrElement* caloDDE = (*i)->caloDDE();
627 // _raw is ideal position
628 double cellEta = fabs(caloDDE->eta_raw());
629 double x = fabs(caloDDE->x_raw());
630 double y = fabs(caloDDE->y_raw());
631
632 // FCAL 2
633 if (layer == 22) {
634 // TTs split the eta range equally, hence the apparent inconsistencies in next line
635 bool lowEta = (absEta < 4.05 && cellEta < 3.3) || (absEta > 4.05 && cellEta < 3.97);
636 // Exceptions, based on radial map
637 if ((x > 100. && x < 160. && y > 340. && y < 380.) ||
638 (x > 320. && x < 360. && y > 170. && y < 210.) ||
639 (x > 30. && x < 60. && y > 170. && y < 210.)) lowEta = true;
640 if ((x > 160. && x < 190. && y > 340. && y < 380.) ||
641 (x > 230. && x < 260. && y > 300. && y < 340.) ||
642 (x > 130. && x < 160. && y > 140. && y < 170.) ||
643 (x > 160. && x < 200. && y > 90. && y < 140.)) lowEta = false;
644 if (lowEta) fcal2A.push_back(*i);
645 else fcal2B.push_back(*i);
646 }
647 // FCAL 3
648 if (layer == 23) {
649 bool lowEta = (absEta < 4.05 && cellEta < 3.43) || (absEta > 4.05 && cellEta < 3.9);
650 // Exceptions
651 double xs = caloDDE->x_raw();
652 double ys = caloDDE->y_raw();
653 if ((x > 120. && x < 160. && y > 140. && y < 200.) ||
654 (x > 160. && x < 220. && y > 100. && y < 140.) ||
655 (xs > 120. && xs < 160. && ys > -140. && ys < -100.) ||
656 (xs > -160. && xs < -100. && ys > 100. && ys < 140.)) lowEta = true;
657 if ((x > 0. && x < 60. && y > 380. && y < 420.) ||
658 (xs > 320. && xs < 370. && ys > 140. && ys < 190.) ||
659 (xs > -360. && xs < -320. && ys > -180. && ys < -140.)) lowEta = false;
660 if (lowEta) fcal3A.push_back(*i);
661 else fcal3B.push_back(*i);
662 }
663 }
664
665 unsigned int size2A = fcal2A.size();
666 unsigned int size2B = fcal2B.size();
667 unsigned int size3A = fcal3A.size();
668 unsigned int size3B = fcal3B.size();
669
670 // Always have lowEta first
671 if(size2A > 0 && size2B > 0 && size3A == 0 && size3B == 0){ // FCAL 2
672 output.push_back(std::move(fcal2A));
673 output.push_back(std::move(fcal2B));
674 }
675 if(size2A == 0 && size2B == 0 && size3A > 0 && size3B > 0){ // FCAL 3
676 output.push_back(std::move(fcal3A));
677 output.push_back(std::move(fcal3B));
678 }
679
680 return output;
681 }
682
683 std::vector<std::vector<const CaloCell*> > L1CaloOfflineTriggerTowerTools::sortFCAL23Cells(const std::vector<const CaloCell*> &cells,
684 const std::vector<unsigned int>& rxId) const{
685
686 // vectors of calo cells for the different receivers
687 std::vector<const CaloCell*> cellsA;
688 std::vector<const CaloCell*> cellsB;
689 // output
690 std::vector<std::vector<const CaloCell*> > output;
691
692 // RxID of the different receivers
693 unsigned int rxidA = rxId.at(0);
694 unsigned int rxidB = rxId.at(1);
695
696 // Loop over calo cells and use mapping tool to assign cells to different receivers
697 for(Itr_vCaloCells i=cells.begin();i!=cells.end();++i){
698 unsigned int someRxId = m_rxMapTool->offlineCell2RxId( (*i)->ID().get_identifier32().get_compact() );
699 if(someRxId == rxidA){cellsA.push_back(*i);}
700 if(someRxId == rxidB){cellsB.push_back(*i);}
701 }
702 output.push_back(std::move(cellsA));
703 output.push_back(std::move(cellsB));
704 return output;
705 }
706
708 // Bad Calo, High Voltage Information //
710
711 // LAr Member Functions
712
713 float L1CaloOfflineTriggerTowerTools::LArNonNominalHV(const std::vector<const CaloCell*> &cells) const{
714 const EventContext& ctx = Gaudi::Hive::currentContext();
718 float nonNominal(0.0);
719 for(Itr_vCaloCells i=cells.begin();i!=cells.end();++i){
720 nonNominal += this->LArNonNominalHV( (*i), scaleCorr.cptr(), onlineScaleCorr.cptr(), cabling.cptr() );
721 }
722 return nonNominal;
723 }
724
726 const ILArHVScaleCorr* scaleCorr,
727 const ILArHVScaleCorr* onlineScaleCorr,
728 const LArOnOffIdMapping* cabling) const{
729 float nonNominal(0.0);
730 HWIdentifier hwid=cabling->createSignalChannelID(cell->ID());
731 float corr = scaleCorr->HVScaleCorr( hwid ) * onlineScaleCorr->HVScaleCorr( hwid );
732 if(corr > m_LArHVNonNomPara){
733 nonNominal = 1.0;
734 }
735 return nonNominal;
736 }
737
738 float L1CaloOfflineTriggerTowerTools::LArHVScale(const std::vector<const CaloCell*> &cells) const{
739 const EventContext& ctx = Gaudi::Hive::currentContext();
743
744 float scale(0.0),count(0.0);
745 for(Itr_vCaloCells i=cells.begin();i!=cells.end();++i){
746 scale += this->LArHVScale( (*i), scaleCorr.cptr(), onlineScaleCorr.cptr(), cabling.cptr() );
747 count++;
748 }
749 if(count < 1.0){return 0.0;}
750 return scale / count;
751 }
752
754 const ILArHVScaleCorr* scaleCorr,
755 const ILArHVScaleCorr* onlineScaleCorr,
756 const LArOnOffIdMapping* cabling) const
757 {
758 HWIdentifier hwid=cabling->createSignalChannelID(cell->ID());
759 return scaleCorr->HVScaleCorr( hwid ) * onlineScaleCorr->HVScaleCorr( hwid );
760 }
761
762
763 float L1CaloOfflineTriggerTowerTools::LArCaloQuality(const std::vector<const CaloCell*> &cells) const{
764 float nom(0.), denom(0.);
765 for(Itr_vCaloCells i=cells.begin();i!=cells.end();++i){
766 if((*i)->provenance() & 0x2000) {
767 nom += ((*i)->e() * (*i)->quality());
768 denom += (*i)->e();
769 }
770 }
771
772 if(denom != 0.) {
773 nom /= denom;
774 }
775 else{
776 nom = -1e6; // error value
777 }
778 return nom;
779 }
780
781 // Tile Member functions
782
783 float L1CaloOfflineTriggerTowerTools::TileNonNominal(const std::vector<const CaloCell*> &cells) const{
784 float nonNominal(0.0);
785 for(Itr_vCaloCells i=cells.begin();i!=cells.end();++i){
786 nonNominal += this->TileNonNominal( (*i) );
787 }
788 return nonNominal;
789 }
790
792
793 // There are either 1 or 2 PMTs per Calo Cell
794 // A PMT may have Half Gain L1 or No Gain L1
795 //
796 // Assign a score as follows.
797 //
798 // Case (a) : 2 PMTs in the Cell
799 // Half gain counts as 0.25
800 // No gain counts as 0.5
801 // So if a cells has no gain in PMT1 and half gain in PMT2 it's score is 0.75
802 //
803 // Case (b) : 1 PMT in the Cell
804 // Half gain counts as 0.5
805 // No Gain counts as 1.0
806
807
808 // Cast the CaloCell as a TileCell
809 const TileCell *tileCell = dynamic_cast<const TileCell*>(cell);
810 if (!tileCell) return 0.0;
811
812 // Get IdentifierHash for both PMTs
813 const CaloDetDescrElement * caloDDE = tileCell->caloDDE();
814 IdentifierHash hash1 = caloDDE->onl1();
815 IdentifierHash hash2 = caloDDE->onl2();
816
817 // Values for PMT 1 and 2
818 int gain1(-9),gain2(-9);
819 float score(0.0),multiplier(1.0);
820 bool adc1_noGainL1(false),adc1_halfGainL1(false);
821 bool pmt2Valid(false),adc2_noGainL1(false),adc2_halfGainL1(false);
822
823 // PMT 1
824 gain1 = tileCell->gain1();
825 HWIdentifier adc_id1 = m_tileHWID->adc_id(hash1,(gain1<0)?1:gain1);
826 const TileBchStatus badChan1 = m_tileBadChanTool->getAdcStatus(adc_id1);
827 adc1_noGainL1 = badChan1.isNoGainL1();
828 adc1_halfGainL1 = badChan1.isHalfGainL1();
829
830 // gap/crack scintillators only have one PMT per cell
831 // PMT 2, if valid
832 if(hash2 != TileHWID::NOT_VALID_HASH){
833 pmt2Valid = true;
834 gain2 = tileCell->gain2();
835 HWIdentifier adc_id2 = m_tileHWID->adc_id(hash2,(gain2<0)?1:gain2);
836 const TileBchStatus badChan2 = m_tileBadChanTool->getAdcStatus(adc_id2);
837 adc2_noGainL1 = badChan2.isNoGainL1();
838 adc2_halfGainL1 = badChan2.isHalfGainL1();
839 }
840
841 // Calculate the TileCell score
842
843 // Check that a PMT can't contribute more than 0.5
844 // Should not be the case, but assumptions cause bugs.....
845 if(adc1_noGainL1 == true && adc1_halfGainL1 == true){adc1_halfGainL1 = false;}
846 if(adc2_noGainL1 == true && adc2_halfGainL1 == true){adc2_halfGainL1 = false;}
847
848 if(pmt2Valid == false){multiplier = 2.0;}
849 if(adc1_halfGainL1 == true){score += 0.25;}
850 if(adc1_noGainL1 == true){score += 0.5;}
851 if(adc2_halfGainL1 == true){score += 0.25;}
852 if(adc2_noGainL1 == true){score += 0.5;}
853
854 return score * multiplier;
855 }
856
857 float L1CaloOfflineTriggerTowerTools::TileCaloQuality(const std::vector<const CaloCell*> &cells) const{
858 float nom(0.), denom(0.);
859 for(Itr_vCaloCells i=cells.begin();i!=cells.end();++i){
860 const TileCell *tileCell = dynamic_cast<const TileCell*>( (*i) );
861
862 if(tileCell && tileCell->provenance() & 0x8080) {
863 nom += tileCell->e() * std::max(tileCell->qual1(), tileCell->qual2());
864 denom += tileCell->e();
865 }
866 }
867
868 if(denom != 0.) {
869 nom /= denom;
870 }
871 else {
872 nom = -1e6; // error value
873 }
874 return nom;
875 }
876
877 // EM
878
880 Identifier Id = this->emID(tt->eta(),tt->phi());
881 std::vector<const CaloCell*> cells = m_cells2tt->caloCells(Id);
882 return this->LArCaloQuality(cells);
883 }
884
886 if(m_isLArHVCorrToolSet == false){return -9.9;}
887 Identifier Id = this->emID(tt->eta(),tt->phi());
888 std::vector<const CaloCell*> cells = m_cells2tt->caloCells(Id);
889 return this->LArNonNominalHV( cells );
890 }
891
893 std::vector<float> nNonNomHV;
894 if(m_isLArHVCorrToolSet == false){return nNonNomHV;}
895
896 Identifier Id = this->emID(tt->eta(),tt->phi());
897 std::vector<std::vector<const CaloCell*> > cells = m_cells2tt->caloCellsByLayer(Id);
898 for(Itr_vvCaloCells i=cells.begin();i!=cells.end();++i){
899 nNonNomHV.push_back( this->LArNonNominalHV( (*i) ) );
900 }
901 return nNonNomHV;
902 }
903
905 std::vector<std::vector<float> > nNonNomHV;
906 if(m_isLArHVCorrToolSet == false){return nNonNomHV;}
907 Identifier Id = this->emID(tt->eta(),tt->phi());
908 std::vector<L1CaloRxCoolChannelId> rx = this->emReceivers(tt);
909 std::vector<float> v1;
910 std::vector<float> v2;
911 std::vector<std::vector<const CaloCell*> > cells = m_cells2tt->caloCellsByLayer(Id);
912 for(Itr_vvCaloCells i=cells.begin();i!=cells.end();++i){
913 if ((*i).empty()) continue;
914 if (rx.size() == 2) {
915 std::vector<std::vector<const CaloCell*> > cellsRx = this->sortEMCrackCells((*i));
916 for(Itr_vvCaloCells j=cellsRx.begin();j!=cellsRx.end();++j){
917 if ((*j).empty()) continue;
918 if (j == cellsRx.begin()) v1.push_back(this->LArNonNominalHV((*j)));
919 else v2.push_back(this->LArNonNominalHV((*j)));
920 }
921 } else if (rx.size() == 1) v1.push_back(this->LArNonNominalHV((*i)));
922 }
923 nNonNomHV.push_back(std::move(v1));
924 if (rx.size() == 2) nNonNomHV.push_back(std::move(v2));
925 return nNonNomHV;
926 }
927
929 if(m_isLArHVCorrToolSet == false){return -9.9;}
930 Identifier Id = this->emID(tt->eta(),tt->phi());
931 std::vector<const CaloCell*> cells = m_cells2tt->caloCells(Id);
932 return this->LArHVScale( cells );
933 }
934
936 std::vector<float> NonNomHV;
937 if(m_isLArHVCorrToolSet == false){return NonNomHV;}
938 Identifier Id = this->emID(tt->eta(),tt->phi());
939 std::vector<std::vector<const CaloCell*> > cells = m_cells2tt->caloCellsByLayer(Id);
940 for(Itr_vvCaloCells i=cells.begin();i!=cells.end();++i){
941 NonNomHV.push_back( this->LArHVScale( (*i ) ) );
942 }
943 return NonNomHV;
944 }
945
946
948
949 std::vector<float> output;
950 if(m_isLArHVCorrToolSet == false){return output;}
951 std::vector<L1CaloRxCoolChannelId> rx = this->emReceivers(tt);
952 Identifier Id = this->emID(tt->eta(),tt->phi());
953 std::vector<const CaloCell*> cells = m_cells2tt->caloCells(Id);
954
955 if(rx.size() == 2){
956 std::vector<std::vector<const CaloCell*> > vvcells = this->sortEMCrackCells(cells);
957 for(Itr_vvCaloCells i=vvcells.begin();i!=vvcells.end();++i){
958 output.push_back( this->LArHVScale( (*i) ) );
959 }
960 }
961
962 if(rx.size() == 1){
963 output.push_back( this->LArHVScale( cells ) );
964 }
965
966 return output;
967 }
968
970 std::vector<std::vector<float> > output;
971 if(m_isLArHVCorrToolSet == false){return output;}
972 Identifier Id = this->emID(tt->eta(),tt->phi());
973 std::vector<L1CaloRxCoolChannelId> rx = this->emReceivers(tt);
974 std::vector<float> v1;
975 std::vector<float> v2;
976 std::vector<std::vector<const CaloCell*> > cells = m_cells2tt->caloCellsByLayer(Id);
977 for(Itr_vvCaloCells i=cells.begin();i!=cells.end();++i){
978 if ((*i).empty()) continue;
979 if (rx.size() == 2) {
980 std::vector<std::vector<const CaloCell*> > cellsRx = this->sortEMCrackCells((*i));
981 for(Itr_vvCaloCells j=cellsRx.begin();j!=cellsRx.end();++j){
982 if ((*j).empty()) continue;
983 if (j == cellsRx.begin()) v1.push_back(this->LArHVScale((*j)));
984 else v2.push_back(this->LArHVScale((*j)));
985 }
986 } else if (rx.size() == 1) v1.push_back(this->LArHVScale((*i)));
987 }
988 output.push_back(std::move(v1));
989 if (rx.size() == 2) output.push_back(std::move(v2));
990 return output;
991 }
992
993
994 // Had
995
997 Identifier Id = this->hadID(tt->eta(),tt->phi());
998 std::vector<const CaloCell*> cells = m_cells2tt->caloCells(Id);
999 bool isTile = m_lvl1Helper->is_tile(Id);
1000
1001 if(isTile == true){return this->TileCaloQuality(cells);}
1002 if(isTile == false){return this->LArCaloQuality(cells);}
1003 return -9.9;
1004 }
1005
1006
1008 Identifier Id = this->hadID(tt->eta(),tt->phi());
1009 bool isTile = m_lvl1Helper->is_tile(Id);
1010 std::vector<const CaloCell*> cells = m_cells2tt->caloCells(Id);
1011
1012 if(isTile == false && m_isLArHVCorrToolSet == false){return -9.9;}
1013
1014 if(isTile == false && m_isLArHVCorrToolSet == true){
1015 return this->LArNonNominalHV( cells );
1016 }
1017
1018 if(isTile == true){
1019 return this->TileNonNominal( cells );
1020 }
1021 return -9.9;
1022 }
1023
1024
1026 std::vector<float> nNonNomHV;
1027 Identifier Id = this->hadID(tt->eta(),tt->phi());
1028 bool isTile = m_lvl1Helper->is_tile(Id);
1029 std::vector<std::vector<const CaloCell*> > cells = m_cells2tt->caloCellsByLayer(Id);
1030 if(isTile == false && m_isLArHVCorrToolSet == false){return nNonNomHV;}
1031 if(isTile == false && m_isLArHVCorrToolSet == true){
1032 for(Itr_vvCaloCells i=cells.begin();i!=cells.end();++i){
1033 nNonNomHV.push_back( this->LArNonNominalHV( (*i) ) );
1034 }
1035 }
1036
1037 if(isTile == true){
1038 for(Itr_vvCaloCells i=cells.begin();i!=cells.end();++i){
1039 nNonNomHV.push_back( this->TileNonNominal( (*i) ) );
1040 }
1041 }
1042
1043 return nNonNomHV;
1044
1045 }
1046
1048 std::vector<std::vector<float> > nNonNomHV;
1049 Identifier Id = this->hadID(tt->eta(),tt->phi());
1050 bool isTile = m_lvl1Helper->is_tile(Id);
1051 if(isTile == false && m_isLArHVCorrToolSet == false){return nNonNomHV;}
1052 std::vector<unsigned int> rx = this->hadRxId(tt);
1053 std::vector<float> v1;
1054 std::vector<float> v2;
1055 std::vector<std::vector<const CaloCell*> > cells = m_cells2tt->caloCellsByLayer(Id);
1056 for(Itr_vvCaloCells i=cells.begin();i!=cells.end();++i){
1057 if ((*i).empty()) continue;
1058 if (rx.size() == 2) {
1059 std::vector<std::vector<const CaloCell*> > cellsRx = this->sortFCAL23Cells((*i),rx);
1060 for(Itr_vvCaloCells j=cellsRx.begin();j!=cellsRx.end();++j){
1061 if ((*j).empty()) continue;
1062 if (j == cellsRx.begin()) v1.push_back( (isTile == false) ? this->LArNonNominalHV((*j))
1063 : this->TileNonNominal((*j)));
1064 else v2.push_back( (isTile == false) ? this->LArNonNominalHV((*j))
1065 : this->TileNonNominal((*j)));
1066 }
1067 } else if (rx.size() == 1) v1.push_back( (isTile == false) ? this->LArNonNominalHV((*i))
1068 : this->TileNonNominal((*i)));
1069 }
1070 nNonNomHV.push_back(std::move(v1));
1071 if (rx.size() == 2) nNonNomHV.push_back(std::move(v2));
1072 return nNonNomHV;
1073 }
1074
1076
1077 Identifier Id = this->hadID(tt->eta(),tt->phi());
1078 bool isTile = m_lvl1Helper->is_tile(Id);
1079 if(isTile == true){return -9.9;}
1080
1081 if(m_isLArHVCorrToolSet == false){return -9.9;}
1082 std::vector<const CaloCell*> cells = m_cells2tt->caloCells(Id);
1083 return this->LArHVScale( cells );
1084
1085 }
1086
1088 std::vector<float> NonNomHV;
1089 Identifier Id = this->hadID(tt->eta(),tt->phi());
1090 bool isTile = m_lvl1Helper->is_tile(Id);
1091 if(isTile == true){return NonNomHV;}
1092
1093 if(m_isLArHVCorrToolSet == false){return NonNomHV;}
1094 std::vector<std::vector<const CaloCell*> > cells = m_cells2tt->caloCellsByLayer(Id);
1095
1096 for(Itr_vvCaloCells i=cells.begin();i!=cells.end();++i){
1097 NonNomHV.push_back( this->LArHVScale( (*i ) ) );
1098 }
1099 return NonNomHV;
1100 }
1101
1103
1104 std::vector<float> output;
1105 if(m_isLArHVCorrToolSet == false){return output;}
1106 std::vector<unsigned int> rx = this->hadRxId(tt);
1107 Identifier Id = this->hadID(tt->eta(),tt->phi());
1108
1109 bool isTile = m_lvl1Helper->is_tile(Id);
1110 if(isTile == true){return output;}
1111
1112 std::vector<const CaloCell*> cells = m_cells2tt->caloCells(Id);
1113
1114 if(rx.size() == 2){
1115 std::vector<std::vector<const CaloCell*> > vvcells = this->sortFCAL23Cells(cells,rx);
1116 for(Itr_vvCaloCells i=vvcells.begin();i!=vvcells.end();++i){
1117 output.push_back( this->LArHVScale( (*i) ) );
1118 }
1119 }
1120
1121 if(rx.size() == 1){
1122 output.push_back( this->LArHVScale( cells ) );
1123 }
1124
1125 return output;
1126
1127 }
1128
1130 std::vector<std::vector<float> > output;
1131 Identifier Id = this->hadID(tt->eta(),tt->phi());
1132 bool isTile = m_lvl1Helper->is_tile(Id);
1133 if(isTile == true || m_isLArHVCorrToolSet == false){return output;}
1134 std::vector<unsigned int> rx = this->hadRxId(tt);
1135 std::vector<float> v1;
1136 std::vector<float> v2;
1137 std::vector<std::vector<const CaloCell*> > cells = m_cells2tt->caloCellsByLayer(Id);
1138 for(Itr_vvCaloCells i=cells.begin();i!=cells.end();++i){
1139 if ((*i).empty()) continue;
1140 if (rx.size() == 2) {
1141 std::vector<std::vector<const CaloCell*> > cellsRx = this->sortFCAL23Cells((*i),rx);
1142 for(Itr_vvCaloCells j=cellsRx.begin();j!=cellsRx.end();++j){
1143 if ((*j).empty()) continue;
1144 if (j == cellsRx.begin()) v1.push_back(this->LArHVScale((*j)));
1145 else v2.push_back(this->LArHVScale((*j)));
1146 }
1147 } else if (rx.size() == 1) v1.push_back(this->LArHVScale((*i)));
1148 }
1149 output.push_back(std::move(v1));
1150 if (rx.size() == 2) output.push_back(std::move(v2));
1151 return output;
1152 }
1153
1154
1156 // Phase 1 SuperCells //
1158
1159 // EM
1161 Identifier Id = this->emID(tt->eta(),tt->phi());
1162 std::vector<const CaloCell*> cells = m_cells2tt->caloCells(Id);
1163 return this->SuperCellIdentifiers( cells );
1164 }
1165
1167 Identifier Id = this->hadID(tt->eta(),tt->phi());
1168 std::vector<const CaloCell*> cells = m_cells2tt->caloCells(Id);
1169 return this->SuperCellIdentifiers( cells );
1170 }
1171
1172 std::vector<int> L1CaloOfflineTriggerTowerTools::SuperCellIdentifiers(const std::vector<const CaloCell*> &cells) const{
1173 std::vector<int> output;
1174 std::map<int, std::vector<const CaloCell*> > sc_ids;
1175 for(Itr_vCaloCells i=cells.begin();i!=cells.end();++i){
1176 const CaloCell* cell = (*i);
1177 Identifier sCellID = m_scidtool->offlineToSuperCellID ( cell->ID() );
1178 sc_ids[sCellID.get_identifier32().get_compact()].push_back( cell );
1179 }
1180 for(std::map< int, std::vector<const CaloCell*> >::const_iterator i=sc_ids.begin();i!=sc_ids.end();++i){
1181 output.push_back( (*i).first );
1182 }
1183 return output;
1184 }
1185
1187 // Database Attributes //
1189
1190 // EM
1191
1192 const coral::AttributeList* L1CaloOfflineTriggerTowerTools::emDbAttributes(const TriggerTower* tt,const CondAttrListCollection* dbAttrList) const{
1193 unsigned int coolId = this->emCoolChannelId(tt);
1195 const coral::AttributeList* attrList = 0;
1196 for(Itr_db i=dbAttrList->begin();i!=dbAttrList->end();++i){
1197 if(i->first == coolId){
1198 attrList = &(i->second);
1199 break;
1200 }
1201 }
1202 return attrList;
1203 }
1204
1205
1206 std::vector<const coral::AttributeList*> L1CaloOfflineTriggerTowerTools::emDbRxGainsAttributes(const TriggerTower* tt,const CondAttrListCollection* dbAttrList) const {
1207
1208 std::vector<L1CaloRxCoolChannelId> rx = this->emReceivers(tt);
1209 std::vector<const coral::AttributeList*> v_attr;
1211 typedef std::vector<L1CaloRxCoolChannelId>::const_iterator Itr_Id;
1212
1213 for(Itr_Id a=rx.begin();a!=rx.end();++a){
1214 for(Itr_db i=dbAttrList->begin();i!=dbAttrList->end();++i){
1215 if(i->first == (*a).id()){
1216 v_attr.push_back( &(i->second) );
1217 }
1218 }
1219 }
1220 return v_attr;
1221 }
1222
1223 // Had
1224
1225 const coral::AttributeList* L1CaloOfflineTriggerTowerTools::hadDbAttributes(const TriggerTower* tt,const CondAttrListCollection* dbAttrList) const{
1226 unsigned int coolId = this->hadCoolChannelId(tt);
1228 const coral::AttributeList* attrList = 0;
1229 for(Itr_db i=dbAttrList->begin();i!=dbAttrList->end();++i){
1230 if(i->first == coolId){
1231 attrList = &(i->second);
1232 break;
1233 }
1234 }
1235 return attrList;
1236 }
1237
1238 std::vector<const coral::AttributeList*> L1CaloOfflineTriggerTowerTools::hadDbRxGainsAttributes(const TriggerTower* tt,const CondAttrListCollection* dbAttrList) const{
1239
1240 std::vector<L1CaloRxCoolChannelId> rx = this->hadReceivers(tt);
1241 std::vector<const coral::AttributeList*> v_attr;
1243 typedef std::vector<L1CaloRxCoolChannelId>::const_iterator Itr_Id;
1244
1245 for(Itr_Id a=rx.begin();a!=rx.end();++a){
1246 for(Itr_db i=dbAttrList->begin();i!=dbAttrList->end();++i){
1247 if(i->first == (*a).id()){
1248 v_attr.push_back( &(i->second) );
1249 }
1250 }
1251 }
1252 return v_attr;
1253 }
1254
1255
1256
1258 // Database Quantities //
1260
1261
1262 float L1CaloOfflineTriggerTowerTools::RxGain(const coral::AttributeList* attrList) const{
1263 float value = 0;
1264 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1265 if((*attrList)[attrNum].specification().name() == "gain"){
1266 value = (float) (*attrList)[attrNum].data<float>();
1267 break;
1268 }
1269 }
1270 return value;
1271 }
1272
1273 unsigned int L1CaloOfflineTriggerTowerTools::RxStatus(const coral::AttributeList* attrList) const{
1274 unsigned int value = 0;
1275 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1276 if((*attrList)[attrNum].specification().name() == "status"){
1277 value = (unsigned int) (*attrList)[attrNum].data<unsigned int>();
1278 break;
1279 }
1280 }
1281 return value;
1282 }
1283
1284
1285 unsigned int L1CaloOfflineTriggerTowerTools::ModuleId(const coral::AttributeList* attrList) const{
1286 unsigned int value = 0;
1287 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1288 if((*attrList)[attrNum].specification().name() == "ModuleId"){
1289 value = (unsigned int) (*attrList)[attrNum].data<unsigned int>();
1290 break;
1291 }
1292 }
1293 return value;
1294 }
1295
1296 unsigned int L1CaloOfflineTriggerTowerTools::ErrorCode(const coral::AttributeList* attrList) const{
1297 unsigned int value = 0;
1298 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1299 if((*attrList)[attrNum].specification().name() == "ErrorCode"){
1300 value = (unsigned int) (*attrList)[attrNum].data<unsigned int>();
1301 break;
1302 }
1303 }
1304 return value;
1305 }
1306
1307 unsigned long long L1CaloOfflineTriggerTowerTools::PprDacScanResultsTimeStamp(const coral::AttributeList* attrList) const{
1308 unsigned long long value = 0;
1309 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1310 if((*attrList)[attrNum].specification().name() == "PprDacScanResultsTimeStamp"){
1311 value = (unsigned long long) (*attrList)[attrNum].data<unsigned long long>();
1312 break;
1313 }
1314 }
1315 return value;
1316 }
1317
1318 unsigned long long L1CaloOfflineTriggerTowerTools::PprPedestalRunResultsTimeStamp(const coral::AttributeList* attrList) const{
1319 unsigned long long value = 0;
1320 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1321 if((*attrList)[attrNum].specification().name() == "PprPedestalRunResultsTimeStamp"){
1322 value = (unsigned long long) (*attrList)[attrNum].data<unsigned long long>();
1323 break;
1324 }
1325 }
1326 return value;
1327 }
1328
1329 unsigned long long L1CaloOfflineTriggerTowerTools::PprNoiseRunResultsTimeStamp(const coral::AttributeList* attrList) const{
1330 unsigned long long value = 0;
1331 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1332 if((*attrList)[attrNum].specification().name() == "PprNoiseRunResultsTimeStamp"){
1333 value = (unsigned long long) (*attrList)[attrNum].data<unsigned long long>();
1334 break;
1335 }
1336 }
1337 return value;
1338 }
1339
1340 unsigned long long L1CaloOfflineTriggerTowerTools::PprTimingResultsTimeStamp(const coral::AttributeList* attrList) const{
1341 unsigned long long value = 0;
1342 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1343 if((*attrList)[attrNum].specification().name() == "PprTimingResultsTimeStamp"){
1344 value = (unsigned long long) (*attrList)[attrNum].data<unsigned long long>();
1345 break;
1346 }
1347 }
1348 return value;
1349 }
1350
1351 unsigned long long L1CaloOfflineTriggerTowerTools::PprSatBcidResultsTimeStamp(const coral::AttributeList* attrList) const{
1352 unsigned long long value = 0;
1353 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1354 if((*attrList)[attrNum].specification().name() == "PprSatBcidResultsTimeStamp"){
1355 value = (unsigned long long) (*attrList)[attrNum].data<unsigned long long>();
1356 break;
1357 }
1358 }
1359 return value;
1360 }
1361
1362 unsigned long long L1CaloOfflineTriggerTowerTools::PprFirFilterResultsTimeStamp(const coral::AttributeList* attrList) const{
1363 unsigned long long value = 0;
1364 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1365 if((*attrList)[attrNum].specification().name() == "PprFirFilterResultsTimeStamp"){
1366 value = (unsigned long long) (*attrList)[attrNum].data<unsigned long long>();
1367 break;
1368 }
1369 }
1370 return value;
1371 }
1372
1373 unsigned long long L1CaloOfflineTriggerTowerTools::PprLutValuesResultsTimeStamp(const coral::AttributeList* attrList) const{
1374 unsigned long long value = 0;
1375 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1376 if((*attrList)[attrNum].specification().name() == "PprLutValuesResultsTimeStamp"){
1377 value = (unsigned long long) (*attrList)[attrNum].data<unsigned long long>();
1378 break;
1379 }
1380 }
1381 return value;
1382 }
1383
1384 double L1CaloOfflineTriggerTowerTools::DacOffset(const coral::AttributeList* attrList) const{
1385 double value = 0;
1386 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1387 if((*attrList)[attrNum].specification().name() == "DacOffset"){
1388 value = (double) (*attrList)[attrNum].data<double>();
1389 break;
1390 }
1391 }
1392 return value;
1393 }
1394
1395 double L1CaloOfflineTriggerTowerTools::DacSlope(const coral::AttributeList* attrList) const{
1396 double value = 0;
1397 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1398 if((*attrList)[attrNum].specification().name() == "DacSlope"){
1399 value = (double) (*attrList)[attrNum].data<double>();
1400 break;
1401 }
1402 }
1403 return value;
1404 }
1405
1406 double L1CaloOfflineTriggerTowerTools::PedMean(const coral::AttributeList* attrList) const{
1407 double value = 0;
1408 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1409 if((*attrList)[attrNum].specification().name() == "PedMean"){
1410 value = (double) (*attrList)[attrNum].data<double>();
1411 break;
1412 }
1413 }
1414 return value;
1415 }
1416
1417 unsigned int L1CaloOfflineTriggerTowerTools::PedValue(const coral::AttributeList* attrList) const{
1418 unsigned int value = 0;
1419 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1420 if((*attrList)[attrNum].specification().name() == "PedValue"){
1421 value = (unsigned int) (*attrList)[attrNum].data<unsigned int>();
1422 break;
1423 }
1424 }
1425 return value;
1426 }
1427
1428 unsigned int L1CaloOfflineTriggerTowerTools::FullDelayData(const coral::AttributeList* attrList) const{
1429 unsigned int value = 0;
1430 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1431 if((*attrList)[attrNum].specification().name() == "FullDelayData"){
1432 value = (unsigned int) (*attrList)[attrNum].data<unsigned int>();
1433 break;
1434 }
1435 }
1436 return value;
1437 }
1438
1439 unsigned short int L1CaloOfflineTriggerTowerTools::SyncDelayBcid(const coral::AttributeList* attrList) const{
1440 unsigned short int value = 0;
1441 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1442 if((*attrList)[attrNum].specification().name() == "SyncDelayBcid"){
1443 value = (unsigned short int) (*attrList)[attrNum].data<unsigned short int>();
1444 break;
1445 }
1446 }
1447 return value;
1448 }
1449
1450
1451 unsigned short int L1CaloOfflineTriggerTowerTools::InBcidNegedge(const coral::AttributeList* attrList) const{
1452 unsigned short int value = 0;
1453 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1454 if((*attrList)[attrNum].specification().name() == "InBcidNegedge"){
1455 value = (unsigned short int) (*attrList)[attrNum].data<unsigned short int>();
1456 break;
1457 }
1458 }
1459 return value;
1460 }
1461
1462
1463 unsigned short int L1CaloOfflineTriggerTowerTools::ExtBcidThreshold(const coral::AttributeList* attrList) const{
1464 unsigned short int value = 0;
1465 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1466 if((*attrList)[attrNum].specification().name() == "ExtBcidThreshold"){
1467 value = (unsigned short int) (*attrList)[attrNum].data<unsigned short int>();
1468 break;
1469 }
1470 }
1471 return value;
1472 }
1473
1474 unsigned short int L1CaloOfflineTriggerTowerTools::SatBcidThreshLow(const coral::AttributeList* attrList) const{
1475 unsigned short int value = 0;
1476 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1477 if((*attrList)[attrNum].specification().name() == "SatBcidThreshLow"){
1478 value = (unsigned short int) (*attrList)[attrNum].data<unsigned short int>();
1479 break;
1480 }
1481 }
1482 return value;
1483 }
1484
1485 unsigned short int L1CaloOfflineTriggerTowerTools::SatBcidThreshHigh(const coral::AttributeList* attrList) const{
1486 unsigned short int value = 0;
1487 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1488 if((*attrList)[attrNum].specification().name() == "SatBcidThreshHigh"){
1489 value = (unsigned short int) (*attrList)[attrNum].data<unsigned short int>();
1490 break;
1491 }
1492 }
1493 return value;
1494 }
1495
1496 unsigned short int L1CaloOfflineTriggerTowerTools::SatBcidLevel(const coral::AttributeList* attrList) const{
1497 unsigned short int value = 0;
1498 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1499 if((*attrList)[attrNum].specification().name() == "SatBcidLevel"){
1500 value = (unsigned short int) (*attrList)[attrNum].data<unsigned short int>();
1501 break;
1502 }
1503 }
1504 return value;
1505 }
1506
1507 unsigned short int L1CaloOfflineTriggerTowerTools::BcidEnergyRangeLow(const coral::AttributeList* attrList) const{
1508 unsigned short int value = 0;
1509 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1510 if((*attrList)[attrNum].specification().name() == "BcidEnergyRangeLow"){
1511 value = (unsigned short int) (*attrList)[attrNum].data<unsigned short int>();
1512 break;
1513 }
1514 }
1515 return value;
1516 }
1517
1518 unsigned short int L1CaloOfflineTriggerTowerTools::BcidEnergyRangeHigh(const coral::AttributeList* attrList) const{
1519 unsigned short int value = 0;
1520 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1521 if((*attrList)[attrNum].specification().name() == "BcidEnergyRangeHigh"){
1522 value = (unsigned short int) (*attrList)[attrNum].data<unsigned short int>();
1523 break;
1524 }
1525 }
1526 return value;
1527 }
1528
1529 unsigned short int L1CaloOfflineTriggerTowerTools::FirStartBit(const coral::AttributeList* attrList) const{
1530 unsigned short int value = 0;
1531 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1532 if((*attrList)[attrNum].specification().name() == "FirStartBit"){
1533 value = (unsigned short int) (*attrList)[attrNum].data<unsigned short int>();
1534 break;
1535 }
1536 }
1537 return value;
1538 }
1539
1540 short L1CaloOfflineTriggerTowerTools::FirCoeff1(const coral::AttributeList* attrList) const{
1541 short value = 0;
1542 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1543 if((*attrList)[attrNum].specification().name() == "FirCoeff1"){
1544 value = (short) (*attrList)[attrNum].data<short>();
1545 break;
1546 }
1547 }
1548 return value;
1549 }
1550
1551 short L1CaloOfflineTriggerTowerTools::FirCoeff2(const coral::AttributeList* attrList) const{
1552 short value = 0;
1553 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1554 if((*attrList)[attrNum].specification().name() == "FirCoeff2"){
1555 value = (short) (*attrList)[attrNum].data<short>();
1556 break;
1557 }
1558 }
1559 return value;
1560 }
1561
1562 short L1CaloOfflineTriggerTowerTools::FirCoeff3(const coral::AttributeList* attrList) const{
1563 short value = 0;
1564 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1565 if((*attrList)[attrNum].specification().name() == "FirCoeff3"){
1566 value = (short) (*attrList)[attrNum].data<short>();
1567 break;
1568 }
1569 }
1570 return value;
1571 }
1572
1573 short L1CaloOfflineTriggerTowerTools::FirCoeff4(const coral::AttributeList* attrList) const{
1574 short value = 0;
1575 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1576 if((*attrList)[attrNum].specification().name() == "FirCoeff4"){
1577 value = (short) (*attrList)[attrNum].data<short>();
1578 break;
1579 }
1580 }
1581 return value;
1582 }
1583
1584 short L1CaloOfflineTriggerTowerTools::FirCoeff5(const coral::AttributeList* attrList) const{
1585 short value = 0;
1586 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1587 if((*attrList)[attrNum].specification().name() == "FirCoeff5"){
1588 value = (short) (*attrList)[attrNum].data<short>();
1589 break;
1590 }
1591 }
1592 return value;
1593 }
1594
1595 unsigned short L1CaloOfflineTriggerTowerTools::LutStrategy(const coral::AttributeList* attrList) const{
1596 unsigned short value = 0;
1597 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1598 if((*attrList)[attrNum].specification().name() == "LutStrategy"){
1599 value = (unsigned short) (*attrList)[attrNum].data<unsigned short>();
1600 break;
1601 }
1602 }
1603 return value;
1604 }
1605
1606 unsigned short L1CaloOfflineTriggerTowerTools::LutOffset(const coral::AttributeList* attrList) const{
1607 unsigned short value = 0;
1608 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1609 if((*attrList)[attrNum].specification().name() == "LutOffset"){
1610 value = (unsigned short) (*attrList)[attrNum].data<unsigned short>();
1611 break;
1612 }
1613 }
1614 return value;
1615 }
1616
1617 unsigned short L1CaloOfflineTriggerTowerTools::LutSlope(const coral::AttributeList* attrList) const{
1618 unsigned short value = 0;
1619 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1620 if((*attrList)[attrNum].specification().name() == "LutSlope"){
1621 value = (unsigned short) (*attrList)[attrNum].data<unsigned short >();
1622 break;
1623 }
1624 }
1625 return value;
1626 }
1627
1628 unsigned short L1CaloOfflineTriggerTowerTools::LutNoiseCut(const coral::AttributeList* attrList) const{
1629 unsigned short value = 0;
1630 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1631 if((*attrList)[attrNum].specification().name() == "LutNoiseCut"){
1632 value = (unsigned short) (*attrList)[attrNum].data<unsigned short>();
1633 break;
1634 }
1635 }
1636 return value;
1637 }
1638
1639 // Disabled Tower in >= 2011 data
1640 // Should use the DB folder /TRIGGER/L1Calo/V1/Conditions/DisabledTowers
1641 unsigned int L1CaloOfflineTriggerTowerTools::DisabledTower(const coral::AttributeList* attrList) const{
1642 unsigned int value = 0;
1643 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1644 if((*attrList)[attrNum].specification().name() == "disabledBits"){
1645 value = (unsigned int) (*attrList)[attrNum].data<unsigned int>();
1646 break;
1647 }
1648 }
1649 return value;
1650 }
1651
1652 // Dead Channels in 2010 data
1653 // Should use the DB folder /TRIGGER/L1Calo/V1/Calibration/PpmDeadChannels
1654 unsigned int L1CaloOfflineTriggerTowerTools::DeadChannel(const coral::AttributeList* attrList) const{
1655 unsigned int value = 0;
1656 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1657 if((*attrList)[attrNum].specification().name() == "ErrorCode"){
1658 value = (unsigned int) (*attrList)[attrNum].data<unsigned int>();
1659 break;
1660 }
1661 }
1662 return value;
1663 }
1664
1665
1666
1668 // Internals //
1670
1671
1673 ATH_CHECK( detStore()->retrieve(m_caloMgr) );
1674
1675 m_ttOnlineIdHelper = m_caloMgr->getTTOnlineID();
1676 if(!m_ttOnlineIdHelper){ATH_MSG_ERROR("Could not access TTOnlineId helper");return StatusCode::FAILURE;}
1677
1678 m_lvl1Helper = m_caloMgr->getLVL1_ID();
1679 if(!m_lvl1Helper){ATH_MSG_ERROR("Could not access CaloLVL1_ID helper");return StatusCode::FAILURE;}
1680
1681 ATH_CHECK( detStore()->retrieve(m_tileHWID) );
1682 ATH_CHECK( m_tileBadChanTool.retrieve() );
1683 ATH_CHECK( m_rxMapTool.retrieve() );
1684 ATH_CHECK( detStore()->retrieve(m_larOnlineID,"LArOnlineID") );
1685 ATH_CHECK( m_l1CaloTTIdTools.retrieve() );
1686 ATH_CHECK( m_cells2tt.retrieve() );
1687
1688 ATH_CHECK( detStore()->retrieve (m_caloMgr, "CaloIdManager") );
1689 ATH_CHECK( m_scidtool.retrieve() );
1690
1691 //Retrieve cabling & tt services
1692 ATH_CHECK( m_ttSvc.retrieve() );
1693
1694 ATH_CHECK( m_onlineScaleCorrKey.initialize() );
1695
1696 ATH_MSG_INFO("L1Calo L1CaloOfflineTriggerTowerTools initialize() success!");
1697 return StatusCode::SUCCESS;
1698 }
1699
1701 return StatusCode::SUCCESS;
1702 }
1703
1706 {
1707 m_scaleCorrKey = scaleCorrKey;
1708 m_cablingKey = cablingKey;
1709 m_isLArHVCorrToolSet = true;
1710 }
1711
1713 return m_l1CaloTTIdTools->pos_neg_z(eta);
1714 }
1715
1717 return m_l1CaloTTIdTools->regionIndex(eta);
1718 }
1719
1721 return m_l1CaloTTIdTools->etaIndex(eta);
1722 }
1723
1724 int L1CaloOfflineTriggerTowerTools::iphi(const double eta,const double phi) const{
1725 return m_l1CaloTTIdTools->phiIndex(eta,phi);
1726 }
1727
1728 Identifier L1CaloOfflineTriggerTowerTools::ID(const double eta,const double phi,int layer) const{
1729 return m_lvl1Helper->tower_id(this->pos_neg_z(eta),layer,this->region(eta),this->ieta(eta),this->iphi(eta,phi));
1730 }
1731
1732 Identifier L1CaloOfflineTriggerTowerTools::emID(const double eta,const double phi) const{
1733 return m_lvl1Helper->tower_id(this->pos_neg_z(eta),0,this->region(eta),this->ieta(eta),this->iphi(eta,phi));
1734 }
1735
1737 return m_lvl1Helper->tower_id(this->pos_neg_z(eta),1,this->region(eta),this->ieta(eta),this->iphi(eta,phi));
1738 }
1739
1741 m_cells2tt->initCaloCellsTriggerTowers(*cells);
1742 }
1743
1744} // end of namespace
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
static Double_t a
#define y
#define x
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
const ServiceHandle< StoreGateSvc > & detStore() const
Container class for CaloCell.
Data object for each calorimeter readout cell.
Definition CaloCell.h:57
virtual double e() const override final
get energy (data member) (synonym to method energy()
Definition CaloCell.h:333
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
Definition CaloCell.h:321
uint16_t provenance() const
get provenance (data member)
Definition CaloCell.h:354
This class groups all DetDescr information related to a CaloCell.
IdentifierHash onl2() const
cell online identifier 2
IdentifierHash onl1() const
cell online identifier 1
This class is a collection of AttributeLists where each one is associated with a channel number.
const_iterator end() const
const_iterator begin() const
Access to Chan/AttributeList pairs via iterators.
ChanAttrListMap::const_iterator const_iterator
virtual const float & HVScaleCorr(const HWIdentifier &id) const =0
value_type get_compact() const
Get the compact id.
This is a "hash" representation of an Identifier.
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
Encapsulates the ID of one channel of conditions data in COOL, ie the ID of a row in a table.
unsigned int id() const
virtual std::vector< std::vector< float > > emNCellsNonNominalByReceiverByLayer(const TriggerTower *tt) const override
virtual unsigned short int FirStartBit(const coral::AttributeList *attrList) const override
virtual std::vector< float > emTTCellsEnergyByLayer(const TriggerTower *tt) const override
virtual unsigned long long PprLutValuesResultsTimeStamp(const coral::AttributeList *attrList) const override
virtual float emNonNominalMeanScale(const TriggerTower *tt) const override
virtual float LArCaloQuality(const std::vector< const CaloCell * > &cells) const override
virtual std::vector< float > hadTTCellsEtByLayer(const TriggerTower *tt) const override
ToolHandle< CaloTriggerTowerService > m_ttSvc
virtual short FirCoeff3(const coral::AttributeList *attrList) const override
ToolHandle< ICaloSuperCellIDTool > m_scidtool
virtual short FirCoeff5(const coral::AttributeList *attrList) const override
virtual std::vector< float > hadTTCellsEtByReceiver(const TriggerTower *tt, const int mode=0) const override
virtual std::vector< std::vector< const CaloCell * > > sortEMCrackCells(const std::vector< const CaloCell * > &cells) const override
virtual int emNCells(const TriggerTower *tt) const override
virtual std::vector< float > emTTCellsEtByLayer(const TriggerTower *tt) const override
virtual unsigned long long PprNoiseRunResultsTimeStamp(const coral::AttributeList *attrList) const override
virtual unsigned int DisabledTower(const coral::AttributeList *attrList) const override
virtual unsigned long long PprTimingResultsTimeStamp(const coral::AttributeList *attrList) const override
virtual std::vector< float > hadTTCellsEnergyByLayer(const TriggerTower *tt) const override
virtual std::vector< std::vector< int > > emNCellsByReceiverByLayer(const TriggerTower *tt) const override
virtual short FirCoeff2(const coral::AttributeList *attrList) const override
virtual std::vector< const coral::AttributeList * > hadDbRxGainsAttributes(const TriggerTower *tt, const CondAttrListCollection *dbAttrList) const override
virtual float emTTCellsEnergy(const TriggerTower *tt) const override
std::map< Identifier, const TileTTL1Cell * > IdTTL1CellMapType
virtual int hadNCells(const TriggerTower *tt) const override
virtual unsigned long long PprFirFilterResultsTimeStamp(const coral::AttributeList *attrList) const override
virtual std::vector< std::vector< int > > hadNCellsByReceiverByLayer(const TriggerTower *tt) const override
virtual unsigned int PedValue(const coral::AttributeList *attrList) const override
std::vector< int > hadSuperCellIdentifiers(const TriggerTower *tt) const
virtual unsigned short LutOffset(const coral::AttributeList *attrList) const override
virtual std::vector< unsigned int > hadRxId(const TriggerTower *tt) const override
virtual std::vector< unsigned int > emRxId(const TriggerTower *tt) const override
std::vector< int > SuperCellIdentifiers(const std::vector< const CaloCell * > &cells) const
virtual std::vector< std::vector< const CaloCell * > > sortFCAL23Cells(const std::vector< const CaloCell * > &cells, const double eta) const override
virtual double DacOffset(const coral::AttributeList *attrList) const override
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
virtual const coral::AttributeList * hadDbAttributes(const TriggerTower *tt, const CondAttrListCollection *dbAttrList) const override
L1CaloOfflineTriggerTowerTools()=delete
delete the big 4
virtual std::vector< float > emNCellsNonNominalByLayer(const TriggerTower *tt) const override
virtual unsigned int ModuleId(const coral::AttributeList *attrList) const override
virtual float hadNonNominalMeanScale(const TriggerTower *tt) const override
virtual Identifier hadID(const double eta, const double phi) const override
virtual double PedMean(const coral::AttributeList *attrList) const override
ToolHandle< LVL1::IL1CaloCells2TriggerTowers > m_cells2tt
virtual double DacSlope(const coral::AttributeList *attrList) const override
virtual int region(const double eta) const override
virtual std::vector< const CaloCell * > emCells(const TriggerTower *tt) const override
virtual unsigned int DeadChannel(const coral::AttributeList *attrList) const override
virtual unsigned long long PprSatBcidResultsTimeStamp(const coral::AttributeList *attrList) const override
virtual std::vector< float > emNonNominalMeanScaleByLayer(const TriggerTower *tt) const override
virtual unsigned int RxStatus(const coral::AttributeList *attrList) const override
virtual std::vector< float > hadTTCellsEnergyByReceiver(const TriggerTower *tt, const int mode=0) const override
virtual std::vector< float > hadNonNominalMeanScaleByReceiver(const TriggerTower *tt) const override
virtual int emPpmSubmodule(const TriggerTower *tt) const override
virtual unsigned short int BcidEnergyRangeHigh(const coral::AttributeList *attrList) const override
virtual float RxGain(const coral::AttributeList *attrList) const override
virtual const coral::AttributeList * emDbAttributes(const TriggerTower *tt, const CondAttrListCollection *dbAttrList) const override
virtual float LArNonNominalHV(const std::vector< const CaloCell * > &cells) const override
virtual unsigned short LutNoiseCut(const coral::AttributeList *attrList) const override
virtual std::vector< int > hadTTCellsLayerNames(const TriggerTower *tt) const override
virtual Identifier emID(const double eta, const double phi) const override
virtual int iphi(const double eta, const double phi) const override
virtual unsigned int ErrorCode(const coral::AttributeList *attrList) const override
virtual std::vector< int > emNCellsByLayer(const TriggerTower *tt) const override
virtual float emCaloQuality(const TriggerTower *tt) const override
virtual short FirCoeff1(const coral::AttributeList *attrList) const override
virtual std::vector< float > emTTCellsEnergyByReceiver(const TriggerTower *tt, const int mode=0) const override
virtual float hadCaloQuality(const TriggerTower *tt) const override
ToolHandle< LVL1::IL1CaloTTIdTools > m_l1CaloTTIdTools
virtual unsigned int FullDelayData(const coral::AttributeList *attrList) const override
virtual unsigned short int InBcidNegedge(const coral::AttributeList *attrList) const override
std::vector< int > emSuperCellIdentifiers(const TriggerTower *tt) const
virtual float emNCellsNonNominal(const TriggerTower *tt) const override
virtual float hadNCellsNonNominal(const TriggerTower *tt) const override
virtual int emPpmChannel(const TriggerTower *tt) const override
virtual float TileNonNominal(const std::vector< const CaloCell * > &cells) const override
virtual std::vector< std::vector< int > > emTTCellsLayerNamesByReceiver(const TriggerTower *tt) const override
virtual std::vector< int > hadNCellsByLayer(const TriggerTower *tt) const override
virtual int emPpmCrate(const TriggerTower *tt) const override
virtual unsigned short LutSlope(const coral::AttributeList *attrList) const override
SG::ReadCondHandleKey< ILArHVScaleCorr > m_onlineScaleCorrKey
virtual unsigned long long PprDacScanResultsTimeStamp(const coral::AttributeList *attrList) const override
virtual std::vector< L1CaloRxCoolChannelId > hadReceivers(const TriggerTower *tt) const override
virtual int hadPpmChannel(const TriggerTower *tt) const override
virtual std::vector< float > emTTCellsEtByReceiver(const TriggerTower *tt, const int mode=0) const override
virtual std::vector< int > hadLocation(const TriggerTower *tt) const override
virtual float emTTCellsEt(const TriggerTower *tt) const override
virtual unsigned int emCoolChannelId(const TriggerTower *tt) const override
virtual std::vector< int > emLocation(const TriggerTower *tt) const override
virtual float tileCellEnergy(const TriggerTower *tt, IdTTL1CellMapType &map) const override
virtual float LArHVScale(const std::vector< const CaloCell * > &cells) const override
virtual void LArHV(const SG::ReadCondHandleKey< ILArHVScaleCorr > &scaleCorrKey, const SG::ReadCondHandleKey< LArOnOffIdMapping > &cablingKey) override
virtual int hadIsTile(const TriggerTower *tt) const override
virtual short FirCoeff4(const coral::AttributeList *attrList) const override
std::vector< std::vector< constCaloCell * > >::const_iterator Itr_vvCaloCells
virtual std::vector< int > hadNCellsByReceiver(const TriggerTower *tt) const override
virtual int pos_neg_z(const double eta) const override
virtual unsigned long long PprPedestalRunResultsTimeStamp(const coral::AttributeList *attrList) const override
virtual std::vector< int > emTTCellsLayerNames(const TriggerTower *tt) const override
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
virtual std::vector< float > hadNCellsNonNominalByLayer(const TriggerTower *tt) const override
virtual int ieta(const double eta) const override
virtual int emPpmModule(const TriggerTower *tt) const override
virtual std::vector< L1CaloRxCoolChannelId > emReceivers(const TriggerTower *tt) const override
Identifier ID(const double eta, const double phi, int layer) const
virtual std::vector< std::vector< float > > hadNCellsNonNominalByReceiverByLayer(const TriggerTower *tt) const override
virtual int hadPpmCrate(const TriggerTower *tt) const override
virtual unsigned short int SatBcidLevel(const coral::AttributeList *attrList) const override
virtual std::vector< const CaloCell * > hadCells(const TriggerTower *tt) const override
virtual std::vector< std::vector< float > > emNonNominalMeanScaleByReceiverByLayer(const TriggerTower *tt) const override
virtual unsigned int hadCoolChannelId(const TriggerTower *tt) const override
virtual std::vector< int > emNCellsByReceiver(const TriggerTower *tt) const override
std::vector< constCaloCell * >::const_iterator Itr_vCaloCells
virtual int hadPpmSubmodule(const TriggerTower *tt) const override
virtual std::vector< float > hadNonNominalMeanScaleByLayer(const TriggerTower *tt) const override
virtual std::vector< float > emNonNominalMeanScaleByReceiver(const TriggerTower *tt) const override
virtual float TileCaloQuality(const std::vector< const CaloCell * > &cells) const override
virtual unsigned short int SatBcidThreshHigh(const coral::AttributeList *attrList) const override
virtual std::vector< const coral::AttributeList * > emDbRxGainsAttributes(const TriggerTower *tt, const CondAttrListCollection *dbAttrList) const override
virtual void caloCells(const CaloCellContainer *cells) override
virtual unsigned short int SyncDelayBcid(const coral::AttributeList *attrList) const override
virtual unsigned short int BcidEnergyRangeLow(const coral::AttributeList *attrList) const override
virtual float hadTTCellsEnergy(const TriggerTower *tt) const override
virtual std::vector< std::vector< float > > hadNonNominalMeanScaleByReceiverByLayer(const TriggerTower *tt) const override
virtual unsigned short int ExtBcidThreshold(const coral::AttributeList *attrList) const override
virtual unsigned short int SatBcidThreshLow(const coral::AttributeList *attrList) const override
virtual std::vector< std::vector< int > > hadTTCellsLayerNamesByReceiver(const TriggerTower *tt) const override
ToolHandle< LVL1::IL1CaloFcal23Cells2RxMappingTool > m_rxMapTool
virtual unsigned short LutStrategy(const coral::AttributeList *attrList) const override
virtual int hadPpmModule(const TriggerTower *tt) const override
SG::ReadCondHandleKey< ILArHVScaleCorr > m_scaleCorrKey
virtual float hadTTCellsEt(const TriggerTower *tt) const override
Trigger towers are the inputs to all other parts of the calorimeter trigger.
const_pointer_type cptr()
Class holding bad channel problems.
bool isNoGainL1() const
bool isHalfGainL1() const
uint8_t qual1(void) const
get quality of first PMT (data member)
Definition TileCell.h:197
int gain2(void) const
get gain of second PMT
Definition TileCell.cxx:175
int gain1(void) const
get gain of first PMT
Definition TileCell.cxx:168
uint8_t qual2(void) const
get quality of second PMT (data member)
Definition TileCell.h:200
@ NOT_VALID_HASH
Definition TileHWID.h:314
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition AsgTool.cxx:58
STL class.
int count(std::string s, const std::string &regx)
count how many occurances of a regx are in a string
Definition hcg.cxx:146
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...