diff --git a/Trigger/TrigT1/TrigT1CaloSim/src/Run2TriggerTowerMaker.cxx b/Trigger/TrigT1/TrigT1CaloSim/src/Run2TriggerTowerMaker.cxx index 486fe3e0a72df5158b01d02be56d21ff4170fa7e..c480eeac5d1d7feaa53905a43016d2c51db4f010 100755 --- a/Trigger/TrigT1/TrigT1CaloSim/src/Run2TriggerTowerMaker.cxx +++ b/Trigger/TrigT1/TrigT1CaloSim/src/Run2TriggerTowerMaker.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ // ================================================ @@ -25,6 +25,7 @@ #include "TileConditions/TileInfo.h" #include "xAODEventInfo/EventInfo.h" +#include "AthContainers/Decorator.h" //For getting TriggerTowers from BS #include "TrigT1CaloByteStream/ITrigT1CaloDataAccessV2.h" @@ -401,11 +402,11 @@ namespace LVL1 { // decorate the overlay TTs to indicate if they have been used or not char decor_ttNotUsedInOverlay = 0; char decor_ttUsedInOverlay = 1; - std::string decor_name = "addedToSignal"; + static const SG::Decorator<char> decor ("addedToSignal"); for (auto tt:*overlayDataTTs) { // Let's exclude all dead and disabled towers if (IsGoodTower(tt,m_deadChannelsContaineroverlay,m_disabledTowersContaineroverlay)) { - tt->auxdecor<char>(decor_name) = decor_ttNotUsedInOverlay; + decor(*tt) = decor_ttNotUsedInOverlay; overlayMap.insert( std::make_pair( tt->coolId() , tt ) ); } } @@ -432,7 +433,7 @@ namespace LVL1 { ATH_CHECK( addOverlay(bcid,mu,tt,(*match).second) ); // Let the overlay TT know that it has been used - (*match).second->auxdecor<char>(decor_name) = decor_ttUsedInOverlay; + decor(*match->second) = decor_ttUsedInOverlay; } // end of match } // end of loop over primary TTs @@ -440,7 +441,7 @@ namespace LVL1 { // Now we need to add all overlay TTs that have not been used so far for (Itr i=overlayMap.begin();i!=overlayMap.end();++i) { xAOD::TriggerTower* tt = (*i).second; - if (tt->auxdataConst<char>(decor_name) == decor_ttNotUsedInOverlay) { + if (decor(*tt) == decor_ttNotUsedInOverlay) { // Ensure that LUT vectors are the same size as the primary TTs std::vector<uint8_t> overlay_lut_cp(sizeOfPrimaryLUT,0.); std::vector<uint8_t> overlay_lut_jep(sizeOfPrimaryLUT,0.); diff --git a/Trigger/TrigT1/TrigT1Monitoring/src/CalorimeterL1CaloMon.cxx b/Trigger/TrigT1/TrigT1Monitoring/src/CalorimeterL1CaloMon.cxx index 742af38fb83a4dc79bc026a3054ee4d0cf546b45..6767d5fc48274a9b09c7c2ea778fe7798f1fd5a0 100644 --- a/Trigger/TrigT1/TrigT1Monitoring/src/CalorimeterL1CaloMon.cxx +++ b/Trigger/TrigT1/TrigT1Monitoring/src/CalorimeterL1CaloMon.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ // ******************************************************************** @@ -29,6 +29,7 @@ #include "CaloIdentifier/CaloCell_ID.h" #include "Identifier/Identifier.h" +#include "AthContainers/ConstAccessor.h" #include "TrigT1CaloCalibConditions/L1CaloCoolChannelId.h" #include "TrigT1CaloCalibToolInterfaces/IL1CaloMonitoringCaloTool.h" @@ -749,6 +750,11 @@ StatusCode CalorimeterL1CaloMon::fillHistograms() double em_L1CaloE_CP = 0; double had_L1CaloE_CP = 0; + static const SG::ConstAccessor< std::vector<float> > + CaloCellEnergyByLayerAcc("CaloCellEnergyByLayer"); + static const SG::ConstAccessor< std::vector<float> > + CaloCellETByLayerAcc("CaloCellETByLayer"); + for (; ttIterator != ttIteratorEnd; ++ttIterator) { double eta = (*ttIterator)->eta(); double absEta = fabs(eta); @@ -775,15 +781,15 @@ StatusCode CalorimeterL1CaloMon::fillHistograms() if (absEta < 3.2) { - if ( tt->isAvailable< std::vector<float> > ("CaloCellEnergyByLayer") ) { - for (float e : tt->auxdataConst< std::vector<float> > ("CaloCellEnergyByLayer")) { + if ( CaloCellEnergyByLayerAcc.isAvailable(*tt) ) { + for (float e : CaloCellEnergyByLayerAcc(*tt)) { em_caloE += e; } em_caloE = em_caloE / cosh(eta); } } else { // FCal: need to use different method due to large variation in cell eta - if ( tt->isAvailable< std::vector<float> > ("CaloCellETByLayer") ) { - for (float et : tt->auxdataConst< std::vector<float> > ("CaloCellETByLayer")) { + if ( CaloCellETByLayerAcc.isAvailable(*tt) ) { + for (float et : CaloCellETByLayerAcc(*tt)) { em_caloE += et; } } @@ -961,15 +967,15 @@ StatusCode CalorimeterL1CaloMon::fillHistograms() had_L1CaloE_CP = int(0.5*(tt->cpET())); // CP scale hardcoded for now, but this should be updated to be taken automatically if (absEta < 3.2) { - if ( tt->isAvailable< std::vector<float> > ("CaloCellEnergyByLayer") ) { - for (float e : tt->auxdataConst< std::vector<float> > ("CaloCellEnergyByLayer")) { + if ( CaloCellEnergyByLayerAcc.isAvailable(*tt) ) { + for (float e : CaloCellEnergyByLayerAcc(*tt)) { had_caloE += e; } had_caloE = had_caloE / cosh(eta); } } else { // FCal: need to use different method due to large variation in cell eta - if ( tt->isAvailable< std::vector<float> > ("CaloCellETByLayer") ) { - for (float et : tt->auxdataConst< std::vector<float> > ("CaloCellETByLayer")) { + if ( CaloCellETByLayerAcc.isAvailable(*tt) ) { + for (float et : CaloCellETByLayerAcc(*tt)) { had_caloE += et; } }