Skip to content

Commit 5bc86da

Browse files
vkucerarolavickabylinkin
authored
[PWGUD] Fix compilation warnings (#8388)
Co-authored-by: rolavick <roman.lavicka@cern.ch> Co-authored-by: Sasha Bylinkin <37345380+abylinkin@users.noreply.github.com>
1 parent 1509594 commit 5bc86da

12 files changed

+43
-40
lines changed

PWGUD/Core/DGPIDSelector.cxx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// In applying this license CERN does not waive the privileges and immunities
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
11-
11+
#include <vector>
1212
#include <string>
1313
#include "CommonConstants/PhysicsConstants.h"
1414
#include "DGPIDSelector.h"
@@ -144,7 +144,7 @@ void DGAnaparHolder::Print()
144144
LOGF(info, " max alpha: %f", mMaxAlpha);
145145
LOGF(info, " min system pT: %f", mMinptsys);
146146
LOGF(info, " max system pT: %f", mMaxptsys);
147-
LOGF(info, " nCombine: %d", mNCombine);
147+
LOGF(info, " nCombine: %zu", mNCombine);
148148
LOGF(info, " unlike charges");
149149
for (auto ch : mUnlikeCharges) {
150150
LOGF(info, " %i", ch);
@@ -236,7 +236,7 @@ void DGAnaparHolder::Setptsys(float min, float max)
236236
mMaxptsys = max;
237237
}
238238

239-
void DGAnaparHolder::SetnCombine(int nComb)
239+
void DGAnaparHolder::SetnCombine(std::size_t nComb)
240240
{
241241
mNCombine = nComb;
242242
}
@@ -300,7 +300,7 @@ void DGAnaparHolder::makeUniquePermutations()
300300
auto hash = hasher(std::string(hashstr));
301301
if (std::find(hashes.begin(), hashes.end(), hash) == hashes.end()) {
302302
hashes.push_back(hash);
303-
for (auto ii = 0; ii < mNCombine; ii++) {
303+
for (std::size_t ii = 0; ii < mNCombine; ii++) {
304304
muniquePerms.push_back(perm[ii]);
305305
}
306306
}
@@ -523,7 +523,7 @@ std::vector<std::vector<int>> DGPIDSelector::combinations(int nPool)
523523
for (auto comb : combs) {
524524
for (auto ii = 0u; ii < numUniquePerms; ii++) {
525525
std::vector<int> cope(mAnaPars.nCombine(), 0);
526-
for (auto jj = 0; jj < mAnaPars.nCombine(); jj++) {
526+
for (std::size_t jj = 0; jj < mAnaPars.nCombine(); jj++) {
527527
auto ind = ii * mAnaPars.nCombine() + jj;
528528
cope[uniquePerms[ind]] = comb[jj];
529529
}

PWGUD/Core/DGPIDSelector.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ struct DGAnaparHolder {
115115
float mineta = -2.0, float maxeta = 2.0,
116116
float minalpha = 0.0, float maxalpha = 3.2,
117117
float minptsys = 0.0, float maxptsys = 100.0,
118-
int nCombine = 2,
118+
std::size_t nCombine = 2,
119119
std::vector<int> netCharges = {0},
120120
std::vector<int> unlikeCharges = {0},
121121
std::vector<int> likeCharges = {-2, 2},
@@ -152,7 +152,7 @@ struct DGAnaparHolder {
152152
void Seteta(float, float);
153153
void SetAlpha(float, float);
154154
void Setptsys(float, float);
155-
void SetnCombine(int);
155+
void SetnCombine(std::size_t);
156156
void SetnetCharges(std::vector<int>);
157157
void SetunlikeCharges(std::vector<int>);
158158
void SetlikeCharges(std::vector<int>);
@@ -180,7 +180,7 @@ struct DGAnaparHolder {
180180
float maxAlpha() const { return mMaxAlpha; }
181181
float minptsys() const { return mMinptsys; }
182182
float maxptsys() const { return mMaxptsys; }
183-
int nCombine() const { return mNCombine; }
183+
std::size_t nCombine() const { return mNCombine; }
184184
std::vector<int> netCharges() const { return mNetCharges; }
185185
std::vector<int> unlikeCharges() const { return mUnlikeCharges; }
186186
std::vector<int> likeCharges() const { return mLikeCharges; }
@@ -216,7 +216,7 @@ struct DGAnaparHolder {
216216
float mMaxAlpha;
217217
float mMinptsys;
218218
float mMaxptsys;
219-
int mNCombine;
219+
std::size_t mNCombine;
220220
std::vector<int> mNetCharges; // all PV tracks
221221
std::vector<int> mUnlikeCharges; // selected PV tracks
222222
std::vector<int> mLikeCharges; // selected PV tracks

PWGUD/TableProducer/DGCandProducer.cxx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
//
1212
// \brief Saves relevant information of DG candidates
1313
// \author Paul Buehler, paul.buehler@oeaw.ac.at
14-
14+
#include <vector>
15+
#include <string>
16+
#include <map>
1517
#include "Framework/runDataProcessing.h"
1618
#include "Framework/AnalysisTask.h"
1719
#include "ReconstructionDataFormats/Vertex.h"
@@ -577,7 +579,6 @@ struct McDGCandProducer {
577579
auto dgcandAtEnd = dgcand == lastdgcand;
578580
auto mccolAtEnd = mccol == lastmccol;
579581
bool goon = !dgcandAtEnd || !mccolAtEnd;
580-
int counter = 0;
581582

582583
while (goon) {
583584
// check if dgcand has an associated Collision and McCollision
@@ -621,7 +622,6 @@ struct McDGCandProducer {
621622
// update UDMcColsLabels (for each UDCollision -> UDMcCollisions)
622623
LOGF(debug, " writing %d to outputMcCollsLabels", mcColIsSaved[mcdgId]);
623624
outputMcCollsLabels(mcColIsSaved[mcdgId]);
624-
counter++;
625625

626626
// update UDMcParticles
627627
auto mcPartsSlice = mcparts.sliceBy(mcPartsPerMcCollision, mcdgId);
@@ -637,7 +637,6 @@ struct McDGCandProducer {
637637
// update UDMcColsLabels (for each UDCollision -> UDMcCollisions)
638638
LOGF(debug, " writing %d to UDMcCollsLabels", -1);
639639
outputMcCollsLabels(-1);
640-
counter++;
641640

642641
// update UDMcParticles and UDMcTrackLabels (for each UDTrack -> UDMcParticles)
643642
// loop over tracks of dgcand

PWGUD/TableProducer/SGCandProducer.cxx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,6 @@ struct McSGCandProducer {
502502
auto sgcandAtEnd = sgcand == lastsgcand;
503503
auto mccolAtEnd = mccol == lastmccol;
504504
bool goon = !sgcandAtEnd || !mccolAtEnd;
505-
int counter = 0;
506505
while (goon) {
507506
auto bcIter = mccol.bc_as<BCs>();
508507
uint64_t globBC = bcIter.globalBC();
@@ -547,7 +546,6 @@ struct McSGCandProducer {
547546

548547
// update UDMcColsLabels (for each UDCollision -> UDMcCollisions)
549548
outputMcCollsLabels(mcColIsSaved[mcsgId]);
550-
counter++;
551549

552550
// update UDMcParticles
553551
auto mcPartsSlice = mcparts.sliceBy(mcPartsPerMcCollision, mcsgId);
@@ -563,7 +561,6 @@ struct McSGCandProducer {
563561

564562
// update UDMcColsLabels (for each UDCollision -> UDMcCollisions)
565563
outputMcCollsLabels(-1);
566-
counter++;
567564

568565
// update UDMcParticles and UDMcTrackLabels (for each UDTrack -> UDMcParticles)
569566
// loop over tracks of dgcand

PWGUD/TableProducer/UPCCandidateProducer.cxx

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ struct UpcCandProducer {
8181
Configurable<int> fFilterTVX{"filterTVX", -1, "Filter candidates by FT0 TVX"};
8282
Configurable<int> fFilterFV0{"filterFV0", -1, "Filter candidates by FV0A"};
8383

84-
Configurable<int> fBCWindowFITAmps{"bcWindowFITAmps", 20, "BC range for T0A/V0A amplitudes array [-range, +(range-1)]"};
84+
Configurable<uint64_t> fBCWindowFITAmps{"bcWindowFITAmps", 20, "BC range for T0A/V0A amplitudes array [-range, +(range-1)]"};
8585
Configurable<int> fBcWindowMCH{"bcWindowMCH", 20, "Time window for MCH-MID to MCH-only matching for Muon candidates"};
8686
Configurable<int> fBcWindowITSTPC{"bcWindowITSTPC", 20, "Time window for TOF/ITS-TPC to ITS-TPC matching for Central candidates"};
8787

@@ -884,7 +884,7 @@ struct UpcCandProducer {
884884
for (auto& pair : bcsMatchedTrIdsTOF) {
885885
auto globalBC = pair.first;
886886
auto& barrelTrackIDs = pair.second;
887-
int32_t nTOFs = barrelTrackIDs.size();
887+
uint32_t nTOFs = barrelTrackIDs.size();
888888
if (nTOFs > fNBarProngs) // too many tracks
889889
continue;
890890
auto closestBcITSTPC = std::numeric_limits<uint64_t>::max();
@@ -898,7 +898,7 @@ struct UpcCandProducer {
898898
if (std::abs(distClosestBcITSTPC) > fBcWindowITSTPC)
899899
continue;
900900
auto& itstpcTracks = itClosestBcITSTPC->second;
901-
int32_t nITSTPCs = itstpcTracks.size();
901+
uint32_t nITSTPCs = itstpcTracks.size();
902902
if ((nTOFs + nITSTPCs) != fNBarProngs)
903903
continue;
904904
barrelTrackIDs.insert(barrelTrackIDs.end(), itstpcTracks.begin(), itstpcTracks.end());
@@ -953,7 +953,7 @@ struct UpcCandProducer {
953953
for (auto& pair : bcsMatchedTrIdsITSTPC) {
954954
auto globalBC = pair.first;
955955
auto& barrelTrackIDs = pair.second;
956-
int32_t nThisITSTPCs = barrelTrackIDs.size();
956+
uint32_t nThisITSTPCs = barrelTrackIDs.size();
957957
if (nThisITSTPCs > fNBarProngs || nThisITSTPCs == 0) // too many tracks / already matched to TOF
958958
continue;
959959
auto closestBcITSTPC = std::numeric_limits<uint64_t>::max();
@@ -967,7 +967,7 @@ struct UpcCandProducer {
967967
if (std::abs(distClosestBcITSTPC) > fBcWindowITSTPC)
968968
continue;
969969
auto& itstpcTracks = itClosestBcITSTPC->second;
970-
int32_t nITSTPCs = itstpcTracks.size();
970+
uint32_t nITSTPCs = itstpcTracks.size();
971971
if ((nThisITSTPCs + nITSTPCs) != fNBarProngs)
972972
continue;
973973
barrelTrackIDs.insert(barrelTrackIDs.end(), itstpcTracks.begin(), itstpcTracks.end());
@@ -1208,7 +1208,7 @@ struct UpcCandProducer {
12081208
const std::map<uint64_t, int32_t>& mapBCs,
12091209
std::vector<float>& amps,
12101210
std::vector<int8_t>& relBCs,
1211-
int64_t gbc)
1211+
uint64_t gbc)
12121212
{
12131213
auto s = gbc - fBCWindowFITAmps;
12141214
auto e = gbc + (fBCWindowFITAmps - 1);
@@ -1344,7 +1344,7 @@ struct UpcCandProducer {
13441344
for (auto& pair : bcsMatchedTrIdsMID) { // candidates without MFT
13451345
auto globalBC = static_cast<int64_t>(pair.first);
13461346
const auto& fwdTrackIDs = pair.second; // only MID-matched tracks at the moment
1347-
int32_t nMIDs = fwdTrackIDs.size();
1347+
uint32_t nMIDs = fwdTrackIDs.size();
13481348
if (nMIDs > fNFwdProngs) // too many tracks
13491349
continue;
13501350
std::vector<int64_t> trkCandIDs{};
@@ -1359,7 +1359,7 @@ struct UpcCandProducer {
13591359
if (std::abs(distClosestBcMCH) > fBcWindowMCH)
13601360
continue;
13611361
auto& mchTracks = itClosestBcMCH->second;
1362-
int32_t nMCHs = mchTracks.size();
1362+
uint32_t nMCHs = mchTracks.size();
13631363
if ((nMCHs + nMIDs) != fNFwdProngs)
13641364
continue;
13651365
trkCandIDs.insert(trkCandIDs.end(), fwdTrackIDs.begin(), fwdTrackIDs.end());
@@ -1589,7 +1589,6 @@ struct UpcCandProducer {
15891589
auto nFT0s = mapGlobalBcWithT0A.size();
15901590
auto nFV0As = mapGlobalBcWithV0A.size();
15911591
auto nZdcs = mapGlobalBcWithZdc.size();
1592-
auto nBcsWithMID = bcsMatchedTrIdsMID.size();
15931592
auto nFDDs = mapGlobalBcWithFDD.size();
15941593

15951594
// todo: calculate position of UD collision?
@@ -1607,11 +1606,10 @@ struct UpcCandProducer {
16071606
for (auto& pair : bcsMatchedTrIdsGlobal) { // candidates with MFT
16081607
auto globalBC = static_cast<int64_t>(pair.first);
16091608
const auto& fwdTrackIDs = pair.second;
1610-
int32_t nMFTs = fwdTrackIDs.size();
1609+
uint32_t nMFTs = fwdTrackIDs.size();
16111610
if (nMFTs > fNFwdProngs) // too many tracks
16121611
continue;
16131612
std::vector<int64_t> trkCandIDs{};
1614-
auto midBC = static_cast<int64_t>(midIt->first);
16151613
const auto& midTrackIDs = midIt->second;
16161614
if (nMFTs == fNFwdProngs) {
16171615
for (auto iMft : fwdTrackIDs) {

PWGUD/Tasks/exclusivePhi.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
1111
//
12+
#include <vector>
1213
#include "Framework/runDataProcessing.h"
1314
#include "Framework/AnalysisTask.h"
1415
#include "Framework/AnalysisDataModel.h"
@@ -626,7 +627,7 @@ struct ExclusivePhi {
626627
// auto ksize = allTracksAreITSonlyAndFourITSclusters.size();
627628
registry.fill(HIST("hTracksITSonly"), allTracksAreITSonlyAndFourITSclusters.size());
628629

629-
for (int kaon = 0; kaon < allTracksAreITSonlyAndFourITSclusters.size(); kaon++) {
630+
for (std::size_t kaon = 0; kaon < allTracksAreITSonlyAndFourITSclusters.size(); kaon++) {
630631

631632
int clusterSize[7];
632633
double averageClusterSize = 0.;

PWGUD/Tasks/exclusivePhiLeptons.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// In applying this license CERN does not waive the privileges and immunities
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
11+
#include <vector>
1112
#include "Framework/runDataProcessing.h"
1213
#include "Framework/AnalysisTask.h"
1314
#include "Framework/AnalysisDataModel.h"
@@ -37,7 +38,7 @@ struct ExclusivePhiLeptons {
3738
Configurable<float> gap_Side{"gap", 2, "gap selection"};
3839
Configurable<float> pid2d_cut{"PID2D", 2., "PID cut in 2D"};
3940
Configurable<float> pid_cut{"PID", 2., "PID cut in 1D"};
40-
Configurable<int> electronsInTOF{"eTOF", 2, "electrons in TOF"};
41+
Configurable<std::size_t> electronsInTOF{"eTOF", 2, "electrons in TOF"};
4142
// defining histograms using histogram registry
4243
HistogramRegistry registry{"registry", {}, OutputObjHandlingPolicy::AnalysisObject};
4344

PWGUD/Tasks/sgExclusivePhi.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
1111
//
12+
#include <vector>
1213
#include "Framework/runDataProcessing.h"
1314
#include "Framework/AnalysisTask.h"
1415
#include "Framework/AnalysisDataModel.h"
@@ -679,7 +680,7 @@ struct sgExclusivePhi {
679680
// auto ksize = allTracksAreITSonlyAndFourITSclusters.size();
680681
registry.fill(HIST("hTracksITSonly"), allTracksAreITSonlyAndFourITSclusters.size());
681682

682-
for (int kaon = 0; kaon < allTracksAreITSonlyAndFourITSclusters.size(); kaon++) {
683+
for (std::size_t kaon = 0; kaon < allTracksAreITSonlyAndFourITSclusters.size(); kaon++) {
683684

684685
int clusterSize[7];
685686
double averageClusterSize = 0.;

PWGUD/Tasks/sgExclusivePhiITSselections.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
1111
//
12+
#include <vector>
1213
#include "Framework/runDataProcessing.h"
1314
#include "Framework/AnalysisTask.h"
1415
#include "Framework/AnalysisDataModel.h"
@@ -322,7 +323,7 @@ struct sgExclusivePhiITSselections {
322323
registry.fill(HIST("hdEdxKaon9"), momentum, dEdx);
323324
registry.fill(HIST("hTracksITSonly"), allTracksAreITSonlyAndFourITSclusters.size());
324325

325-
for (int kaon = 0; kaon < allTracksAreITSonlyAndFourITSclusters.size(); kaon++) {
326+
for (std::size_t kaon = 0; kaon < allTracksAreITSonlyAndFourITSclusters.size(); kaon++) {
326327

327328
int clusterSize[7];
328329
double averageClusterSize = 0.;

PWGUD/Tasks/sgPIDAnalyzer.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ struct sgPIDAnalyzer {
113113
histos.add("TOF/nMu", "Negative TPC Mu vs TOF El vs pt", {HistType::kTH3F, {ptBins, nSigmaBins, nSigmaBins}});
114114
}
115115

116-
void process(aod::SGEvents const& events, aod::SGTracks const& tracks)
116+
void process(aod::SGEvents const&, aod::SGTracks const& tracks)
117117
{
118118
for (const auto& track : tracks) {
119119
if (track.eta() < eta_min || track.eta() > eta_max)

0 commit comments

Comments
 (0)