ATLAS Offline Software
Loading...
Searching...
No Matches
L1CaloOfflineTriggerTowerTools.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 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 const EventContext& ctx = Gaudi::Hive::currentContext();
808
809 // Cast the CaloCell as a TileCell
810 const TileCell *tileCell = dynamic_cast<const TileCell*>(cell);
811 if (!tileCell) return 0.0;
812
813 // Get IdentifierHash for both PMTs
814 const CaloDetDescrElement * caloDDE = tileCell->caloDDE();
815 IdentifierHash hash1 = caloDDE->onl1();
816 IdentifierHash hash2 = caloDDE->onl2();
817
818 // Values for PMT 1 and 2
819 int gain1(-9),gain2(-9);
820 float score(0.0),multiplier(1.0);
821 bool adc1_noGainL1(false),adc1_halfGainL1(false);
822 bool pmt2Valid(false),adc2_noGainL1(false),adc2_halfGainL1(false);
823
824 // PMT 1
825 gain1 = tileCell->gain1();
826 HWIdentifier adc_id1 = m_tileHWID->adc_id(hash1,(gain1<0)?1:gain1);
827 const TileBchStatus badChan1 = m_tileBadChanTool->getAdcStatus(adc_id1, ctx);
828 adc1_noGainL1 = badChan1.isNoGainL1();
829 adc1_halfGainL1 = badChan1.isHalfGainL1();
830
831 // gap/crack scintillators only have one PMT per cell
832 // PMT 2, if valid
833 if(hash2 != TileHWID::NOT_VALID_HASH){
834 pmt2Valid = true;
835 gain2 = tileCell->gain2();
836 HWIdentifier adc_id2 = m_tileHWID->adc_id(hash2,(gain2<0)?1:gain2);
837 const TileBchStatus badChan2 = m_tileBadChanTool->getAdcStatus(adc_id2, ctx);
838 adc2_noGainL1 = badChan2.isNoGainL1();
839 adc2_halfGainL1 = badChan2.isHalfGainL1();
840 }
841
842 // Calculate the TileCell score
843
844 // Check that a PMT can't contribute more than 0.5
845 // Should not be the case, but assumptions cause bugs.....
846 if(adc1_noGainL1 == true && adc1_halfGainL1 == true){adc1_halfGainL1 = false;}
847 if(adc2_noGainL1 == true && adc2_halfGainL1 == true){adc2_halfGainL1 = false;}
848
849 if(pmt2Valid == false){multiplier = 2.0;}
850 if(adc1_halfGainL1 == true){score += 0.25;}
851 if(adc1_noGainL1 == true){score += 0.5;}
852 if(adc2_halfGainL1 == true){score += 0.25;}
853 if(adc2_noGainL1 == true){score += 0.5;}
854
855 return score * multiplier;
856 }
857
858 float L1CaloOfflineTriggerTowerTools::TileCaloQuality(const std::vector<const CaloCell*> &cells) const{
859 float nom(0.), denom(0.);
860 for(Itr_vCaloCells i=cells.begin();i!=cells.end();++i){
861 const TileCell *tileCell = dynamic_cast<const TileCell*>( (*i) );
862
863 if(tileCell && tileCell->provenance() & 0x8080) {
864 nom += tileCell->e() * std::max(tileCell->qual1(), tileCell->qual2());
865 denom += tileCell->e();
866 }
867 }
868
869 if(denom != 0.) {
870 nom /= denom;
871 }
872 else {
873 nom = -1e6; // error value
874 }
875 return nom;
876 }
877
878 // EM
879
881 Identifier Id = this->emID(tt->eta(),tt->phi());
882 std::vector<const CaloCell*> cells = m_cells2tt->caloCells(Id);
883 return this->LArCaloQuality(cells);
884 }
885
887 if(m_isLArHVCorrToolSet == false){return -9.9;}
888 Identifier Id = this->emID(tt->eta(),tt->phi());
889 std::vector<const CaloCell*> cells = m_cells2tt->caloCells(Id);
890 return this->LArNonNominalHV( cells );
891 }
892
894 std::vector<float> nNonNomHV;
895 if(m_isLArHVCorrToolSet == false){return nNonNomHV;}
896
897 Identifier Id = this->emID(tt->eta(),tt->phi());
898 std::vector<std::vector<const CaloCell*> > cells = m_cells2tt->caloCellsByLayer(Id);
899 for(Itr_vvCaloCells i=cells.begin();i!=cells.end();++i){
900 nNonNomHV.push_back( this->LArNonNominalHV( (*i) ) );
901 }
902 return nNonNomHV;
903 }
904
906 std::vector<std::vector<float> > nNonNomHV;
907 if(m_isLArHVCorrToolSet == false){return nNonNomHV;}
908 Identifier Id = this->emID(tt->eta(),tt->phi());
909 std::vector<L1CaloRxCoolChannelId> rx = this->emReceivers(tt);
910 std::vector<float> v1;
911 std::vector<float> v2;
912 std::vector<std::vector<const CaloCell*> > cells = m_cells2tt->caloCellsByLayer(Id);
913 for(Itr_vvCaloCells i=cells.begin();i!=cells.end();++i){
914 if ((*i).empty()) continue;
915 if (rx.size() == 2) {
916 std::vector<std::vector<const CaloCell*> > cellsRx = this->sortEMCrackCells((*i));
917 for(Itr_vvCaloCells j=cellsRx.begin();j!=cellsRx.end();++j){
918 if ((*j).empty()) continue;
919 if (j == cellsRx.begin()) v1.push_back(this->LArNonNominalHV((*j)));
920 else v2.push_back(this->LArNonNominalHV((*j)));
921 }
922 } else if (rx.size() == 1) v1.push_back(this->LArNonNominalHV((*i)));
923 }
924 nNonNomHV.push_back(std::move(v1));
925 if (rx.size() == 2) nNonNomHV.push_back(std::move(v2));
926 return nNonNomHV;
927 }
928
930 if(m_isLArHVCorrToolSet == false){return -9.9;}
931 Identifier Id = this->emID(tt->eta(),tt->phi());
932 std::vector<const CaloCell*> cells = m_cells2tt->caloCells(Id);
933 return this->LArHVScale( cells );
934 }
935
937 std::vector<float> NonNomHV;
938 if(m_isLArHVCorrToolSet == false){return NonNomHV;}
939 Identifier Id = this->emID(tt->eta(),tt->phi());
940 std::vector<std::vector<const CaloCell*> > cells = m_cells2tt->caloCellsByLayer(Id);
941 for(Itr_vvCaloCells i=cells.begin();i!=cells.end();++i){
942 NonNomHV.push_back( this->LArHVScale( (*i ) ) );
943 }
944 return NonNomHV;
945 }
946
947
949
950 std::vector<float> output;
951 if(m_isLArHVCorrToolSet == false){return output;}
952 std::vector<L1CaloRxCoolChannelId> rx = this->emReceivers(tt);
953 Identifier Id = this->emID(tt->eta(),tt->phi());
954 std::vector<const CaloCell*> cells = m_cells2tt->caloCells(Id);
955
956 if(rx.size() == 2){
957 std::vector<std::vector<const CaloCell*> > vvcells = this->sortEMCrackCells(cells);
958 for(Itr_vvCaloCells i=vvcells.begin();i!=vvcells.end();++i){
959 output.push_back( this->LArHVScale( (*i) ) );
960 }
961 }
962
963 if(rx.size() == 1){
964 output.push_back( this->LArHVScale( cells ) );
965 }
966
967 return output;
968 }
969
971 std::vector<std::vector<float> > output;
972 if(m_isLArHVCorrToolSet == false){return output;}
973 Identifier Id = this->emID(tt->eta(),tt->phi());
974 std::vector<L1CaloRxCoolChannelId> rx = this->emReceivers(tt);
975 std::vector<float> v1;
976 std::vector<float> v2;
977 std::vector<std::vector<const CaloCell*> > cells = m_cells2tt->caloCellsByLayer(Id);
978 for(Itr_vvCaloCells i=cells.begin();i!=cells.end();++i){
979 if ((*i).empty()) continue;
980 if (rx.size() == 2) {
981 std::vector<std::vector<const CaloCell*> > cellsRx = this->sortEMCrackCells((*i));
982 for(Itr_vvCaloCells j=cellsRx.begin();j!=cellsRx.end();++j){
983 if ((*j).empty()) continue;
984 if (j == cellsRx.begin()) v1.push_back(this->LArHVScale((*j)));
985 else v2.push_back(this->LArHVScale((*j)));
986 }
987 } else if (rx.size() == 1) v1.push_back(this->LArHVScale((*i)));
988 }
989 output.push_back(std::move(v1));
990 if (rx.size() == 2) output.push_back(std::move(v2));
991 return output;
992 }
993
994
995 // Had
996
998 Identifier Id = this->hadID(tt->eta(),tt->phi());
999 std::vector<const CaloCell*> cells = m_cells2tt->caloCells(Id);
1000 bool isTile = m_lvl1Helper->is_tile(Id);
1001
1002 if(isTile == true){return this->TileCaloQuality(cells);}
1003 if(isTile == false){return this->LArCaloQuality(cells);}
1004 return -9.9;
1005 }
1006
1007
1009 Identifier Id = this->hadID(tt->eta(),tt->phi());
1010 bool isTile = m_lvl1Helper->is_tile(Id);
1011 std::vector<const CaloCell*> cells = m_cells2tt->caloCells(Id);
1012
1013 if(isTile == false && m_isLArHVCorrToolSet == false){return -9.9;}
1014
1015 if(isTile == false && m_isLArHVCorrToolSet == true){
1016 return this->LArNonNominalHV( cells );
1017 }
1018
1019 if(isTile == true){
1020 return this->TileNonNominal( cells );
1021 }
1022 return -9.9;
1023 }
1024
1025
1027 std::vector<float> nNonNomHV;
1028 Identifier Id = this->hadID(tt->eta(),tt->phi());
1029 bool isTile = m_lvl1Helper->is_tile(Id);
1030 std::vector<std::vector<const CaloCell*> > cells = m_cells2tt->caloCellsByLayer(Id);
1031 if(isTile == false && m_isLArHVCorrToolSet == false){return nNonNomHV;}
1032 if(isTile == false && m_isLArHVCorrToolSet == true){
1033 for(Itr_vvCaloCells i=cells.begin();i!=cells.end();++i){
1034 nNonNomHV.push_back( this->LArNonNominalHV( (*i) ) );
1035 }
1036 }
1037
1038 if(isTile == true){
1039 for(Itr_vvCaloCells i=cells.begin();i!=cells.end();++i){
1040 nNonNomHV.push_back( this->TileNonNominal( (*i) ) );
1041 }
1042 }
1043
1044 return nNonNomHV;
1045
1046 }
1047
1049 std::vector<std::vector<float> > nNonNomHV;
1050 Identifier Id = this->hadID(tt->eta(),tt->phi());
1051 bool isTile = m_lvl1Helper->is_tile(Id);
1052 if(isTile == false && m_isLArHVCorrToolSet == false){return nNonNomHV;}
1053 std::vector<unsigned int> rx = this->hadRxId(tt);
1054 std::vector<float> v1;
1055 std::vector<float> v2;
1056 std::vector<std::vector<const CaloCell*> > cells = m_cells2tt->caloCellsByLayer(Id);
1057 for(Itr_vvCaloCells i=cells.begin();i!=cells.end();++i){
1058 if ((*i).empty()) continue;
1059 if (rx.size() == 2) {
1060 std::vector<std::vector<const CaloCell*> > cellsRx = this->sortFCAL23Cells((*i),rx);
1061 for(Itr_vvCaloCells j=cellsRx.begin();j!=cellsRx.end();++j){
1062 if ((*j).empty()) continue;
1063 if (j == cellsRx.begin()) v1.push_back( (isTile == false) ? this->LArNonNominalHV((*j))
1064 : this->TileNonNominal((*j)));
1065 else v2.push_back( (isTile == false) ? this->LArNonNominalHV((*j))
1066 : this->TileNonNominal((*j)));
1067 }
1068 } else if (rx.size() == 1) v1.push_back( (isTile == false) ? this->LArNonNominalHV((*i))
1069 : this->TileNonNominal((*i)));
1070 }
1071 nNonNomHV.push_back(std::move(v1));
1072 if (rx.size() == 2) nNonNomHV.push_back(std::move(v2));
1073 return nNonNomHV;
1074 }
1075
1077
1078 Identifier Id = this->hadID(tt->eta(),tt->phi());
1079 bool isTile = m_lvl1Helper->is_tile(Id);
1080 if(isTile == true){return -9.9;}
1081
1082 if(m_isLArHVCorrToolSet == false){return -9.9;}
1083 std::vector<const CaloCell*> cells = m_cells2tt->caloCells(Id);
1084 return this->LArHVScale( cells );
1085
1086 }
1087
1089 std::vector<float> NonNomHV;
1090 Identifier Id = this->hadID(tt->eta(),tt->phi());
1091 bool isTile = m_lvl1Helper->is_tile(Id);
1092 if(isTile == true){return NonNomHV;}
1093
1094 if(m_isLArHVCorrToolSet == false){return NonNomHV;}
1095 std::vector<std::vector<const CaloCell*> > cells = m_cells2tt->caloCellsByLayer(Id);
1096
1097 for(Itr_vvCaloCells i=cells.begin();i!=cells.end();++i){
1098 NonNomHV.push_back( this->LArHVScale( (*i ) ) );
1099 }
1100 return NonNomHV;
1101 }
1102
1104
1105 std::vector<float> output;
1106 if(m_isLArHVCorrToolSet == false){return output;}
1107 std::vector<unsigned int> rx = this->hadRxId(tt);
1108 Identifier Id = this->hadID(tt->eta(),tt->phi());
1109
1110 bool isTile = m_lvl1Helper->is_tile(Id);
1111 if(isTile == true){return output;}
1112
1113 std::vector<const CaloCell*> cells = m_cells2tt->caloCells(Id);
1114
1115 if(rx.size() == 2){
1116 std::vector<std::vector<const CaloCell*> > vvcells = this->sortFCAL23Cells(cells,rx);
1117 for(Itr_vvCaloCells i=vvcells.begin();i!=vvcells.end();++i){
1118 output.push_back( this->LArHVScale( (*i) ) );
1119 }
1120 }
1121
1122 if(rx.size() == 1){
1123 output.push_back( this->LArHVScale( cells ) );
1124 }
1125
1126 return output;
1127
1128 }
1129
1131 std::vector<std::vector<float> > output;
1132 Identifier Id = this->hadID(tt->eta(),tt->phi());
1133 bool isTile = m_lvl1Helper->is_tile(Id);
1134 if(isTile == true || m_isLArHVCorrToolSet == false){return output;}
1135 std::vector<unsigned int> rx = this->hadRxId(tt);
1136 std::vector<float> v1;
1137 std::vector<float> v2;
1138 std::vector<std::vector<const CaloCell*> > cells = m_cells2tt->caloCellsByLayer(Id);
1139 for(Itr_vvCaloCells i=cells.begin();i!=cells.end();++i){
1140 if ((*i).empty()) continue;
1141 if (rx.size() == 2) {
1142 std::vector<std::vector<const CaloCell*> > cellsRx = this->sortFCAL23Cells((*i),rx);
1143 for(Itr_vvCaloCells j=cellsRx.begin();j!=cellsRx.end();++j){
1144 if ((*j).empty()) continue;
1145 if (j == cellsRx.begin()) v1.push_back(this->LArHVScale((*j)));
1146 else v2.push_back(this->LArHVScale((*j)));
1147 }
1148 } else if (rx.size() == 1) v1.push_back(this->LArHVScale((*i)));
1149 }
1150 output.push_back(std::move(v1));
1151 if (rx.size() == 2) output.push_back(std::move(v2));
1152 return output;
1153 }
1154
1155
1157 // Phase 1 SuperCells //
1159
1160 // EM
1162 Identifier Id = this->emID(tt->eta(),tt->phi());
1163 std::vector<const CaloCell*> cells = m_cells2tt->caloCells(Id);
1164 return this->SuperCellIdentifiers( cells );
1165 }
1166
1168 Identifier Id = this->hadID(tt->eta(),tt->phi());
1169 std::vector<const CaloCell*> cells = m_cells2tt->caloCells(Id);
1170 return this->SuperCellIdentifiers( cells );
1171 }
1172
1173 std::vector<int> L1CaloOfflineTriggerTowerTools::SuperCellIdentifiers(const std::vector<const CaloCell*> &cells) const{
1174 std::vector<int> output;
1175 std::map<int, std::vector<const CaloCell*> > sc_ids;
1176 for(Itr_vCaloCells i=cells.begin();i!=cells.end();++i){
1177 const CaloCell* cell = (*i);
1178 Identifier sCellID = m_scidtool->offlineToSuperCellID ( cell->ID() );
1179 sc_ids[sCellID.get_identifier32().get_compact()].push_back( cell );
1180 }
1181 for(std::map< int, std::vector<const CaloCell*> >::const_iterator i=sc_ids.begin();i!=sc_ids.end();++i){
1182 output.push_back( (*i).first );
1183 }
1184 return output;
1185 }
1186
1188 // Database Attributes //
1190
1191 // EM
1192
1193 const coral::AttributeList* L1CaloOfflineTriggerTowerTools::emDbAttributes(const TriggerTower* tt,const CondAttrListCollection* dbAttrList) const{
1194 unsigned int coolId = this->emCoolChannelId(tt);
1196 const coral::AttributeList* attrList = 0;
1197 for(Itr_db i=dbAttrList->begin();i!=dbAttrList->end();++i){
1198 if(i->first == coolId){
1199 attrList = &(i->second);
1200 break;
1201 }
1202 }
1203 return attrList;
1204 }
1205
1206
1207 std::vector<const coral::AttributeList*> L1CaloOfflineTriggerTowerTools::emDbRxGainsAttributes(const TriggerTower* tt,const CondAttrListCollection* dbAttrList) const {
1208
1209 std::vector<L1CaloRxCoolChannelId> rx = this->emReceivers(tt);
1210 std::vector<const coral::AttributeList*> v_attr;
1212 typedef std::vector<L1CaloRxCoolChannelId>::const_iterator Itr_Id;
1213
1214 for(Itr_Id a=rx.begin();a!=rx.end();++a){
1215 for(Itr_db i=dbAttrList->begin();i!=dbAttrList->end();++i){
1216 if(i->first == (*a).id()){
1217 v_attr.push_back( &(i->second) );
1218 }
1219 }
1220 }
1221 return v_attr;
1222 }
1223
1224 // Had
1225
1226 const coral::AttributeList* L1CaloOfflineTriggerTowerTools::hadDbAttributes(const TriggerTower* tt,const CondAttrListCollection* dbAttrList) const{
1227 unsigned int coolId = this->hadCoolChannelId(tt);
1229 const coral::AttributeList* attrList = 0;
1230 for(Itr_db i=dbAttrList->begin();i!=dbAttrList->end();++i){
1231 if(i->first == coolId){
1232 attrList = &(i->second);
1233 break;
1234 }
1235 }
1236 return attrList;
1237 }
1238
1239 std::vector<const coral::AttributeList*> L1CaloOfflineTriggerTowerTools::hadDbRxGainsAttributes(const TriggerTower* tt,const CondAttrListCollection* dbAttrList) const{
1240
1241 std::vector<L1CaloRxCoolChannelId> rx = this->hadReceivers(tt);
1242 std::vector<const coral::AttributeList*> v_attr;
1244 typedef std::vector<L1CaloRxCoolChannelId>::const_iterator Itr_Id;
1245
1246 for(Itr_Id a=rx.begin();a!=rx.end();++a){
1247 for(Itr_db i=dbAttrList->begin();i!=dbAttrList->end();++i){
1248 if(i->first == (*a).id()){
1249 v_attr.push_back( &(i->second) );
1250 }
1251 }
1252 }
1253 return v_attr;
1254 }
1255
1256
1257
1259 // Database Quantities //
1261
1262
1263 float L1CaloOfflineTriggerTowerTools::RxGain(const coral::AttributeList* attrList) const{
1264 float value = 0;
1265 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1266 if((*attrList)[attrNum].specification().name() == "gain"){
1267 value = (float) (*attrList)[attrNum].data<float>();
1268 break;
1269 }
1270 }
1271 return value;
1272 }
1273
1274 unsigned int L1CaloOfflineTriggerTowerTools::RxStatus(const coral::AttributeList* attrList) const{
1275 unsigned int value = 0;
1276 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1277 if((*attrList)[attrNum].specification().name() == "status"){
1278 value = (unsigned int) (*attrList)[attrNum].data<unsigned int>();
1279 break;
1280 }
1281 }
1282 return value;
1283 }
1284
1285
1286 unsigned int L1CaloOfflineTriggerTowerTools::ModuleId(const coral::AttributeList* attrList) const{
1287 unsigned int value = 0;
1288 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1289 if((*attrList)[attrNum].specification().name() == "ModuleId"){
1290 value = (unsigned int) (*attrList)[attrNum].data<unsigned int>();
1291 break;
1292 }
1293 }
1294 return value;
1295 }
1296
1297 unsigned int L1CaloOfflineTriggerTowerTools::ErrorCode(const coral::AttributeList* attrList) const{
1298 unsigned int value = 0;
1299 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1300 if((*attrList)[attrNum].specification().name() == "ErrorCode"){
1301 value = (unsigned int) (*attrList)[attrNum].data<unsigned int>();
1302 break;
1303 }
1304 }
1305 return value;
1306 }
1307
1308 unsigned long long L1CaloOfflineTriggerTowerTools::PprDacScanResultsTimeStamp(const coral::AttributeList* attrList) const{
1309 unsigned long long value = 0;
1310 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1311 if((*attrList)[attrNum].specification().name() == "PprDacScanResultsTimeStamp"){
1312 value = (unsigned long long) (*attrList)[attrNum].data<unsigned long long>();
1313 break;
1314 }
1315 }
1316 return value;
1317 }
1318
1319 unsigned long long L1CaloOfflineTriggerTowerTools::PprPedestalRunResultsTimeStamp(const coral::AttributeList* attrList) const{
1320 unsigned long long value = 0;
1321 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1322 if((*attrList)[attrNum].specification().name() == "PprPedestalRunResultsTimeStamp"){
1323 value = (unsigned long long) (*attrList)[attrNum].data<unsigned long long>();
1324 break;
1325 }
1326 }
1327 return value;
1328 }
1329
1330 unsigned long long L1CaloOfflineTriggerTowerTools::PprNoiseRunResultsTimeStamp(const coral::AttributeList* attrList) const{
1331 unsigned long long value = 0;
1332 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1333 if((*attrList)[attrNum].specification().name() == "PprNoiseRunResultsTimeStamp"){
1334 value = (unsigned long long) (*attrList)[attrNum].data<unsigned long long>();
1335 break;
1336 }
1337 }
1338 return value;
1339 }
1340
1341 unsigned long long L1CaloOfflineTriggerTowerTools::PprTimingResultsTimeStamp(const coral::AttributeList* attrList) const{
1342 unsigned long long value = 0;
1343 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1344 if((*attrList)[attrNum].specification().name() == "PprTimingResultsTimeStamp"){
1345 value = (unsigned long long) (*attrList)[attrNum].data<unsigned long long>();
1346 break;
1347 }
1348 }
1349 return value;
1350 }
1351
1352 unsigned long long L1CaloOfflineTriggerTowerTools::PprSatBcidResultsTimeStamp(const coral::AttributeList* attrList) const{
1353 unsigned long long value = 0;
1354 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1355 if((*attrList)[attrNum].specification().name() == "PprSatBcidResultsTimeStamp"){
1356 value = (unsigned long long) (*attrList)[attrNum].data<unsigned long long>();
1357 break;
1358 }
1359 }
1360 return value;
1361 }
1362
1363 unsigned long long L1CaloOfflineTriggerTowerTools::PprFirFilterResultsTimeStamp(const coral::AttributeList* attrList) const{
1364 unsigned long long value = 0;
1365 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1366 if((*attrList)[attrNum].specification().name() == "PprFirFilterResultsTimeStamp"){
1367 value = (unsigned long long) (*attrList)[attrNum].data<unsigned long long>();
1368 break;
1369 }
1370 }
1371 return value;
1372 }
1373
1374 unsigned long long L1CaloOfflineTriggerTowerTools::PprLutValuesResultsTimeStamp(const coral::AttributeList* attrList) const{
1375 unsigned long long value = 0;
1376 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1377 if((*attrList)[attrNum].specification().name() == "PprLutValuesResultsTimeStamp"){
1378 value = (unsigned long long) (*attrList)[attrNum].data<unsigned long long>();
1379 break;
1380 }
1381 }
1382 return value;
1383 }
1384
1385 double L1CaloOfflineTriggerTowerTools::DacOffset(const coral::AttributeList* attrList) const{
1386 double value = 0;
1387 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1388 if((*attrList)[attrNum].specification().name() == "DacOffset"){
1389 value = (double) (*attrList)[attrNum].data<double>();
1390 break;
1391 }
1392 }
1393 return value;
1394 }
1395
1396 double L1CaloOfflineTriggerTowerTools::DacSlope(const coral::AttributeList* attrList) const{
1397 double value = 0;
1398 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1399 if((*attrList)[attrNum].specification().name() == "DacSlope"){
1400 value = (double) (*attrList)[attrNum].data<double>();
1401 break;
1402 }
1403 }
1404 return value;
1405 }
1406
1407 double L1CaloOfflineTriggerTowerTools::PedMean(const coral::AttributeList* attrList) const{
1408 double value = 0;
1409 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1410 if((*attrList)[attrNum].specification().name() == "PedMean"){
1411 value = (double) (*attrList)[attrNum].data<double>();
1412 break;
1413 }
1414 }
1415 return value;
1416 }
1417
1418 unsigned int L1CaloOfflineTriggerTowerTools::PedValue(const coral::AttributeList* attrList) const{
1419 unsigned int value = 0;
1420 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1421 if((*attrList)[attrNum].specification().name() == "PedValue"){
1422 value = (unsigned int) (*attrList)[attrNum].data<unsigned int>();
1423 break;
1424 }
1425 }
1426 return value;
1427 }
1428
1429 unsigned int L1CaloOfflineTriggerTowerTools::FullDelayData(const coral::AttributeList* attrList) const{
1430 unsigned int value = 0;
1431 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1432 if((*attrList)[attrNum].specification().name() == "FullDelayData"){
1433 value = (unsigned int) (*attrList)[attrNum].data<unsigned int>();
1434 break;
1435 }
1436 }
1437 return value;
1438 }
1439
1440 unsigned short int L1CaloOfflineTriggerTowerTools::SyncDelayBcid(const coral::AttributeList* attrList) const{
1441 unsigned short int value = 0;
1442 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1443 if((*attrList)[attrNum].specification().name() == "SyncDelayBcid"){
1444 value = (unsigned short int) (*attrList)[attrNum].data<unsigned short int>();
1445 break;
1446 }
1447 }
1448 return value;
1449 }
1450
1451
1452 unsigned short int L1CaloOfflineTriggerTowerTools::InBcidNegedge(const coral::AttributeList* attrList) const{
1453 unsigned short int value = 0;
1454 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1455 if((*attrList)[attrNum].specification().name() == "InBcidNegedge"){
1456 value = (unsigned short int) (*attrList)[attrNum].data<unsigned short int>();
1457 break;
1458 }
1459 }
1460 return value;
1461 }
1462
1463
1464 unsigned short int L1CaloOfflineTriggerTowerTools::ExtBcidThreshold(const coral::AttributeList* attrList) const{
1465 unsigned short int value = 0;
1466 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1467 if((*attrList)[attrNum].specification().name() == "ExtBcidThreshold"){
1468 value = (unsigned short int) (*attrList)[attrNum].data<unsigned short int>();
1469 break;
1470 }
1471 }
1472 return value;
1473 }
1474
1475 unsigned short int L1CaloOfflineTriggerTowerTools::SatBcidThreshLow(const coral::AttributeList* attrList) const{
1476 unsigned short int value = 0;
1477 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1478 if((*attrList)[attrNum].specification().name() == "SatBcidThreshLow"){
1479 value = (unsigned short int) (*attrList)[attrNum].data<unsigned short int>();
1480 break;
1481 }
1482 }
1483 return value;
1484 }
1485
1486 unsigned short int L1CaloOfflineTriggerTowerTools::SatBcidThreshHigh(const coral::AttributeList* attrList) const{
1487 unsigned short int value = 0;
1488 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1489 if((*attrList)[attrNum].specification().name() == "SatBcidThreshHigh"){
1490 value = (unsigned short int) (*attrList)[attrNum].data<unsigned short int>();
1491 break;
1492 }
1493 }
1494 return value;
1495 }
1496
1497 unsigned short int L1CaloOfflineTriggerTowerTools::SatBcidLevel(const coral::AttributeList* attrList) const{
1498 unsigned short int value = 0;
1499 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1500 if((*attrList)[attrNum].specification().name() == "SatBcidLevel"){
1501 value = (unsigned short int) (*attrList)[attrNum].data<unsigned short int>();
1502 break;
1503 }
1504 }
1505 return value;
1506 }
1507
1508 unsigned short int L1CaloOfflineTriggerTowerTools::BcidEnergyRangeLow(const coral::AttributeList* attrList) const{
1509 unsigned short int value = 0;
1510 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1511 if((*attrList)[attrNum].specification().name() == "BcidEnergyRangeLow"){
1512 value = (unsigned short int) (*attrList)[attrNum].data<unsigned short int>();
1513 break;
1514 }
1515 }
1516 return value;
1517 }
1518
1519 unsigned short int L1CaloOfflineTriggerTowerTools::BcidEnergyRangeHigh(const coral::AttributeList* attrList) const{
1520 unsigned short int value = 0;
1521 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1522 if((*attrList)[attrNum].specification().name() == "BcidEnergyRangeHigh"){
1523 value = (unsigned short int) (*attrList)[attrNum].data<unsigned short int>();
1524 break;
1525 }
1526 }
1527 return value;
1528 }
1529
1530 unsigned short int L1CaloOfflineTriggerTowerTools::FirStartBit(const coral::AttributeList* attrList) const{
1531 unsigned short int value = 0;
1532 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1533 if((*attrList)[attrNum].specification().name() == "FirStartBit"){
1534 value = (unsigned short int) (*attrList)[attrNum].data<unsigned short int>();
1535 break;
1536 }
1537 }
1538 return value;
1539 }
1540
1541 short L1CaloOfflineTriggerTowerTools::FirCoeff1(const coral::AttributeList* attrList) const{
1542 short value = 0;
1543 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1544 if((*attrList)[attrNum].specification().name() == "FirCoeff1"){
1545 value = (short) (*attrList)[attrNum].data<short>();
1546 break;
1547 }
1548 }
1549 return value;
1550 }
1551
1552 short L1CaloOfflineTriggerTowerTools::FirCoeff2(const coral::AttributeList* attrList) const{
1553 short value = 0;
1554 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1555 if((*attrList)[attrNum].specification().name() == "FirCoeff2"){
1556 value = (short) (*attrList)[attrNum].data<short>();
1557 break;
1558 }
1559 }
1560 return value;
1561 }
1562
1563 short L1CaloOfflineTriggerTowerTools::FirCoeff3(const coral::AttributeList* attrList) const{
1564 short value = 0;
1565 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1566 if((*attrList)[attrNum].specification().name() == "FirCoeff3"){
1567 value = (short) (*attrList)[attrNum].data<short>();
1568 break;
1569 }
1570 }
1571 return value;
1572 }
1573
1574 short L1CaloOfflineTriggerTowerTools::FirCoeff4(const coral::AttributeList* attrList) const{
1575 short value = 0;
1576 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1577 if((*attrList)[attrNum].specification().name() == "FirCoeff4"){
1578 value = (short) (*attrList)[attrNum].data<short>();
1579 break;
1580 }
1581 }
1582 return value;
1583 }
1584
1585 short L1CaloOfflineTriggerTowerTools::FirCoeff5(const coral::AttributeList* attrList) const{
1586 short value = 0;
1587 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1588 if((*attrList)[attrNum].specification().name() == "FirCoeff5"){
1589 value = (short) (*attrList)[attrNum].data<short>();
1590 break;
1591 }
1592 }
1593 return value;
1594 }
1595
1596 unsigned short L1CaloOfflineTriggerTowerTools::LutStrategy(const coral::AttributeList* attrList) const{
1597 unsigned short value = 0;
1598 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1599 if((*attrList)[attrNum].specification().name() == "LutStrategy"){
1600 value = (unsigned short) (*attrList)[attrNum].data<unsigned short>();
1601 break;
1602 }
1603 }
1604 return value;
1605 }
1606
1607 unsigned short L1CaloOfflineTriggerTowerTools::LutOffset(const coral::AttributeList* attrList) const{
1608 unsigned short value = 0;
1609 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1610 if((*attrList)[attrNum].specification().name() == "LutOffset"){
1611 value = (unsigned short) (*attrList)[attrNum].data<unsigned short>();
1612 break;
1613 }
1614 }
1615 return value;
1616 }
1617
1618 unsigned short L1CaloOfflineTriggerTowerTools::LutSlope(const coral::AttributeList* attrList) const{
1619 unsigned short value = 0;
1620 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1621 if((*attrList)[attrNum].specification().name() == "LutSlope"){
1622 value = (unsigned short) (*attrList)[attrNum].data<unsigned short >();
1623 break;
1624 }
1625 }
1626 return value;
1627 }
1628
1629 unsigned short L1CaloOfflineTriggerTowerTools::LutNoiseCut(const coral::AttributeList* attrList) const{
1630 unsigned short value = 0;
1631 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1632 if((*attrList)[attrNum].specification().name() == "LutNoiseCut"){
1633 value = (unsigned short) (*attrList)[attrNum].data<unsigned short>();
1634 break;
1635 }
1636 }
1637 return value;
1638 }
1639
1640 // Disabled Tower in >= 2011 data
1641 // Should use the DB folder /TRIGGER/L1Calo/V1/Conditions/DisabledTowers
1642 unsigned int L1CaloOfflineTriggerTowerTools::DisabledTower(const coral::AttributeList* attrList) const{
1643 unsigned int value = 0;
1644 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1645 if((*attrList)[attrNum].specification().name() == "disabledBits"){
1646 value = (unsigned int) (*attrList)[attrNum].data<unsigned int>();
1647 break;
1648 }
1649 }
1650 return value;
1651 }
1652
1653 // Dead Channels in 2010 data
1654 // Should use the DB folder /TRIGGER/L1Calo/V1/Calibration/PpmDeadChannels
1655 unsigned int L1CaloOfflineTriggerTowerTools::DeadChannel(const coral::AttributeList* attrList) const{
1656 unsigned int value = 0;
1657 for(unsigned int attrNum=0;attrNum<attrList->size();attrNum++){
1658 if((*attrList)[attrNum].specification().name() == "ErrorCode"){
1659 value = (unsigned int) (*attrList)[attrNum].data<unsigned int>();
1660 break;
1661 }
1662 }
1663 return value;
1664 }
1665
1666
1667
1669 // Internals //
1671
1672
1674 ATH_CHECK( detStore()->retrieve(m_caloMgr) );
1675
1676 m_ttOnlineIdHelper = m_caloMgr->getTTOnlineID();
1677 if(!m_ttOnlineIdHelper){ATH_MSG_ERROR("Could not access TTOnlineId helper");return StatusCode::FAILURE;}
1678
1679 m_lvl1Helper = m_caloMgr->getLVL1_ID();
1680 if(!m_lvl1Helper){ATH_MSG_ERROR("Could not access CaloLVL1_ID helper");return StatusCode::FAILURE;}
1681
1682 ATH_CHECK( detStore()->retrieve(m_tileHWID) );
1683 ATH_CHECK( m_tileBadChanTool.retrieve() );
1684 ATH_CHECK( m_rxMapTool.retrieve() );
1685 ATH_CHECK( detStore()->retrieve(m_larOnlineID,"LArOnlineID") );
1686 ATH_CHECK( m_l1CaloTTIdTools.retrieve() );
1687 ATH_CHECK( m_cells2tt.retrieve() );
1688
1689 ATH_CHECK( detStore()->retrieve (m_caloMgr, "CaloIdManager") );
1690 ATH_CHECK( m_scidtool.retrieve() );
1691
1692 //Retrieve cabling & tt services
1693 ATH_CHECK( m_ttSvc.retrieve() );
1694
1695 ATH_CHECK( m_onlineScaleCorrKey.initialize() );
1696
1697 ATH_MSG_INFO("L1Calo L1CaloOfflineTriggerTowerTools initialize() success!");
1698 return StatusCode::SUCCESS;
1699 }
1700
1702 return StatusCode::SUCCESS;
1703 }
1704
1707 {
1708 m_scaleCorrKey = scaleCorrKey;
1709 m_cablingKey = cablingKey;
1710 m_isLArHVCorrToolSet = true;
1711 }
1712
1714 return m_l1CaloTTIdTools->pos_neg_z(eta);
1715 }
1716
1718 return m_l1CaloTTIdTools->regionIndex(eta);
1719 }
1720
1722 return m_l1CaloTTIdTools->etaIndex(eta);
1723 }
1724
1725 int L1CaloOfflineTriggerTowerTools::iphi(const double eta,const double phi) const{
1726 return m_l1CaloTTIdTools->phiIndex(eta,phi);
1727 }
1728
1729 Identifier L1CaloOfflineTriggerTowerTools::ID(const double eta,const double phi,int layer) const{
1730 return m_lvl1Helper->tower_id(this->pos_neg_z(eta),layer,this->region(eta),this->ieta(eta),this->iphi(eta,phi));
1731 }
1732
1733 Identifier L1CaloOfflineTriggerTowerTools::emID(const double eta,const double phi) const{
1734 return m_lvl1Helper->tower_id(this->pos_neg_z(eta),0,this->region(eta),this->ieta(eta),this->iphi(eta,phi));
1735 }
1736
1738 return m_lvl1Helper->tower_id(this->pos_neg_z(eta),1,this->region(eta),this->ieta(eta),this->iphi(eta,phi));
1739 }
1740
1742 m_cells2tt->initCaloCellsTriggerTowers(*cells);
1743 }
1744
1745} // 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:148
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...