From 3bfbce352a039162576693cae7017fe2c7064288 Mon Sep 17 00:00:00 2001 From: scott snyder <sss@karma> Date: Fri, 12 Apr 2024 14:10:39 -0400 Subject: [PATCH 1/2] TrigT1CaloCalibTools: Use Accessor, etc instead of auxdata(). Replace auxdata, etc. with Accessor classes. Moving to deprecate these usages in the Athena build. --- .../src/L1CaloPprEtCorrelationPlotManager.cxx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Trigger/TrigT1/TrigT1CaloCalibTools/src/L1CaloPprEtCorrelationPlotManager.cxx b/Trigger/TrigT1/TrigT1CaloCalibTools/src/L1CaloPprEtCorrelationPlotManager.cxx index 831fa805b4b4..79e35e12d3bd 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; } } -- GitLab From 4fe96f9145ada4cd4af92b6df2addef20fb66399 Mon Sep 17 00:00:00 2001 From: scott snyder <sss@karma> Date: Fri, 12 Apr 2024 14:22:23 -0400 Subject: [PATCH 2/2] TrigT1CaloMonitoring: Use Accessor, etc instead of auxdata(). Replace auxdata, etc. with Accessor classes. Moving to deprecate these usages in the Athena build. --- .../src/MistimedStreamMonitorAlgorithm.cxx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Trigger/TrigT1/TrigT1CaloMonitoring/src/MistimedStreamMonitorAlgorithm.cxx b/Trigger/TrigT1/TrigT1CaloMonitoring/src/MistimedStreamMonitorAlgorithm.cxx index f8d4693adba8..19f15f992a00 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); -- GitLab