Skip to content

Commit e46e95e

Browse files
committed
fixing shadow variables/members
1 parent e6251ad commit e46e95e

2 files changed

Lines changed: 17 additions & 17 deletions

File tree

PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -946,12 +946,12 @@ struct TableMakerMC {
946946
VarManager::FillTrackMC(mcTracks, mctrack);
947947

948948
mcflags = 0;
949-
int i = 0; // runs over the MC signals
949+
int isig = 0; // runs over the MC signals
950950
int j = 0; // runs over the track cuts
951951
// check all the specified signals and fill histograms for MC truth matched tracks
952952
for (const auto& sig : fMCSignals) {
953953
if (sig->CheckSignal(true, mctrack)) {
954-
mcflags |= (static_cast<uint16_t>(1) << i);
954+
mcflags |= (static_cast<uint16_t>(1) << isig);
955955
// If detailed QA is on, fill histograms for each MC signal and track cut combination
956956
if (fDoDetailedQA) {
957957
j = 0;
@@ -963,7 +963,7 @@ struct TableMakerMC {
963963
}
964964
}
965965
}
966-
i++;
966+
isig++;
967967
}
968968

969969
// if the MC truth particle corresponding to this reconstructed track is not already written,
@@ -1193,12 +1193,12 @@ struct TableMakerMC {
11931193
VarManager::FillTrackMC(mcTracks, mctrack);
11941194

11951195
mcflags = 0;
1196-
int i = 0; // runs over the MC signals
1196+
int isig = 0; // runs over the MC signals
11971197
int j = 0; // runs over the track cuts
11981198
// check all the specified signals and fill histograms for MC truth matched tracks
11991199
for (const auto& sig : fMCSignals) {
12001200
if (sig->CheckSignal(true, mctrack)) {
1201-
mcflags |= (static_cast<uint16_t>(1) << i);
1201+
mcflags |= (static_cast<uint16_t>(1) << isig);
12021202
if (fDoDetailedQA) {
12031203
j = 0;
12041204
for (const auto& cut : fMuonCuts) {
@@ -1209,7 +1209,7 @@ struct TableMakerMC {
12091209
}
12101210
} // end if do detailed QA
12111211
}
1212-
i++;
1212+
isig++;
12131213
} // end loop over MC signals
12141214

12151215
// if the MC truth particle corresponding to this reconstructed muon is not already written,
@@ -1552,8 +1552,8 @@ struct TableMakerMC {
15521552
for (auto label = eventLabels.begin(); label != eventLabels.end(); label++, ib++) {
15531553
histEvents->GetXaxis()->SetBinLabel(ib, (*label).Data());
15541554
}
1555-
for (int ib = 1; ib <= o2::aod::evsel::kNsel; ib++) {
1556-
histEvents->GetYaxis()->SetBinLabel(ib, o2::aod::evsel::selectionLabels[ib - 1]);
1555+
for (int iy = 1; iy <= o2::aod::evsel::kNsel; iy++) {
1556+
histEvents->GetYaxis()->SetBinLabel(iy, o2::aod::evsel::selectionLabels[iy - 1]);
15571557
}
15581558
histEvents->GetYaxis()->SetBinLabel(o2::aod::evsel::kNsel + 1, "Total");
15591559
fStatsList->Add(histEvents);
@@ -1565,8 +1565,8 @@ struct TableMakerMC {
15651565
histTracks->GetXaxis()->SetBinLabel(ib, (*cut)->GetName());
15661566
}
15671567
constexpr std::array<const char*, 5> v0TagNames = {"Photon conversion", "K^{0}_{s}", "#Lambda", "#bar{#Lambda}", "#Omega"};
1568-
for (int ib = 0; ib < 5; ib++) {
1569-
histTracks->GetXaxis()->SetBinLabel(fTrackCuts.size() + 1 + ib, v0TagNames[ib]);
1568+
for (int iv0 = 0; iv0 < 5; iv0++) {
1569+
histTracks->GetXaxis()->SetBinLabel(fTrackCuts.size() + 1 + iv0, v0TagNames[iv0]);
15701570
}
15711571
fStatsList->Add(histTracks);
15721572
TH1I* histMuons = new TH1I("MuonStats", "Muon statistics", fMuonCuts.size(), -0.5, fMuonCuts.size() - 0.5);

PWGDQ/TableProducer/tableMaker_withAssoc.cxx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -671,8 +671,8 @@ struct TableMaker {
671671
for (auto label = eventLabels.begin(); label != eventLabels.end(); label++, ib++) {
672672
histEvents->GetXaxis()->SetBinLabel(ib, (*label).Data());
673673
}
674-
for (int ib = 1; ib <= o2::aod::evsel::kNsel; ib++) {
675-
histEvents->GetYaxis()->SetBinLabel(ib, o2::aod::evsel::selectionLabels[ib - 1]);
674+
for (int iy = 1; iy <= o2::aod::evsel::kNsel; iy++) {
675+
histEvents->GetYaxis()->SetBinLabel(iy, o2::aod::evsel::selectionLabels[iy - 1]);
676676
}
677677
histEvents->GetYaxis()->SetBinLabel(o2::aod::evsel::kNsel + 1, "Total");
678678
fStatsList->AddAt(histEvents, kStatsEvent);
@@ -717,7 +717,7 @@ struct TableMaker {
717717
}
718718

719719
template <typename TEvents, typename TTracks, typename TBCs>
720-
void computeOccupancyEstimators(TEvents const& collisions, Partition<TTracks> const& tracksPos, Partition<TTracks> const& tracksNeg, Preslice<TTracks>& preslice, TBCs const&)
720+
void computeOccupancyEstimators(TEvents const& collisions, Partition<TTracks> const& tracksPosPart, Partition<TTracks> const& tracksNegPart, Preslice<TTracks>& presliceTracks, TBCs const&)
721721
{
722722

723723
// clear the occupancy maps for this time frame
@@ -765,8 +765,8 @@ struct TableMaker {
765765
}
766766

767767
// make a slice for this collision and get the number of tracks
768-
auto thisCollTrackPos = tracksPos.sliceBy(preslice, collision.globalIndex());
769-
auto thisCollTrackNeg = tracksNeg.sliceBy(preslice, collision.globalIndex());
768+
auto thisCollTrackPos = tracksPosPart.sliceBy(presliceTracks, collision.globalIndex());
769+
auto thisCollTrackNeg = tracksNegPart.sliceBy(presliceTracks, collision.globalIndex());
770770
collMultPos[collision.globalIndex()] = thisCollTrackPos.size();
771771
collMultNeg[collision.globalIndex()] = thisCollTrackNeg.size();
772772
}
@@ -908,7 +908,7 @@ struct TableMaker {
908908
}
909909

910910
template <typename TEvents, typename TTracks>
911-
void computeCollMergingTag(TEvents const& collisions, TTracks const& tracks, Preslice<TTracks>& preslice)
911+
void computeCollMergingTag(TEvents const& collisions, TTracks const& tracks, Preslice<TTracks>& presliceTracks)
912912
{
913913
// This function uses the standard track-collision association to compute quantities related to collision merging
914914
// clear the maps for this time frame
@@ -941,7 +941,7 @@ struct TableMaker {
941941

942942
for (const auto& collision : collisions) {
943943
// make a slice for this collision and compute the DCAz based event quantities
944-
auto thisCollTracks = tracks.sliceBy(preslice, collision.globalIndex());
944+
auto thisCollTracks = tracks.sliceBy(presliceTracks, collision.globalIndex());
945945
VarManager::FillEventTracks(thisCollTracks); // fill the VarManager arrays with the information of the tracks associated to this collision, needed for the cuts and histograms
946946
// add the computed variables to the maps with the collision index as key
947947
fCollMergingTag.bimodalityCoeffDCAz[collision.globalIndex()] = VarManager::fgValues[VarManager::kDCAzBimodalityCoefficient];

0 commit comments

Comments
 (0)