diff --git a/Trigger/TrigT1/TrigT1Monitoring/src/CalorimeterL1CaloMon.cxx b/Trigger/TrigT1/TrigT1Monitoring/src/CalorimeterL1CaloMon.cxx index f5f601a6eaf4bba2a436c4cb6dd282f8cb3709fb..742af38fb83a4dc79bc026a3054ee4d0cf546b45 100644 --- a/Trigger/TrigT1/TrigT1Monitoring/src/CalorimeterL1CaloMon.cxx +++ b/Trigger/TrigT1/TrigT1Monitoring/src/CalorimeterL1CaloMon.cxx @@ -755,8 +755,6 @@ StatusCode CalorimeterL1CaloMon::fillHistograms() double phi = (*ttIterator)->phi(); const int layer = (*ttIterator)->layer(); const xAOD::TriggerTower_v2* tt = *ttIterator; - std::vector CaloEnergyLayers; - std::vector CaloETLayers; em_caloE = 0; had_caloE = 0; @@ -775,21 +773,18 @@ StatusCode CalorimeterL1CaloMon::fillHistograms() em_L1CaloE = int(tt->jepET()); em_L1CaloE_CP = int(0.5*(tt->cpET())); // CP scale hardcoded for now, but this should be updated to be taken automatically - // Get Calo ET - CaloEnergyLayers = tt->auxdataConst< std::vector > ("CaloCellEnergyByLayer"); - CaloETLayers = tt->auxdataConst< std::vector > ("CaloCellETByLayer"); if (absEta < 3.2) { - if ( tt->isAvailable< std::vector > ("CaloCellEnergyByLayer") ) { - for (std::vector::iterator it = CaloEnergyLayers.begin(); it != CaloEnergyLayers.end(); it++) { - em_caloE += *it; + if ( tt->isAvailable< std::vector > ("CaloCellEnergyByLayer") ) { + for (float e : tt->auxdataConst< std::vector > ("CaloCellEnergyByLayer")) { + 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 > ("CaloCellETByLayer") ) { - for (std::vector::iterator it = CaloETLayers.begin(); it != CaloETLayers.end(); it++) { - em_caloE += *it; + for (float et : tt->auxdataConst< std::vector > ("CaloCellETByLayer")) { + em_caloE += et; } } } @@ -965,21 +960,17 @@ StatusCode CalorimeterL1CaloMon::fillHistograms() had_L1CaloE = int(tt->jepET()); had_L1CaloE_CP = int(0.5*(tt->cpET())); // CP scale hardcoded for now, but this should be updated to be taken automatically - // Get Calo ET - CaloEnergyLayers = tt->auxdataConst< std::vector > ("CaloCellEnergyByLayer"); - CaloETLayers = tt->auxdataConst< std::vector > ("CaloCellETByLayer"); - if (absEta < 3.2) { if ( tt->isAvailable< std::vector > ("CaloCellEnergyByLayer") ) { - for (std::vector::iterator it = CaloEnergyLayers.begin(); it != CaloEnergyLayers.end(); it++) { - had_caloE += *it; + for (float e : tt->auxdataConst< std::vector > ("CaloCellEnergyByLayer")) { + 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 > ("CaloCellETByLayer") ) { - for (std::vector::iterator it = CaloETLayers.begin(); it != CaloETLayers.end(); it++) { - had_caloE += *it; + for (float et : tt->auxdataConst< std::vector > ("CaloCellETByLayer")) { + had_caloE += et; } } }