Skip to content
Snippets Groups Projects
Commit 6b0cd0ed authored by scott snyder's avatar scott snyder Committed by scott snyder
Browse files

InDetPhysValMonitoring: Fix clang warnings.

    
Don't use references in a range-for if the object must be copied.
parent 9fa58fe0
No related branches found
No related tags found
No related merge requests found
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
/**
......@@ -174,7 +174,7 @@ InDetPhysHitDecoratorAlg::decorateTrack(const xAOD::TrackParticle &particle,
}
ATH_MSG_DEBUG("Num. track states in track " << ++trackNumber << ": " << allTrackStates.size());
for (const auto& thisTrackState: allTrackStates) {
for (const auto thisTrackState: allTrackStates) {
// Copy logic from InDetRttPerformance to get hits/outliers/holes
// Variable specifying measurement type filled
SingleResult_t thisResult(invalidResult);
......
......@@ -300,7 +300,7 @@ InDetPhysValMonitoringTool::fillHistograms() {
std::vector<const xAOD::TrackParticle*> selectedTracks {};
selectedTracks.reserve(tracks->size());
unsigned int nTrackBAT = 0, nTrackSTD = 0, nTrackANT = 0, nTrackTOT = 0;
for (const auto& thisTrack: *tracks) {
for (const auto thisTrack: *tracks) {
//FIXME: Why is this w.r.t the primary vertex?
const asg::AcceptData& accept = m_trackSelectionTool->accept(*thisTrack, primaryvertex);
if (m_useTrackSelection and not accept) continue;
......@@ -488,7 +488,7 @@ InDetPhysValMonitoringTool::fillHistograms() {
"Cannot open " << m_jetContainerName <<
" jet container or TruthParticles truth particle container. Skipping jet plots.");
} else {
for (const auto& thisJet: *jets) { // The big jets loop
for (const auto thisJet: *jets) { // The big jets loop
if (not passJetCuts(*thisJet)) {
continue;
}
......@@ -741,7 +741,7 @@ InDetPhysValMonitoringTool::getTruthVertices() const {
ATH_MSG_VERBOSE("Getting TruthEvents container.");
SG::ReadHandle<xAOD::TruthEventContainer> truthEventContainer(m_truthEventName);
if (truthEventContainer.isValid()) {
for (const auto& evt : *truthEventContainer) {
for (const auto evt : *truthEventContainer) {
truthVtx = evt->truthVertex(0);
if (truthVtx) {
truthHSVertices.push_back(truthVtx);
......@@ -759,7 +759,7 @@ InDetPhysValMonitoringTool::getTruthVertices() const {
ATH_MSG_VERBOSE("Getting TruthEvents container.");
SG::ReadHandle<xAOD::TruthPileupEventContainer> truthPileupEventContainer(m_truthPileUpEventName);
if (truthPileupEventContainer.isValid()) {
for (const auto& evt : *truthPileupEventContainer) {
for (const auto evt : *truthPileupEventContainer) {
truthVtx = evt->truthVertex(0);
if (truthVtx) {
truthPUVertices.push_back(truthVtx);
......
/*
Copyright (C) 2020 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2020, 2021 CERN for the benefit of the ATLAS collaboration
*/
/**
......@@ -114,7 +114,7 @@ int postProcessDir(TDirectory* dir, IDPVM::ResolutionHelper & theHelper){
// walk through all keys in this directory
dir->cd();
auto keys = dir->GetListOfKeys();
for (const auto & key : *keys){
for (const auto key : *keys){
TObject* gotIt = dir->Get(key->GetName());
// if we encounter a directory, descend into it and repeat the process
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment