diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/Root/AsgElectronEfficiencyCorrectionTool.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/Root/AsgElectronEfficiencyCorrectionTool.cxx index 96e7afc414e419f8b48ace920a4056a716c3866d..385b3a75a4d67cf1a3d72461a13d8680dba39229 100644 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/Root/AsgElectronEfficiencyCorrectionTool.cxx +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/Root/AsgElectronEfficiencyCorrectionTool.cxx @@ -507,7 +507,7 @@ AsgElectronEfficiencyCorrectionTool::applySystematicVariation(const CP::Systemat if (filteredSys.empty() && !systConfig.empty()) { ATH_MSG_DEBUG("systematics : "); - for (auto &syst : systConfig) { + for (const auto &syst : systConfig) { ATH_MSG_DEBUG(syst.name()); } ATH_MSG_DEBUG(" Not supported "); diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/Root/ElectronChargeEfficiencyCorrectionTool.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/Root/ElectronChargeEfficiencyCorrectionTool.cxx index c2da25f6b7e3dd029243b3a26bb9a56efb2ed285..dc7043aaa8c9ac40188c8772a717c1d5f31bbb48 100644 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/Root/ElectronChargeEfficiencyCorrectionTool.cxx +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/Root/ElectronChargeEfficiencyCorrectionTool.cxx @@ -24,7 +24,7 @@ // #include "TRandom.h" // STL includes -#include <stdlib.h> /* atoi */ +#include <cstdlib> /* atoi */ // ============================================================================= diff --git a/Reconstruction/MVAUtils/Root/BDT.cxx b/Reconstruction/MVAUtils/Root/BDT.cxx index 5a21f4146ee925d61f5fbc78bb41d38ba00eaaff..c7d76f08843467ae08547e41f87f3152cd19d28d 100644 --- a/Reconstruction/MVAUtils/Root/BDT.cxx +++ b/Reconstruction/MVAUtils/Root/BDT.cxx @@ -8,6 +8,8 @@ #include "MVAUtils/ForestXGBoost.h" #include "TTree.h" +#include <cmath> + #include <memory> #include <set> #include <sstream> @@ -115,13 +117,13 @@ float BDT::GetClassification(const std::vector<float*>& pointers) const float BDT::GetGradBoostMVA(const std::vector<float>& values) const { const float sum = m_forest->GetRawResponse(values); // ignores the offset - return 2. / (1 + exp(-2 * sum)) - 1; //output shaping for gradient boosted decision tree (-1,1) + return 2. / (1 + std::exp(-2 * sum)) - 1; //output shaping for gradient boosted decision tree (-1,1) } float BDT::GetGradBoostMVA(const std::vector<float*>& pointers) const { const float sum = m_forest->GetRawResponse(pointers); // ignores the offset - return 2. / (1 + exp(-2 * sum)) - 1; //output shaping for gradient boosted decision tree (-1,1) + return 2. / (1 + std::exp(-2 * sum)) - 1; //output shaping for gradient boosted decision tree (-1,1) } diff --git a/Reconstruction/MVAUtils/util/check_timing_mvautils.cxx b/Reconstruction/MVAUtils/util/check_timing_mvautils.cxx index 2a0e8eb506f2b0134a56f10283b2732043a94cf5..b24de5f19884cf04abe0519cf6f2b6d6951aa7d5 100644 --- a/Reconstruction/MVAUtils/util/check_timing_mvautils.cxx +++ b/Reconstruction/MVAUtils/util/check_timing_mvautils.cxx @@ -17,7 +17,7 @@ TTree* get_tree(const std::string& filename) { TFile* f = TFile::Open(filename.c_str()); - auto keys = f->GetListOfKeys(); + auto *keys = f->GetListOfKeys(); TTree* tree = nullptr; for (int ikey=0; ikey != keys->GetSize(); ++ikey) { diff --git a/Reconstruction/egamma/egammaAlgs/src/EMGSFCaloExtensionBuilder.cxx b/Reconstruction/egamma/egammaAlgs/src/EMGSFCaloExtensionBuilder.cxx index c7afddd8e11b450569c5d03b86720549e34cc5bb..5eda5dabb866db3e459d53ee25584bade4e0d482 100644 --- a/Reconstruction/egamma/egammaAlgs/src/EMGSFCaloExtensionBuilder.cxx +++ b/Reconstruction/egamma/egammaAlgs/src/EMGSFCaloExtensionBuilder.cxx @@ -71,7 +71,7 @@ EMGSFCaloExtensionBuilder::execute(const EventContext& ctx) const CaloExtensionCollection* ptrPerigee = perigeeCache.ptr(); CaloExtensionCollection* ptrLast = lastCache.ptr(); std::vector<bool> mask(ptrTracks->size(), true); - for (auto trkIt : *ptrTracks) { + for (const auto *trkIt : *ptrTracks) { // If we have TRT-SA tracks we don't extrapolate if (xAOD::EgammaHelpers::numberOfSiHits(trkIt) < 4) { mask[trkIt->index()] = false; diff --git a/Reconstruction/egamma/egammaAlgs/src/egammaForwardBuilder.cxx b/Reconstruction/egamma/egammaAlgs/src/egammaForwardBuilder.cxx index 22999a96e12786a868829e8c6f9b02e636b87a78..faa21b55967751e0fc238e11b7d972aeec4b1eac 100644 --- a/Reconstruction/egamma/egammaAlgs/src/egammaForwardBuilder.cxx +++ b/Reconstruction/egamma/egammaAlgs/src/egammaForwardBuilder.cxx @@ -150,7 +150,7 @@ StatusCode egammaForwardBuilder::execute(const EventContext& ctx) const // Now finalize the cluster: based on code in CaloClusterStoreHelper::finalizeClusters // Note: I don't specifically set the IProxyDict, since I also don't set it when I create // data handles, either. - auto sg = outClusterContainer.storeHandle().get(); + auto *sg = outClusterContainer.storeHandle().get(); for (xAOD::CaloCluster* cl : *outClusterContainer) { cl->setLink(outClusterContainerCellLink.ptr(), sg); } diff --git a/Reconstruction/egamma/egammaAlgs/src/egammaSuperClusterBuilder.cxx b/Reconstruction/egamma/egammaAlgs/src/egammaSuperClusterBuilder.cxx index c4478c1ea393c7ab4c8b785f039ef21036cc211c..78fc6765949bd63b11b408e156f3f5329f4bef47 100644 --- a/Reconstruction/egamma/egammaAlgs/src/egammaSuperClusterBuilder.cxx +++ b/Reconstruction/egamma/egammaAlgs/src/egammaSuperClusterBuilder.cxx @@ -589,7 +589,7 @@ egammaSuperClusterBuilder::makeCorrection1(xAOD::CaloCluster* cluster, // Given the range refine the position employing the smaller window if (detastr > 0 && dphistr > 0) { CaloLayerCalculator helper; - const auto cellLink = cluster->getCellLinks(); + const auto *const cellLink = cluster->getCellLinks(); helper.fill(cellLink->begin(), cellLink->end(), etamax, phimax, detastr, dphistr, sample); // Here is where we (re-)fill the eta in the 1st sampling @@ -632,7 +632,7 @@ egammaSuperClusterBuilder::addTileGap3CellsinWindow(xAOD::CaloCluster* myCluster cells.insert(cells.end(), myList.begin(), myList.end()); } - for (auto cell : cells) { + for (const auto *cell : cells) { if (!cell || !cell->caloDDE()) { continue; } @@ -652,7 +652,7 @@ egammaSuperClusterBuilder::findCentralPosition( { CentralPosition cp; - for (auto cluster : clusters) { + for (const auto *cluster : clusters) { if (cluster->hasSampling(CaloSampling::EMB2)) { float thisEmax = cluster->energy_max(CaloSampling::EMB2); if (thisEmax > cp.emaxB) { diff --git a/Reconstruction/egamma/egammaAlgs/src/egammaTrackSlimmer.cxx b/Reconstruction/egamma/egammaAlgs/src/egammaTrackSlimmer.cxx index 734a644ab271cf4749c704a0a41794a5bfcb6644..d155e3566132f2f027fefe544df8402b272053ef 100644 --- a/Reconstruction/egamma/egammaAlgs/src/egammaTrackSlimmer.cxx +++ b/Reconstruction/egamma/egammaAlgs/src/egammaTrackSlimmer.cxx @@ -105,7 +105,7 @@ StatusCode egammaTrackSlimmer::execute (const EventContext& ctx) const { */ ATH_MSG_DEBUG("Number of In Det TrackParticles "<< indetTrackPC->size()); keptInDetTrackParticles.resize( indetTrackPC->size(), true ); - for (auto trkIt : *indetTrackPC) { + for (const auto *trkIt : *indetTrackPC) { if (xAOD::EgammaHelpers::numberOfSiHits(trkIt) < 4) { keptInDetTrackParticles[trkIt->index()] = false; } diff --git a/Reconstruction/egamma/egammaAlgs/src/electronSuperClusterBuilder.cxx b/Reconstruction/egamma/egammaAlgs/src/electronSuperClusterBuilder.cxx index 2da7b8a630ad8a747013800c1653f12adf59c85b..0ba40bd73d30ca2b4144827772ac348a0b14c1a8 100644 --- a/Reconstruction/egamma/egammaAlgs/src/electronSuperClusterBuilder.cxx +++ b/Reconstruction/egamma/egammaAlgs/src/electronSuperClusterBuilder.cxx @@ -91,7 +91,7 @@ electronSuperClusterBuilder::execute(const EventContext& ctx) const isUsedRevert = isUsed; // Check if used - auto egRec = egammaRecs->at(i); + const auto *egRec = egammaRecs->at(i); if (isUsed.at(i)) { continue; } @@ -155,7 +155,7 @@ electronSuperClusterBuilder::execute(const EventContext& ctx) const const std::vector<std::size_t> secondaryIndices = searchForSecondaryClusters(i, egammaRecs.cptr(), isUsed); for (const auto& secIndex : secondaryIndices) { - const auto secRec = egammaRecs->at(secIndex); + const auto *const secRec = egammaRecs->at(secIndex); accumulatedClusters.push_back(secRec->caloCluster()); } @@ -198,7 +198,7 @@ electronSuperClusterBuilder::searchForSecondaryClusters(const std::size_t electr if (!egammaRecs) { return secondaryClusters; } - const auto seedEgammaRec = egammaRecs->at(electronIndex); + const auto *const seedEgammaRec = egammaRecs->at(electronIndex); const xAOD::CaloCluster* seedCluster = seedEgammaRec->caloCluster(); const xAOD::TrackParticle* seedTrackParticle = seedEgammaRec->trackParticle(); @@ -210,7 +210,7 @@ electronSuperClusterBuilder::searchForSecondaryClusters(const std::size_t electr continue; } // if not retrieve the relevant info - const auto egRec = egammaRecs->at(i); + const auto *const egRec = egammaRecs->at(i); const xAOD::CaloCluster* clus = egRec->caloCluster(); float seedSecdEta(fabs(seedCluster->eta() - clus->eta())); float seedSecdPhi(fabs(P4Helpers::deltaPhi(seedCluster->phi(), clus->phi()))); diff --git a/Reconstruction/egamma/egammaAlgs/src/photonSuperClusterBuilder.cxx b/Reconstruction/egamma/egammaAlgs/src/photonSuperClusterBuilder.cxx index 0342ef800e5a6e3a7f2030ca9aa995c01b0976f9..4863129319604757ab000f0c5f0448975a37bf95 100644 --- a/Reconstruction/egamma/egammaAlgs/src/photonSuperClusterBuilder.cxx +++ b/Reconstruction/egamma/egammaAlgs/src/photonSuperClusterBuilder.cxx @@ -91,8 +91,8 @@ photonSuperClusterBuilder::execute(const EventContext& ctx) const // Used to revert status of topos // in case we fail to make a supercluser. std::vector<bool> isUsedRevert(isUsed); - const auto egRec = egammaRecs->at(i); - const auto clus = egRec->caloCluster(); + const auto *const egRec = egammaRecs->at(i); + const auto *const clus = egRec->caloCluster(); // First some basic seed cuts if (isUsed.at(i)) { continue; @@ -132,7 +132,7 @@ photonSuperClusterBuilder::execute(const EventContext& ctx) const searchForSecondaryClusters(i, egammaRecs.cptr(), isUsed, nWindowClusters, nExtraClusters); for (auto secClus : secondaryClusters) { - const auto secRec = egammaRecs->at(secClus); + const auto *const secRec = egammaRecs->at(secClus); accumulatedClusters.push_back(secRec->caloCluster()); // no need to add vertices } @@ -206,8 +206,8 @@ photonSuperClusterBuilder::searchForSecondaryClusters(std::size_t photonInd, return secondaryClusters; } - const auto seedPhoton = egammaRecs->at(photonInd); - const auto seedCaloClus = seedPhoton->caloCluster(); + const auto *const seedPhoton = egammaRecs->at(photonInd); + const auto *const seedCaloClus = seedPhoton->caloCluster(); if (!seedCaloClus) { ATH_MSG_WARNING("The seed egammaRec does not have a cluster"); return secondaryClusters; @@ -224,7 +224,7 @@ photonSuperClusterBuilder::searchForSecondaryClusters(std::size_t photonInd, } for (std::size_t vx = 0; vx < numVertices; ++vx) { - const auto vertex = seedPhoton->vertex(vx); + const auto *const vertex = seedPhoton->vertex(vx); const auto convType = xAOD::EgammaHelpers::conversionType(vertex); seedVertices.push_back(vertex); seedVertexType.push_back(convType); @@ -245,8 +245,8 @@ photonSuperClusterBuilder::searchForSecondaryClusters(std::size_t photonInd, continue; } - const auto egRec = egammaRecs->at(i); - const auto caloClus = egRec->caloCluster(); + const auto *const egRec = egammaRecs->at(i); + const auto *const caloClus = egRec->caloCluster(); if (!caloClus) { ATH_MSG_WARNING("The potentially secondary egammaRec does not have a cluster"); continue; @@ -309,7 +309,7 @@ photonSuperClusterBuilder::matchesVtxTrack( if (m_useOnlyLeadingTrack && numTestTracks > 0) { numTestTracks = 1; } - for (auto seedVertexTrack : seedVertexTracks) { + for (const auto *seedVertexTrack : seedVertexTracks) { // selected tracks alread are just Si if we are only looking at Si tracks for (size_t testTk = 0; testTk < numTestTracks; ++testTk) { if (seedVertexTrack == egRec->trackParticle(testTk)) { diff --git a/Reconstruction/egamma/egammaAlgs/src/topoEgammaBuilder.cxx b/Reconstruction/egamma/egammaAlgs/src/topoEgammaBuilder.cxx index ffcf15bbd734994bcb5cbef86934c634ee853660..1351748fb9d8418f0ff95488f03c51c8db96b769 100644 --- a/Reconstruction/egamma/egammaAlgs/src/topoEgammaBuilder.cxx +++ b/Reconstruction/egamma/egammaAlgs/src/topoEgammaBuilder.cxx @@ -231,18 +231,18 @@ topoEgammaBuilder::execute(const EventContext& ctx) const // Tools for ToolHandleArrays // First common photon/electron tools*/ - for (auto& tool : m_egammaTools) { + for (const auto & tool : m_egammaTools) { ATH_CHECK(CallTool(ctx, tool, electrons, photons)); } // Tools for only electrons if (m_doElectrons) { - for (auto& tool : m_electronTools) { + for (const auto & tool : m_electronTools) { ATH_CHECK(CallTool(ctx, tool, electrons, nullptr)); } } // Tools for only photons if (m_doPhotons) { - for (auto& tool : m_photonTools) { + for (const auto & tool : m_photonTools) { ATH_CHECK(CallTool(ctx, tool, nullptr, photons)); } } diff --git a/Reconstruction/egamma/egammaTools/src/EMClusterTool.cxx b/Reconstruction/egamma/egammaTools/src/EMClusterTool.cxx index 6e7d09fe994975c1dcdc619ea986202ec8943c54..d523fdb0e56b0701325c59104b98c3e129402dd3 100644 --- a/Reconstruction/egamma/egammaTools/src/EMClusterTool.cxx +++ b/Reconstruction/egamma/egammaTools/src/EMClusterTool.cxx @@ -144,13 +144,13 @@ EMClusterTool::contExecute(const EventContext& ctx, } // Now finalize the cluster: based on code in // CaloClusterStoreHelper::finalizeClusters - auto sg = outputClusterContainer.storeHandle().get(); + auto *sg = outputClusterContainer.storeHandle().get(); for (xAOD::CaloCluster* cl : *outputClusterContainer) { cl->setLink(outputClusterContainerCellLink.ptr(), sg); } if (m_doTopoSeededContainer) { - auto tssg = outputTopoSeededClusterContainer.storeHandle().get(); + auto *tssg = outputTopoSeededClusterContainer.storeHandle().get(); for (xAOD::CaloCluster* cl : *outputTopoSeededClusterContainer) { cl->setLink(outputTopoSeededClusterContainerCellLink.ptr(), tssg); } diff --git a/Reconstruction/egamma/egammaTools/src/egammaLargeClusterMaker.cxx b/Reconstruction/egamma/egammaTools/src/egammaLargeClusterMaker.cxx index 19be23762f1c50ebaf3cc8c770527424d5fcd360..f14bc25c976cfa82adf19e591c95ee60e7f09a42 100644 --- a/Reconstruction/egamma/egammaTools/src/egammaLargeClusterMaker.cxx +++ b/Reconstruction/egamma/egammaTools/src/egammaLargeClusterMaker.cxx @@ -54,7 +54,7 @@ egammaLargeClusterMaker::execute(const EventContext& ctx, ATH_CHECK(detStore()->retrieve(dd_man, "CaloMgr")); // The main loop over clusters - for (auto cluster : *inputClusters) { + for (const auto *cluster : *inputClusters) { // find the center of the cluster, copying the logic of // egammaMiddleShape.cxx