diff --git a/Trigger/TrigT1/TrigT1CaloCalibTools/src/L1CaloPprEtCorrelationPlotManager.cxx b/Trigger/TrigT1/TrigT1CaloCalibTools/src/L1CaloPprEtCorrelationPlotManager.cxx index 831fa805b4b456dacf9a2d70badd982ebe35703f..79e35e12d3bd3efb87093d4d0622820f115d426d 100644 --- a/Trigger/TrigT1/TrigT1CaloCalibTools/src/L1CaloPprEtCorrelationPlotManager.cxx +++ b/Trigger/TrigT1/TrigT1CaloCalibTools/src/L1CaloPprEtCorrelationPlotManager.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 */ #include "TrigT1CaloCalibTools/L1CaloPprEtCorrelationPlotManager.h" @@ -15,6 +15,7 @@ #include "TrigT1CaloToolInterfaces/IL1TriggerTowerTool.h" #include "TrigT1CaloEvent/TriggerTower.h" +#include "AthContainers/ConstAccessor.h" #include "CaloEvent/CaloCellContainer.h" #include "Identifier/Identifier.h" @@ -106,16 +107,20 @@ double L1CaloPprEtCorrelationPlotManager::getMonitoringValue(const xAOD::Trigger if (ttCpEnergy <= m_EtMin) return -1000.; if (absEta < 3.2){ - if ( trigTower->isAvailable< std::vector<float> > ("CaloCellEnergyByLayer") ) { - for (float e : trigTower->auxdataConst< std::vector<float> > ("CaloCellEnergyByLayer")) { + static const SG::ConstAccessor< std::vector<float> > + CaloCellEnergyByLayerAcc("CaloCellEnergyByLayer"); + if ( CaloCellEnergyByLayerAcc.isAvailable(*trigTower) ) { + for (float e : CaloCellEnergyByLayerAcc(*trigTower)) { caloEnergy += e; } caloEnergy = caloEnergy / cosh( trigTower->eta() ); } }//for central region only else { - if( trigTower->isAvailable< std::vector<float> > ("CaloCellETByLayer") ){ - for (float et : trigTower->auxdataConst< std::vector<float> > ("CaloCellETByLayer")) { + static const SG::ConstAccessor< std::vector<float> > + CaloCellETByLayerAcc("CaloCellETByLayer"); + if( CaloCellETByLayerAcc.isAvailable(*trigTower) ){ + for (float et : CaloCellETByLayerAcc(*trigTower)) { caloEnergy += et; } } diff --git a/Trigger/TrigT1/TrigT1CaloMonitoring/src/MistimedStreamMonitorAlgorithm.cxx b/Trigger/TrigT1/TrigT1CaloMonitoring/src/MistimedStreamMonitorAlgorithm.cxx index f8d4693adba8ded277dec61eeb8ad411237ebf23..19f15f992a003ed141d437f9108d9094c22128de 100644 --- a/Trigger/TrigT1/TrigT1CaloMonitoring/src/MistimedStreamMonitorAlgorithm.cxx +++ b/Trigger/TrigT1/TrigT1CaloMonitoring/src/MistimedStreamMonitorAlgorithm.cxx @@ -1,9 +1,10 @@ /* - Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #include "MistimedStreamMonitorAlgorithm.h" +#include "AthContainers/ConstAccessor.h" #include <iostream> #include <vector> #include <TMath.h> @@ -211,7 +212,9 @@ StatusCode MistimedStreamMonitorAlgorithm::fillHistograms( const EventContext& c std::unique_ptr<xAOD::TriggerTowerAuxContainer> ttContainerAux = std::make_unique<xAOD::TriggerTowerAuxContainer>(); ttContainer->setStore(ttContainerAux.get()); - // Creating a new contianer for TT with pulseClasification + static const SG::Accessor<float> pulseClassificationAcc("pulseClassification"); + + // Creating a new container for TT with pulseClassification for (const xAOD::TriggerTower* tt : *triggerTowerTES) { float ttPulseCategory = 0; @@ -284,7 +287,7 @@ StatusCode MistimedStreamMonitorAlgorithm::fillHistograms( const EventContext& c xAOD::TriggerTower* newTT = new xAOD::TriggerTower; //create a new TT object ttContainer->push_back(newTT); // add the newTT to new output TT container (at the end of it) *newTT = *(tt);// copy over all information from TT to newTT - newTT->auxdata<float>("pulseClassification") = ttPulseCategory; //decorate + pulseClassificationAcc(*newTT) = ttPulseCategory; //decorate } // count all eFex in-time and out-of-time TOBs with at least 5GeV @@ -560,7 +563,7 @@ StatusCode MistimedStreamMonitorAlgorithm::fillHistograms( const EventContext& c //Create the trigger tower objects and calculate scaled phi for (const xAOD::TriggerTower* tt : *ttContainer) { ATH_CHECK( makeTowerPPM(tt, vecMonTTDecor) ); - ATH_MSG_DEBUG( "tt->pulseClassification :: " << tt->auxdata<float>("pulseClassification")); + ATH_MSG_DEBUG( "tt->pulseClassification :: " << pulseClassificationAcc(*tt)); } groupName = "EventofInterest_" + std::to_string(eventCounter) + "_"; @@ -570,7 +573,7 @@ StatusCode MistimedStreamMonitorAlgorithm::fillHistograms( const EventContext& c for (auto& myTower : vecMonTTDecor) { ATH_MSG_DEBUG(" looping over TTs"); const int layer = (myTower.tower)->layer(); - pulseCat = (myTower.tower)->auxdata<float>("pulseClassification"); + pulseCat = pulseClassificationAcc(*myTower.tower); bcidWord = (myTower.tower)->bcidVec()[0]; // look at the status bit in the central time slice ATH_MSG_DEBUG("groupName :: " << groupName);