ATLAS Offline Software
Loading...
Searching...
No Matches
L1CaloxAODOfflineTriggerTowerTools.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// Like it says above, please chop up this code until it does what you want !
10
13
14#include <algorithm> // for std::transform
15#include <iterator> // for std::back_inserter
16#include <utility> // for std::move
17
18namespace LVL1{
19
21 asg::AsgTool( name ),
22 m_l1CaloTTIdTools("LVL1::L1CaloTTIdTools/L1CaloTTIdTools"),
23 m_rxMapTool("LVL1::L1CaloFcal23Cells2RxMappingTool/L1CaloFcal23Cells2RxMappingTool"),
24 m_caloMgr(nullptr),
25 m_lvl1Helper(nullptr),
26 m_ttSvc("CaloTriggerTowerService"),
27 m_dbPpmChanCalib(nullptr)
28 {
29 }
30
31 StatusCode
33 {
34 ATH_MSG_INFO("initialize LVL1::L1CaloxAODOfflineTriggerTowerTools");
35
36 // Get the L1CaloCells2TriggerTowers Tool
37 CHECK( m_cells2tt.retrieve() );
38
39 // Get the L1CaloTTIdTools Tool
40 CHECK( m_l1CaloTTIdTools.retrieve() );
41
42 // Get the Fcal23 mapping tool
43 CHECK( m_rxMapTool.retrieve() );
44
45 CHECK( detStore()->retrieve ( m_caloMgr, "CaloIdManager") );
46 m_lvl1Helper = m_caloMgr->getLVL1_ID();
47
48 //Retrieve cabling & tt services
49 CHECK( m_ttSvc.retrieve() );
50
51 CHECK( m_caloCellContainerKey.initialize() );
52
53 // Return gracefully:
54 return StatusCode::SUCCESS;
55 }
56
57 StatusCode
59 {
60 ATH_MSG_INFO("finalize LVL1::L1CaloxAODOfflineTriggerTowerTools");
61 // Return gracefully:
62 return StatusCode::SUCCESS;
63 }
64
66 StatusCode
68 {
70 m_cells2tt->initCaloCellsTriggerTowers( *cells );
71
72 // Return gracefully:
73 return StatusCode::SUCCESS;
74 }
75
76 std::vector<L1CaloRxCoolChannelId>
78 {
79 std::vector<L1CaloRxCoolChannelId> rx = m_ttSvc->cnvCoolChannelIdToRxId( tt.coolId() );
80 std::vector<L1CaloRxCoolChannelId> output;
81
82 // EM
83 if (tt.sampling() == 0) {
84 // Sort EM Crack recievers. End cap first, barrel second
85 if (rx.size() == 3) {
86
87 // For the EM crack region, there are 3 recievers.
88 // 1 Rx have Crate 0 or 1 - correspond to the barrel before the Octopus cable magic - ignore
89 // 2 Rx have Crate 2 or 3 - correspond to the Rx we want:
90 // 1 Rx has inputConn() == 0 - EMEC receiver
91 // 1 Rx has inputConn() == 2 - Barrel receiver
92
93 std::vector<L1CaloRxCoolChannelId> rx2;
94 for (const auto& i : rx) {
95 if (i.crate() == 2 || i.crate() == 3) {
96 rx2.push_back( i );
97 }
98 }
99
100 if (rx2.size() == 2) {
101
102 unsigned int inputA = rx2.at(0).inputConn();
103 unsigned int inputB = rx2.at(1).inputConn();
104
105 // End cap first, barrel second
106 if (inputA == 2 && inputB == 0) {
107 output.push_back(rx2.at(1));
108 output.push_back(rx2.at(0));
109 }
110 if (inputA == 0 && inputB == 2) {
111 output.push_back(rx2.at(0));
112 output.push_back(rx2.at(1));
113 }
114 }
115 }
116
117 if (rx.size() == 1) {
118 output.push_back( rx.at(0) );
119 }
120
121 } // end EM
122
123 // Had
124 if (tt.sampling() == 1) {
125 // Sort FCAL 23 recievers. Always have -ve eta first and +ve eta second
126 if (rx.size() == 2) {
127 // Odd receiver is lowest |eta|
128 unsigned int inputPairA = rx.at(0).inputPair();
129 unsigned int inputPairB = rx.at(1).inputPair();
130
131 bool oddA(false),oddB(false);
132 if(inputPairA % 2 != 0){oddA = true;}
133 if(inputPairB % 2 != 0){oddB = true;}
134
135 if (oddA && !oddB) {
136 output.push_back(rx.at(0));
137 output.push_back(rx.at(1));
138 }
139 if (!oddA && oddB) {
140 output.push_back(rx.at(1));
141 output.push_back(rx.at(0));
142 }
143 }
144 if (rx.size() == 1) {
145 output.push_back( rx.at(0) );
146 }
147 } // end Had
148
149 return output;
150 }
151
152 std::vector<unsigned int>
154 {
155 std::vector<L1CaloRxCoolChannelId> rx = receivers( tt );
156 std::vector<unsigned int> output;
157 output.reserve(rx.size());
158 for (const auto& i : rx) {
159 output.push_back( i.id() );
160 }
161 return output;
162 }
163
164
165 unsigned int
167 {
168 Identifier id = towerID( tt );
169 if (m_lvl1Helper->is_tile( id )) {
170 return 1;
171 }
172 return 0;
173 }
174
175
176 std::vector<const CaloCell*>
178 {
179 Identifier id = towerID( tt );
180 return m_cells2tt->caloCells( id );
181 }
182
183 unsigned int
185 {
186 return getCaloCells( tt ).size();
187 }
188
189 std::vector<unsigned int>
191 {
192 std::vector<unsigned int> output;
193 Identifier id = towerID( tt );
194 std::vector<std::vector<const CaloCell*>> cells = m_cells2tt->caloCellsByLayer( id );
195 output.reserve(cells.size());
196 for (const auto& i : cells) {
197 output.push_back( i.size() );
198 }
199 return output;
200 }
201
202// std::vector<unsigned int>
203// L1CaloxAODOfflineTriggerTowerTools::nCaloCellsByReceiver( const xAOD::TriggerTower& tt ) const
204// {
205// std::vector<unsigned int> output;
206// return output;
207// }
208//
209// std::vector<unsigned int>
210// L1CaloxAODOfflineTriggerTowerTools::nCaloCellsByReceiverByLayer( const xAOD::TriggerTower& tt ) const
211// {
212// std::vector<unsigned int> output;
213// return output;
214// }
215
216
217 float
219 {
220 Identifier id = towerID( tt );
221 return m_cells2tt->energy( id );
222 }
223
224 float
226 {
227 Identifier id = towerID( tt );
228 return m_cells2tt->et( id );
229 }
230
231 std::vector<float>
233 {
234 std::vector<float> output;
235 Identifier id = towerID( tt );
236 std::vector<std::vector<const CaloCell*>> cells = m_cells2tt->caloCellsByLayer( id );
237 output.reserve(cells.size());
238 for (const auto& i : cells) {
239 output.push_back( m_cells2tt->energy( i ) );
240 }
241 return output;
242 }
243
244 std::vector<float>
246 {
247 std::vector<float> output;
248 Identifier id = towerID( tt );
249 std::vector<std::vector<const CaloCell*>> cells = m_cells2tt->caloCellsByLayer( id );
250 output.reserve(cells.size());
251 for (const auto& i : cells) {
252 output.push_back( m_cells2tt->et( i ) );
253 }
254 return output;
255 }
256
257 std::vector<std::vector<const CaloCell*>>
259 {
260 std::vector<std::vector<const CaloCell*>> output;
261 const auto& rx = receivers(tt);
262 if (rx.size() == 1) {
263 output = { getCaloCells(tt) };
264 } else if(rx.size() == 2) {
265 output = ((tt.layer() == 0) ? sortEMCrackCells(getCaloCells(tt)) : sortFCAL23Cells(getCaloCells(tt), rx));
266 } else {
267 // shouldn't happen ... non-critical code, warning is sufficient
268 ATH_MSG_WARNING("Found TT with " << rx.size() << " receivers!");
269 }
270 return output;
271 }
272
273 std::vector<float>
275 {
276 using std::begin;
277 using std::end;
278 using std::back_inserter;
279
280 std::vector<float> energyByReceiver;
281 const auto& cellsByReceiver = caloCellsByReceiver(tt);
282 std::transform(begin(cellsByReceiver), end(cellsByReceiver),
283 back_inserter(energyByReceiver),
284 [this](const std::vector<const CaloCell*>& c) -> float {
285 return m_cells2tt->energy( c );
286 });
287
288 return energyByReceiver;
289 }
290
291 std::vector<float>
293 {
294 using std::begin;
295 using std::end;
296 using std::back_inserter;
297
298 std::vector<float> etByReceiver;
299 const auto& cellsByReceiver = caloCellsByReceiver(tt);
300 std::transform(begin(cellsByReceiver), end(cellsByReceiver),
301 back_inserter(etByReceiver),
302 [this](const std::vector<const CaloCell*>& c) -> float {
303 return m_cells2tt->et( c );
304 });
305
306 return etByReceiver;
307 }
308
309 std::vector<std::vector<std::vector<const CaloCell*>>>
311 {
312 using std::begin;
313 using std::end;
314 using std::back_inserter;
315 using std::vector;
316
318 const auto& rx = receivers(tt);
319 if(rx.size() == 1) {
320 const auto& cellsByLayer = m_cells2tt->caloCellsByLayer(towerID(tt));
321 std::transform(begin(cellsByLayer), end(cellsByLayer),
322 back_inserter(output),
324 return {std::move(C)};
325 });
326 } else if(rx.size() == 2) {
327 Identifier id = towerID( tt );
328 const auto& cellsByLayer = m_cells2tt->caloCellsByLayer( id );
329 for(const auto& cells : cellsByLayer) {
330 const auto& cellsByReceiver = ((tt.layer() == 0) ? sortEMCrackCells(cells) : sortFCAL23Cells(cells, rx));
331 output.push_back(cellsByReceiver);
332 }
333 } else {
334 ATH_MSG_WARNING("Found TT with " << rx.size() << " receivers!");
335 }
336
337 return output;
338 }
339
340 std::vector<std::vector<float>>
342 {
343 using std::begin;
344 using std::end;
345 using std::back_inserter;
346
347 std::vector<std::vector<float>> output;
348 for(const auto& cellsByReceiver : caloCellsByLayerByReceiver(tt)) {
349 std::vector<float> cellsEnergyByReceiver;
350 cellsEnergyByReceiver.reserve(cellsByReceiver.size());
351 for(const auto& cells : cellsByReceiver) {
352 cellsEnergyByReceiver.push_back(m_cells2tt->energy(cells));
353 }
354 output.push_back(std::move(cellsEnergyByReceiver));
355 }
356
357 return output;
358 }
359
360
361 std::vector<std::vector<float>>
363 {
364 using std::begin;
365 using std::end;
366 using std::back_inserter;
367
368 std::vector<std::vector<float>> output;
369 for(const auto& cellsByReceiver : caloCellsByLayerByReceiver(tt)) {
370 std::vector<float> cellsEnergyByReceiver;
371 cellsEnergyByReceiver.reserve(cellsByReceiver.size());
372 for(const std::vector<const CaloCell*>& cells : cellsByReceiver) {
373 cellsEnergyByReceiver.push_back(m_cells2tt->et(cells));
374 }
375 output.push_back(std::move(cellsEnergyByReceiver));
376 }
377
378 return output;
379 }
380
381
382//
383//
384// unsigned int
385// L1CaloxAODOfflineTriggerTowerTools::badCaloCells( const xAOD::TriggerTower& tt ) const
386// {
387//
388// return 0;
389// }
390
391 float
393 {
394 float output(-999.9);
395 std::vector<const CaloCell*> cells = getCaloCells( tt );
396 if (isTile( tt )) {
397 output = TileCaloQuality( cells );
398 }
399 else {
400 output = LArCaloQuality( cells );
401 }
402 return output;
403 }
404
405 float
406 L1CaloxAODOfflineTriggerTowerTools::LArCaloQuality( const std::vector<const CaloCell*> &cells ) const
407 {
408 float nom(0.), denom(0.);
409 for (auto i : cells) {
410 if ((i)->provenance() & 0x2000) {
411 nom += ((i)->e() * (i)->quality());
412 denom += (i)->e();
413 }
414 }
415
416 if (denom != 0.) {
417 nom /= denom;
418 }
419 else {
420 nom = -1e6; // error value
421 }
422 return nom;
423 }
424
425 float
426 L1CaloxAODOfflineTriggerTowerTools::TileCaloQuality( const std::vector<const CaloCell*> &cells ) const
427 {
428 float nom(0.), denom(0.);
429 for (auto i : cells) {
430 const TileCell *tileCell = dynamic_cast<const TileCell*>( (i) );
431
432 if (tileCell && tileCell->provenance() & 0x8080) {
433 nom += tileCell->e() * std::max(tileCell->qual1(), tileCell->qual2());
434 denom += tileCell->e();
435 }
436 }
437
438 if (denom != 0.) {
439 nom /= denom;
440 }
441 else {
442 nom = -1e6; // error value
443 }
444 return nom;
445 }
446
447
448//
449// float
450// L1CaloxAODOfflineTriggerTowerTools::nCaloCellsNonNominal( const xAOD::TriggerTower& tt ) const
451// {
452// return 0;
453// }
454//
455// std::vector<float>
456// L1CaloxAODOfflineTriggerTowerTools::nCaloCellsNonNominalByLayer( const xAOD::TriggerTower& tt ) const
457// {
458// std::vector<float> output;
459// return output;
460// }
461//
462// std::vector<std::vector<float>>
463// L1CaloxAODOfflineTriggerTowerTools::nCaloCellsNonNominalByReceiverByLayer( const xAOD::TriggerTower& tt ) const
464// {
465// std::vector<std::vector<float>> output;
466// return output;
467// }
468//
469// float
470// L1CaloxAODOfflineTriggerTowerTools::nonNominalMeanScale( const xAOD::TriggerTower& tt ) const
471// {
472// return 0;
473// }
474//
475// std::vector<float>
476// L1CaloxAODOfflineTriggerTowerTools::nonNominalMeanScaleByLayer( const xAOD::TriggerTower& tt ) const
477// {
478// std::vector<float> output;
479// return output;
480// }
481//
482// std::vector<float>
483// L1CaloxAODOfflineTriggerTowerTools::nonNominalMeanScaleByReceiver( const xAOD::TriggerTower& tt ) const
484// {
485// std::vector<float> output;
486// return output;
487// }
488//
489// std::vector<std::vector<float>>
490// L1CaloxAODOfflineTriggerTowerTools::nonNominalMeanScaleByReceiverByLayer( const xAOD::TriggerTower& tt ) const
491// {
492// std::vector<std::vector<float>> output;
493// return output;
494// }
495
496 // Sort Calo Cells
497 std::vector<std::vector<const CaloCell*>>
498 L1CaloxAODOfflineTriggerTowerTools::sortEMCrackCells(const std::vector<const CaloCell*> &cells) const
499 {
500 std::vector<std::vector<const CaloCell*>> output;
501 std::vector<const CaloCell*> emb;
502 std::vector<const CaloCell*> emec;
503
504 // End Cap first, Barrel second
505
506 for( auto i : cells ){
507 int layer = m_cells2tt->layerNames(i);
508
509 if( layer <= 3){
510 emb.push_back( (i) );
511 }
512 if( layer >= 4){
513 emec.push_back( (i) );
514 }
515 }
516
517 output.push_back(std::move(emec));
518 output.push_back(std::move(emb));
519 return output;
520 }
521
522 std::vector<std::vector<const CaloCell*>>
523 L1CaloxAODOfflineTriggerTowerTools::sortFCAL23Cells(const std::vector<const CaloCell*> &cells,const std::vector<L1CaloRxCoolChannelId>& rx) const
524 {
525 // vectors of calo cells for the different receivers
526 std::vector<const CaloCell*> cellsA;
527 std::vector<const CaloCell*> cellsB;
528 // output
529 std::vector<std::vector<const CaloCell*>> output;
530
531 // RxID of the different receivers
532 unsigned int rxidA = rx.at(0).id();
533 unsigned int rxidB = rx.at(1).id();
534
535 // Loop over calo cells and use mapping tool to assign cells to different receivers
536 for( auto i : cells ){
537 unsigned int someRxId = m_rxMapTool->offlineCell2RxId( (i)->ID().get_identifier32().get_compact() );
538 if(someRxId == rxidA){cellsA.push_back(i);}
539 if(someRxId == rxidB){cellsB.push_back(i);}
540 }
541 output.push_back(std::move(cellsA));
542 output.push_back(std::move(cellsB));
543 return output;
544 }
545
546
547 // Database Attributes
548 const coral::AttributeList*
550 {
552 const coral::AttributeList* attrList(nullptr);
553 for(Itr_db i=dbAttrList->begin();i!=dbAttrList->end();++i){
554 if( i->first == tt.coolId() ){
555 attrList = &(i->second);
556 break;
557 }
558 }
559 return attrList;
560 }
561
562 std::vector<const coral::AttributeList*>
564 {
566 std::vector<const coral::AttributeList*> v_attr;
567 std::vector<unsigned int> rxID = receiversId( tt );
568 for( auto r : rxID ){
569 for(Itr_db i=dbAttrList->begin();i!=dbAttrList->end();++i){
570 if( i->first == r ){
571 v_attr.push_back( &(i->second) );
572 break;
573 }
574 }
575 }
576 return v_attr;
577 }
578
579
580 // Database access
581 unsigned int
583 {
584 const coral::AttributeList* attrList = DbAttributes( tt , m_dbPpmChanCalib );
585 unsigned int value = 0;
586 for(unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
587 if((*attrList)[attrNum].specification().name() == "ModuleId"){
588 value = (unsigned int) (*attrList)[attrNum].data<unsigned int>();
589 break;
590 }
591 }
592 return value;
593 }
594
595 unsigned int
597 {
598 const coral::AttributeList* attrList = DbAttributes( tt , m_dbPpmChanCalib );
599 unsigned int value = 0;
600 for(unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
601 if((*attrList)[attrNum].specification().name() == "ErrorCode"){
602 value = (unsigned int) (*attrList)[attrNum].data<unsigned int>();
603 break;
604 }
605 }
606 return value;
607 }
608
609 unsigned long long
611 {
612 const coral::AttributeList* attrList = DbAttributes( tt , m_dbPpmChanCalib );
613 unsigned long long value = 0;
614 for(unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
615 if((*attrList)[attrNum].specification().name() == "PprDacScanResultsTimeStamp"){
616 value = (unsigned long long) (*attrList)[attrNum].data<unsigned long long>();
617 break;
618 }
619 }
620 return value;
621 }
622
623 unsigned long long
625 {
626 const coral::AttributeList* attrList = DbAttributes( tt , m_dbPpmChanCalib );
627 unsigned long long value = 0;
628 for(unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
629 if((*attrList)[attrNum].specification().name() == "PprPedestalRunResultsTimeStamp"){
630 value = (unsigned long long) (*attrList)[attrNum].data<unsigned long long>();
631 break;
632 }
633 }
634 return value;
635 }
636
637 unsigned long long
639 {
640 const coral::AttributeList* attrList = DbAttributes( tt , m_dbPpmChanCalib );
641 unsigned long long value = 0;
642 for(unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
643 if((*attrList)[attrNum].specification().name() == "PprNoiseRunResultsTimeStamp"){
644 value = (unsigned long long) (*attrList)[attrNum].data<unsigned long long>();
645 break;
646 }
647 }
648 return value;
649 }
650
651 unsigned long long
653 {
654 const coral::AttributeList* attrList = DbAttributes( tt , m_dbPpmChanCalib );
655 unsigned long long value = 0;
656 for(unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
657 if((*attrList)[attrNum].specification().name() == "PprTimingResultsTimeStamp"){
658 value = (unsigned long long) (*attrList)[attrNum].data<unsigned long long>();
659 break;
660 }
661 }
662 return value;
663 }
664
665 unsigned long long
667 {
668 const coral::AttributeList* attrList = DbAttributes( tt , m_dbPpmChanCalib );
669 unsigned long long value = 0;
670 for(unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
671 if((*attrList)[attrNum].specification().name() == "PprSatBcidResultsTimeStamp"){
672 value = (unsigned long long) (*attrList)[attrNum].data<unsigned long long>();
673 break;
674 }
675 }
676 return value;
677 }
678
679 unsigned long long
681 {
682 const coral::AttributeList* attrList = DbAttributes( tt , m_dbPpmChanCalib );
683 unsigned long long value = 0;
684 for(unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
685 if((*attrList)[attrNum].specification().name() == "PprFirFilterResultsTimeStamp"){
686 value = (unsigned long long) (*attrList)[attrNum].data<unsigned long long>();
687 break;
688 }
689 }
690 return value;
691 }
692
693 unsigned long long
695 {
696 const coral::AttributeList* attrList = DbAttributes( tt , m_dbPpmChanCalib );
697 unsigned long long value = 0;
698 for(unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
699 if((*attrList)[attrNum].specification().name() == "PprLutValuesResultsTimeStamp"){
700 value = (unsigned long long) (*attrList)[attrNum].data<unsigned long long>();
701 break;
702 }
703 }
704 return value;
705 }
706
707 double
709 {
710 const coral::AttributeList* attrList = DbAttributes( tt , m_dbPpmChanCalib );
711 double value = 0;
712 for(unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
713 if((*attrList)[attrNum].specification().name() == "DacOffset"){
714 value = (double) (*attrList)[attrNum].data<double>();
715 break;
716 }
717 }
718 return value;
719 }
720
721 double
723 {
724 const coral::AttributeList* attrList = DbAttributes( tt , m_dbPpmChanCalib );
725 double value = 0;
726 for(unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
727 if((*attrList)[attrNum].specification().name() == "DacSlope"){
728 value = (double) (*attrList)[attrNum].data<double>();
729 break;
730 }
731 }
732 return value;
733 }
734
735 double
737 {
738 const coral::AttributeList* attrList = DbAttributes( tt , m_dbPpmChanCalib );
739 double value = 0;
740 for(unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
741 if((*attrList)[attrNum].specification().name() == "PedMean"){
742 value = (double) (*attrList)[attrNum].data<double>();
743 break;
744 }
745 }
746 return value;
747 }
748
749 unsigned int
751 {
752 const coral::AttributeList* attrList = DbAttributes( tt , m_dbPpmChanCalib );
753 unsigned int value = 0;
754 for(unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
755 if((*attrList)[attrNum].specification().name() == "PedValue"){
756 value = (unsigned int) (*attrList)[attrNum].data<unsigned int>();
757 break;
758 }
759 }
760 return value;
761 }
762
763 unsigned int
765 {
766 const coral::AttributeList* attrList = DbAttributes( tt , m_dbPpmChanCalib );
767 unsigned int value = 0;
768 for(unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
769 if((*attrList)[attrNum].specification().name() == "FullDelayData"){
770 value = (unsigned int) (*attrList)[attrNum].data<unsigned int>();
771 break;
772 }
773 }
774 return value;
775 }
776
777 unsigned short int
779 {
780 const coral::AttributeList* attrList = DbAttributes( tt , m_dbPpmChanCalib );
781 unsigned short int value = 0;
782 for(unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
783 if((*attrList)[attrNum].specification().name() == "SyncDelayBcid"){
784 value = (unsigned short int) (*attrList)[attrNum].data<unsigned short int>();
785 break;
786 }
787 }
788 return value;
789 }
790
791 unsigned short int
793 {
794 const coral::AttributeList* attrList = DbAttributes( tt , m_dbPpmChanCalib );
795 unsigned short int value = 0;
796 for(unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
797 if((*attrList)[attrNum].specification().name() == "InBcidNegedge"){
798 value = (unsigned short int) (*attrList)[attrNum].data<unsigned short int>();
799 break;
800 }
801 }
802 return value;
803 }
804
805 unsigned short int
807 {
808 const coral::AttributeList* attrList = DbAttributes( tt , m_dbPpmChanCalib );
809 unsigned short int value = 0;
810 for(unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
811 if((*attrList)[attrNum].specification().name() == "ExtBcidThreshold"){
812 value = (unsigned short int) (*attrList)[attrNum].data<unsigned short int>();
813 break;
814 }
815 }
816 return value;
817 }
818
819 unsigned short int
821 {
822 const coral::AttributeList* attrList = DbAttributes( tt , m_dbPpmChanCalib );
823 unsigned short int value = 0;
824 for(unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
825 if((*attrList)[attrNum].specification().name() == "SatBcidThreshLow"){
826 value = (unsigned short int) (*attrList)[attrNum].data<unsigned short int>();
827 break;
828 }
829 }
830 return value;
831 }
832
833 unsigned short int
835 {
836 const coral::AttributeList* attrList = DbAttributes( tt , m_dbPpmChanCalib );
837 unsigned short int value = 0;
838 for(unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
839 if((*attrList)[attrNum].specification().name() == "SatBcidThreshHigh"){
840 value = (unsigned short int) (*attrList)[attrNum].data<unsigned short int>();
841 break;
842 }
843 }
844 return value;
845 }
846
847 unsigned short int
849 {
850 const coral::AttributeList* attrList = DbAttributes( tt , m_dbPpmChanCalib );
851 unsigned short int value = 0;
852 for(unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
853 if((*attrList)[attrNum].specification().name() == "SatBcidLevel"){
854 value = (unsigned short int) (*attrList)[attrNum].data<unsigned short int>();
855 break;
856 }
857 }
858 return value;
859 }
860
861 unsigned short int
863 {
864 const coral::AttributeList* attrList = DbAttributes( tt , m_dbPpmChanCalib );
865 unsigned short int value = 0;
866 for(unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
867 if((*attrList)[attrNum].specification().name() == "BcidEnergyRangeLow"){
868 value = (unsigned short int) (*attrList)[attrNum].data<unsigned short int>();
869 break;
870 }
871 }
872 return value;
873 }
874
875 unsigned short int
877 {
878 const coral::AttributeList* attrList = DbAttributes( tt , m_dbPpmChanCalib );
879 unsigned short int value = 0;
880 for(unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
881 if((*attrList)[attrNum].specification().name() == "BcidEnergyRangeHigh"){
882 value = (unsigned short int) (*attrList)[attrNum].data<unsigned short int>();
883 break;
884 }
885 }
886 return value;
887 }
888
889 unsigned short int
891 {
892 const coral::AttributeList* attrList = DbAttributes( tt , m_dbPpmChanCalib );
893 unsigned short int value = 0;
894 for(unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
895 if((*attrList)[attrNum].specification().name() == "FirStartBit"){
896 value = (unsigned short int) (*attrList)[attrNum].data<unsigned short int>();
897 break;
898 }
899 }
900 return value;
901 }
902
903 short
905 {
906 const coral::AttributeList* attrList = DbAttributes( tt , m_dbPpmChanCalib );
907 short value = 0;
908 for(unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
909 if((*attrList)[attrNum].specification().name() == "FirCoeff1"){
910 value = (short) (*attrList)[attrNum].data<short>();
911 break;
912 }
913 }
914 return value;
915 }
916
917 short
919 {
920 const coral::AttributeList* attrList = DbAttributes( tt , m_dbPpmChanCalib );
921 short value = 0;
922 for(unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
923 if((*attrList)[attrNum].specification().name() == "FirCoeff2"){
924 value = (short) (*attrList)[attrNum].data<short>();
925 break;
926 }
927 }
928 return value;
929 }
930
931 short
933 {
934 const coral::AttributeList* attrList = DbAttributes( tt , m_dbPpmChanCalib );
935 short value = 0;
936 for(unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
937 if((*attrList)[attrNum].specification().name() == "FirCoeff3"){
938 value = (short) (*attrList)[attrNum].data<short>();
939 break;
940 }
941 }
942 return value;
943 }
944
945 short
947 {
948 const coral::AttributeList* attrList = DbAttributes( tt , m_dbPpmChanCalib );
949 short value = 0;
950 for(unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
951 if((*attrList)[attrNum].specification().name() == "FirCoeff4"){
952 value = (short) (*attrList)[attrNum].data<short>();
953 break;
954 }
955 }
956 return value;
957 }
958
959 short
961 {
962 const coral::AttributeList* attrList = DbAttributes( tt , m_dbPpmChanCalib );
963 short value = 0;
964 for(unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
965 if((*attrList)[attrNum].specification().name() == "FirCoeff5"){
966 value = (short) (*attrList)[attrNum].data<short>();
967 break;
968 }
969 }
970 return value;
971 }
972
973 unsigned short
975 {
976 const coral::AttributeList* attrList = DbAttributes( tt , m_dbPpmChanCalib );
977 unsigned short value = 0;
978 for(unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
979 if((*attrList)[attrNum].specification().name() == "LutStrategy"){
980 value = (unsigned short) (*attrList)[attrNum].data<unsigned short>();
981 break;
982 }
983 }
984 return value;
985 }
986
987 unsigned short
989 {
990 const coral::AttributeList* attrList = DbAttributes( tt , m_dbPpmChanCalib );
991 unsigned short value = 0;
992 for(unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
993 if((*attrList)[attrNum].specification().name() == "LutOffset"){
994 value = (unsigned short) (*attrList)[attrNum].data<unsigned short>();
995 break;
996 }
997 }
998 return value;
999 }
1000
1001 unsigned short
1003 {
1004 const coral::AttributeList* attrList = DbAttributes( tt , m_dbPpmChanCalib );
1005 unsigned short value = 0;
1006 for(unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
1007 if((*attrList)[attrNum].specification().name() == "LutNoiseCut"){
1008 value = (unsigned short) (*attrList)[attrNum].data<unsigned short>();
1009 break;
1010 }
1011 }
1012 return value;
1013 }
1014
1015 unsigned short
1017 {
1018 const coral::AttributeList* attrList = DbAttributes( tt , m_dbPpmChanCalib );
1019 unsigned short value = 0;
1020 for(unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
1021 if((*attrList)[attrNum].specification().name() == "LutSlope"){
1022 value = (unsigned short) (*attrList)[attrNum].data<unsigned short >();
1023 break;
1024 }
1025 }
1026 return value;
1027 }
1028
1029
1030 unsigned int
1032 {
1033 const coral::AttributeList* attrList = DbAttributes( tt , m_dbPpmChanCalib );
1034 unsigned int value = 0;
1035 for(unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
1036 if((*attrList)[attrNum].specification().name() == "disabledBits"){
1037 value = (unsigned int) (*attrList)[attrNum].data<unsigned int>();
1038 break;
1039 }
1040 }
1041 return value;
1042 }
1043
1044 unsigned int
1046 {
1047 const coral::AttributeList* attrList = DbAttributes( tt , m_dbPpmChanCalib );
1048 unsigned int value = 0;
1049 for(unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
1050 if((*attrList)[attrNum].specification().name() == "ErrorCode"){
1051 value = (unsigned int) (*attrList)[attrNum].data<unsigned int>();
1052 break;
1053 }
1054 }
1055 return value;
1056 }
1057
1058
1059 float
1061 {
1062 float value = 0;
1063// for(unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
1064// if((*attrList)[attrNum].specification().name() == "gain"){
1065// value = (float) (*attrList)[attrNum].data<float>();
1066// break;
1067// }
1068// }
1069 return value;
1070 }
1071
1072 unsigned int
1074 {
1075 unsigned int value = 0;
1076// for(unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
1077// if((*attrList)[attrNum].specification().name() == "status"){
1078// value = (unsigned int) (*attrList)[attrNum].data<unsigned int>();
1079// break;
1080// }
1081// }
1082 return value;
1083 }
1084
1087 {
1088 return m_lvl1Helper->tower_id( pos_neg_z(tt) , tt.sampling() , region(tt) , ieta(tt) , iphi(tt) );
1089 }
1090
1091 int
1093 {
1094 return m_l1CaloTTIdTools->pos_neg_z( tt.eta() );
1095 }
1096
1097 int
1099 {
1100 return m_l1CaloTTIdTools->regionIndex( tt.eta() );
1101 }
1102
1103 int
1105 {
1106 return m_l1CaloTTIdTools->etaIndex( tt.eta() );
1107 }
1108
1109 int
1111 {
1112 return m_l1CaloTTIdTools->phiIndex( tt.eta() , tt.phi() );
1113 }
1114
1115}
#define ATH_MSG_INFO(x)
#define ATH_MSG_WARNING(x)
std::vector< Identifier > ID
#define CHECK(...)
Evaluate an expression and check for errors.
Handle class for reading from StoreGate.
const ServiceHandle< StoreGateSvc > & detStore() const
virtual double e() const override final
get energy (data member) (synonym to method energy()
Definition CaloCell.h:333
uint16_t provenance() const
get provenance (data member)
Definition CaloCell.h:354
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
unsigned short LutOffset(const xAOD::TriggerTower &tt) const
unsigned long long PprSatBcidResultsTimeStamp(const xAOD::TriggerTower &tt) const
StatusCode initialize()
Dummy implementation of the initialisation function.
unsigned short int SyncDelayBcid(const xAOD::TriggerTower &tt) const
const CaloIdManager * m_caloMgr
Helper class for offline TT identifiers.
float caloCellsET(const xAOD::TriggerTower &tt) const
unsigned short int InBcidNegedge(const xAOD::TriggerTower &tt) const
unsigned int DisabledTower(const xAOD::TriggerTower &tt) const
double DacSlope(const xAOD::TriggerTower &tt) const
Identifier towerID(const xAOD::TriggerTower &tt) const
ToolHandle< LVL1::IL1CaloFcal23Cells2RxMappingTool > m_rxMapTool
unsigned short int BcidEnergyRangeLow(const xAOD::TriggerTower &tt) const
std::vector< std::vector< const CaloCell * > > caloCellsByReceiver(const xAOD::TriggerTower &tt) const
float caloCellsEnergy(const xAOD::TriggerTower &tt) const
unsigned short int ExtBcidThreshold(const xAOD::TriggerTower &tt) const
unsigned short LutStrategy(const xAOD::TriggerTower &tt) const
unsigned int PedValue(const xAOD::TriggerTower &tt) const
std::vector< float > caloCellsETByLayer(const xAOD::TriggerTower &tt) const
std::vector< L1CaloRxCoolChannelId > receivers(const xAOD::TriggerTower &tt) const
unsigned short LutSlope(const xAOD::TriggerTower &tt) const
double PedMean(const xAOD::TriggerTower &tt) const
ToolHandle< LVL1::IL1CaloCells2TriggerTowers > m_cells2tt
Tool to do the Calo cell summing.
std::vector< std::vector< float > > caloCellsEnergyByLayerByReceiver(const xAOD::TriggerTower &tt) const
SG::ReadHandleKey< CaloCellContainer > m_caloCellContainerKey
StoreGate keys for the Calo Cells.
std::vector< unsigned int > receiversId(const xAOD::TriggerTower &tt) const
double DacOffset(const xAOD::TriggerTower &tt) const
float TileCaloQuality(const std::vector< const CaloCell * > &cells) const
unsigned short int FirStartBit(const xAOD::TriggerTower &tt) const
unsigned short int SatBcidLevel(const xAOD::TriggerTower &tt) const
std::vector< float > caloCellsETByReceiver(const xAOD::TriggerTower &tt) const
unsigned long long PprLutValuesResultsTimeStamp(const xAOD::TriggerTower &tt) const
StatusCode initCaloCells()
Calo Cells into maps for L1Calo use.
std::vector< std::vector< std::vector< const CaloCell * > > > caloCellsByLayerByReceiver(const xAOD::TriggerTower &tt) const
short FirCoeff5(const xAOD::TriggerTower &tt) const
std::vector< float > caloCellsEnergyByLayer(const xAOD::TriggerTower &tt) const
unsigned long long PprTimingResultsTimeStamp(const xAOD::TriggerTower &tt) const
std::vector< const coral::AttributeList * > DbRxGainsAttributes(const xAOD::TriggerTower &tt, const CondAttrListCollection *dbAttrList) const
const coral::AttributeList * DbAttributes(const xAOD::TriggerTower &tt, const CondAttrListCollection *dbAttrList) const
short FirCoeff3(const xAOD::TriggerTower &tt) const
short FirCoeff1(const xAOD::TriggerTower &tt) const
unsigned long long PprPedestalRunResultsTimeStamp(const xAOD::TriggerTower &tt) const
std::vector< std::vector< const CaloCell * > > sortFCAL23Cells(const std::vector< const CaloCell * > &cells, const std::vector< L1CaloRxCoolChannelId > &rx) const
std::vector< std::vector< const CaloCell * > > sortEMCrackCells(const std::vector< const CaloCell * > &cells) const
L1CaloxAODOfflineTriggerTowerTools()=delete
delete the big 4
unsigned short int SatBcidThreshHigh(const xAOD::TriggerTower &tt) const
float LArCaloQuality(const std::vector< const CaloCell * > &cells) const
unsigned int RxStatus(const xAOD::TriggerTower &tt) const
unsigned short LutNoiseCut(const xAOD::TriggerTower &tt) const
unsigned int nCaloCells(const xAOD::TriggerTower &tt) const
std::vector< std::vector< float > > caloCellsETByLayerByReceiver(const xAOD::TriggerTower &tt) const
std::vector< float > caloCellsEnergyByReceiver(const xAOD::TriggerTower &tt) const
std::vector< unsigned int > nCaloCellsByLayer(const xAOD::TriggerTower &tt) const
const CondAttrListCollection * m_dbPpmChanCalib
Database.
unsigned int isTile(const xAOD::TriggerTower &tt) const
unsigned int DeadChannel(const xAOD::TriggerTower &tt) const
unsigned short int SatBcidThreshLow(const xAOD::TriggerTower &tt) const
float caloCellsQuality(const xAOD::TriggerTower &tt) const
short FirCoeff2(const xAOD::TriggerTower &tt) const
unsigned int FullDelayData(const xAOD::TriggerTower &tt) const
unsigned int ModuleId(const xAOD::TriggerTower &tt) const
std::vector< const CaloCell * > getCaloCells(const xAOD::TriggerTower &tt) const
unsigned long long PprFirFilterResultsTimeStamp(const xAOD::TriggerTower &tt) const
unsigned long long PprNoiseRunResultsTimeStamp(const xAOD::TriggerTower &tt) const
unsigned short int BcidEnergyRangeHigh(const xAOD::TriggerTower &tt) const
ToolHandle< LVL1::IL1CaloTTIdTools > m_l1CaloTTIdTools
Tool to get the Identifier of a TriggerTower.
unsigned long long PprDacScanResultsTimeStamp(const xAOD::TriggerTower &tt) const
unsigned int ErrorCode(const xAOD::TriggerTower &tt) const
short FirCoeff4(const xAOD::TriggerTower &tt) const
uint8_t qual1(void) const
get quality of first PMT (data member)
Definition TileCell.h:197
uint8_t qual2(void) const
get quality of second PMT (data member)
Definition TileCell.h:200
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition AsgTool.cxx:58
int r
Definition globals.cxx:22
struct color C
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
TriggerTower_v2 TriggerTower
Define the latest version of the TriggerTower class.