22 m_l1CaloTTIdTools(
"LVL1::L1CaloTTIdTools/L1CaloTTIdTools"),
23 m_rxMapTool(
"LVL1::L1CaloFcal23Cells2RxMappingTool/L1CaloFcal23Cells2RxMappingTool"),
25 m_lvl1Helper(nullptr),
26 m_ttSvc(
"CaloTriggerTowerService"),
27 m_dbPpmChanCalib(nullptr)
34 ATH_MSG_INFO(
"initialize LVL1::L1CaloxAODOfflineTriggerTowerTools");
54 return StatusCode::SUCCESS;
60 ATH_MSG_INFO(
"finalize LVL1::L1CaloxAODOfflineTriggerTowerTools");
62 return StatusCode::SUCCESS;
73 return StatusCode::SUCCESS;
76 std::vector<L1CaloRxCoolChannelId>
79 std::vector<L1CaloRxCoolChannelId> rx =
m_ttSvc->cnvCoolChannelIdToRxId(
tt.coolId() );
80 std::vector<L1CaloRxCoolChannelId> output;
83 if (
tt.sampling() == 0) {
93 std::vector<L1CaloRxCoolChannelId> rx2;
94 for (
const auto&
i : rx) {
95 if (
i.crate() == 2 ||
i.crate() == 3) {
100 if (rx2.size() == 2) {
102 unsigned int inputA = rx2.at(0).inputConn();
103 unsigned int inputB = rx2.at(1).inputConn();
106 if (inputA == 2 && inputB == 0) {
107 output.push_back(rx2.at(1));
108 output.push_back(rx2.at(0));
110 if (inputA == 0 && inputB == 2) {
111 output.push_back(rx2.at(0));
112 output.push_back(rx2.at(1));
117 if (rx.size() == 1) {
118 output.push_back( rx.at(0) );
124 if (
tt.sampling() == 1) {
126 if (rx.size() == 2) {
128 unsigned int inputPairA = rx.at(0).inputPair();
129 unsigned int inputPairB = rx.at(1).inputPair();
131 bool oddA(
false),oddB(
false);
132 if(inputPairA % 2 != 0){oddA =
true;}
133 if(inputPairB % 2 != 0){oddB =
true;}
136 output.push_back(rx.at(0));
137 output.push_back(rx.at(1));
140 output.push_back(rx.at(1));
141 output.push_back(rx.at(0));
144 if (rx.size() == 1) {
145 output.push_back( rx.at(0) );
152 std::vector<unsigned int>
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() );
176 std::vector<const CaloCell*>
189 std::vector<unsigned int>
192 std::vector<unsigned int> output;
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() );
234 std::vector<float> output;
236 std::vector<std::vector<const CaloCell*>>
cells =
m_cells2tt->caloCellsByLayer(
id );
237 output.reserve(
cells.size());
238 for (
const auto&
i :
cells) {
247 std::vector<float> output;
249 std::vector<std::vector<const CaloCell*>>
cells =
m_cells2tt->caloCellsByLayer(
id );
250 output.reserve(
cells.size());
251 for (
const auto&
i :
cells) {
257 std::vector<std::vector<const CaloCell*>>
260 std::vector<std::vector<const CaloCell*>> output;
262 if (rx.size() == 1) {
264 }
else if(rx.size() == 2) {
278 using std::back_inserter;
280 std::vector<float> energyByReceiver;
283 back_inserter(energyByReceiver),
284 [
this](
const std::vector<const CaloCell*>&
c) ->
float {
288 return energyByReceiver;
296 using std::back_inserter;
298 std::vector<float> etByReceiver;
301 back_inserter(etByReceiver),
302 [
this](
const std::vector<const CaloCell*>&
c) ->
float {
309 std::vector<std::vector<std::vector<const CaloCell*>>>
314 using std::back_inserter;
322 back_inserter(output),
324 return {std::move(C)};
326 }
else if(rx.size() == 2) {
328 const auto& cellsByLayer =
m_cells2tt->caloCellsByLayer(
id );
329 for(
const auto&
cells : cellsByLayer) {
331 output.push_back(cellsByReceiver);
340 std::vector<std::vector<float>>
345 using std::back_inserter;
347 std::vector<std::vector<float>> output;
349 std::vector<float> cellsEnergyByReceiver;
350 cellsEnergyByReceiver.reserve(cellsByReceiver.size());
351 for(
const auto&
cells : cellsByReceiver) {
354 output.push_back(std::move(cellsEnergyByReceiver));
361 std::vector<std::vector<float>>
366 using std::back_inserter;
368 std::vector<std::vector<float>> output;
370 std::vector<float> cellsEnergyByReceiver;
371 cellsEnergyByReceiver.reserve(cellsByReceiver.size());
372 for(
const std::vector<const CaloCell*>&
cells : cellsByReceiver) {
375 output.push_back(std::move(cellsEnergyByReceiver));
394 float output(-999.9);
410 if ((
i)->provenance() & 0x2000) {
432 if (tileCell && tileCell->
provenance() & 0x8080) {
497 std::vector<std::vector<const CaloCell*>>
500 std::vector<std::vector<const CaloCell*>> output;
501 std::vector<const CaloCell*> emb;
502 std::vector<const CaloCell*> emec;
510 emb.push_back( (
i) );
513 emec.push_back( (
i) );
517 output.push_back(emec);
518 output.push_back(emb);
522 std::vector<std::vector<const CaloCell*>>
526 std::vector<const CaloCell*> cellsA;
527 std::vector<const CaloCell*> cellsB;
529 std::vector<std::vector<const CaloCell*>> output;
532 unsigned int rxidA = rx.at(0).id();
533 unsigned int rxidB = rx.at(1).id();
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);}
541 output.push_back(cellsA);
542 output.push_back(cellsB);
553 for(Itr_db
i=dbAttrList->
begin();
i!=dbAttrList->
end();++
i){
554 if(
i->first ==
tt.coolId() ){
555 attrList = &(
i->second);
562 std::vector<const coral::AttributeList*>
566 std::vector<const coral::AttributeList*> v_attr;
568 for(
auto r : rxID ){
569 for(Itr_db
i=dbAttrList->
begin();
i!=dbAttrList->
end();++
i){
571 v_attr.push_back( &(
i->second) );
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>();
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>();
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>();
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>();
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>();
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>();
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>();
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>();
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>();
712 for(
unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
713 if((*attrList)[attrNum].specification().
name() ==
"DacOffset"){
714 value = (
double) (*attrList)[attrNum].data<
double>();
726 for(
unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
727 if((*attrList)[attrNum].specification().
name() ==
"DacSlope"){
728 value = (
double) (*attrList)[attrNum].data<
double>();
740 for(
unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
741 if((*attrList)[attrNum].specification().
name() ==
"PedMean"){
742 value = (
double) (*attrList)[attrNum].data<
double>();
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>();
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>();
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>();
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>();
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>();
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>();
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>();
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>();
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>();
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>();
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>();
908 for(
unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
909 if((*attrList)[attrNum].specification().
name() ==
"FirCoeff1"){
910 value = (
short) (*attrList)[attrNum].data<
short>();
922 for(
unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
923 if((*attrList)[attrNum].specification().
name() ==
"FirCoeff2"){
924 value = (
short) (*attrList)[attrNum].data<
short>();
936 for(
unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
937 if((*attrList)[attrNum].specification().
name() ==
"FirCoeff3"){
938 value = (
short) (*attrList)[attrNum].data<
short>();
950 for(
unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
951 if((*attrList)[attrNum].specification().
name() ==
"FirCoeff4"){
952 value = (
short) (*attrList)[attrNum].data<
short>();
964 for(
unsigned int attrNum=0;attrNum<attrList->size();++attrNum){
965 if((*attrList)[attrNum].specification().
name() ==
"FirCoeff5"){
966 value = (
short) (*attrList)[attrNum].data<
short>();
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>();
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>();
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>();
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 >();
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>();
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>();
1075 unsigned int value = 0;