Skip to content

Commit c19d54e

Browse files
authored
PWGHF, RecoDecay: Fix compilation warnings (#303)
* RecoDecay: Fix compilation warnings * PWGHF: Fix compilation warnings
1 parent a4b82ac commit c19d54e

18 files changed

Lines changed: 79 additions & 82 deletions

Common/Core/RecoDecay.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,8 @@ class RecoDecay
425425
{
426426
array<double, 3> momTotal{0., 0., 0.}; // candidate momentum vector
427427
double energyTot{0.}; // candidate energy
428-
for (auto iProng = 0; iProng < N; ++iProng) {
429-
for (auto iMom = 0; iMom < 3; ++iMom) {
428+
for (std::size_t iProng = 0; iProng < N; ++iProng) {
429+
for (std::size_t iMom = 0; iMom < 3; ++iMom) {
430430
momTotal[iMom] += arrMom[iProng][iMom];
431431
} // loop over momentum components
432432
energyTot += E(arrMom[iProng], arrMass[iProng]);
@@ -505,7 +505,7 @@ class RecoDecay
505505
{
506506
auto decLenXY = distanceXY(posPV, posSV);
507507
double maxNormDeltaIP{0.};
508-
for (auto iProng = 0; iProng < N; ++iProng) {
508+
for (std::size_t iProng = 0; iProng < N; ++iProng) {
509509
auto prongNormDeltaIP = normImpParMeasMinusExpProng(decLenXY, errDecLenXY, momMother, arrImpPar[iProng],
510510
arrErrImpPar[iProng], arrMom[iProng]);
511511
if (std::abs(prongNormDeltaIP) > std::abs(maxNormDeltaIP)) {
@@ -723,7 +723,7 @@ class RecoDecay
723723
*sign = sgn;
724724
}
725725
// Loop over decay candidate prongs
726-
for (auto iProng = 0; iProng < N; ++iProng) {
726+
for (std::size_t iProng = 0; iProng < N; ++iProng) {
727727
auto particleI = arrDaughters[iProng].mcParticle(); // ith daughter particle
728728
arrDaughtersIndex[iProng] = particleI.globalIndex();
729729
// Get the list of daughter indices from the mother of the first prong.
@@ -746,7 +746,7 @@ class RecoDecay
746746
return -1;
747747
}
748748
// Check that the number of direct daughters is not larger than the number of expected final daughters.
749-
if (indexDaughterFirst > -1 && indexDaughterLast > -1 && indexDaughterLast - indexDaughterFirst + 1 > N) {
749+
if (indexDaughterFirst > -1 && indexDaughterLast > -1 && indexDaughterLast - indexDaughterFirst + 1 > int(N)) {
750750
//Printf("MC Rec: Rejected: too many direct daughters: %d (expected %ld final)", indexDaughterLast - indexDaughterFirst + 1, N);
751751
return -1;
752752
}
@@ -766,7 +766,7 @@ class RecoDecay
766766
// Check that the daughter is in the list of final daughters.
767767
// (Check that the daughter is not a stepdaughter, i.e. particle pointing to the mother while not being its daughter.)
768768
bool isDaughterFound = false; // Is the index of this prong among the remaining expected indices of daughters?
769-
for (auto iD = 0; iD < arrAllDaughtersIndex.size(); ++iD) {
769+
for (std::size_t iD = 0; iD < arrAllDaughtersIndex.size(); ++iD) {
770770
if (arrDaughtersIndex[iProng] == arrAllDaughtersIndex[iD]) {
771771
arrAllDaughtersIndex[iD] = -1; // Remove this index from the array of expected daughters. (Rejects twin daughters, i.e. particle considered twice as a daughter.)
772772
isDaughterFound = true;
@@ -781,7 +781,7 @@ class RecoDecay
781781
auto PDGParticleI = particleI.pdgCode(); // PDG code of the ith daughter
782782
//Printf("MC Rec: Daughter %d PDG: %d", iProng, PDGParticleI);
783783
bool isPDGFound = false; // Is the PDG code of this daughter among the remaining expected PDG codes?
784-
for (auto iProngCp = 0; iProngCp < N; ++iProngCp) {
784+
for (std::size_t iProngCp = 0; iProngCp < N; ++iProngCp) {
785785
if (PDGParticleI == sgn * arrPDGDaughters[iProngCp]) {
786786
arrPDGDaughters[iProngCp] = 0; // Remove this PDG code from the array of expected ones.
787787
isPDGFound = true;
@@ -866,7 +866,7 @@ class RecoDecay
866866
return false;
867867
}
868868
// Check that the number of direct daughters is not larger than the number of expected final daughters.
869-
if (indexDaughterFirst > -1 && indexDaughterLast > -1 && indexDaughterLast - indexDaughterFirst + 1 > N) {
869+
if (indexDaughterFirst > -1 && indexDaughterLast > -1 && indexDaughterLast - indexDaughterFirst + 1 > int(N)) {
870870
//Printf("MC Gen: Rejected: too many direct daughters: %d (expected %ld final)", indexDaughterLast - indexDaughterFirst + 1, N);
871871
return false;
872872
}
@@ -888,7 +888,7 @@ class RecoDecay
888888
auto PDGCandidateDaughterI = candidateDaughterI.pdgCode(); // PDG code of the ith daughter
889889
//Printf("MC Gen: Daughter %d PDG: %d", indexDaughterI, PDGCandidateDaughterI);
890890
bool isPDGFound = false; // Is the PDG code of this daughter among the remaining expected PDG codes?
891-
for (auto iProngCp = 0; iProngCp < N; ++iProngCp) {
891+
for (std::size_t iProngCp = 0; iProngCp < N; ++iProngCp) {
892892
if (PDGCandidateDaughterI == sgn * arrPDGDaughters[iProngCp]) {
893893
arrPDGDaughters[iProngCp] = 0; // Remove this PDG code from the array of expected ones.
894894
isPDGFound = true;

PWGHF/TableProducer/HFCandidateCreator2Prong.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ struct HFCandidateCreator2Prong {
7777
}
7878
const auto& secondaryVertex = df.getPCACandidate();
7979
auto chi2PCA = df.getChi2AtPCACandidate();
80-
auto covMatrixPCA = df.calcPCACovMatrix().Array();
80+
auto covMatrixPCA = df.calcPCACovMatrixFlat();
8181
hCovSVXX->Fill(covMatrixPCA[0]); // FIXME: Calculation of errorDecayLength(XY) gives wrong values without this line.
8282
auto trackParVar0 = df.getTrack(0);
8383
auto trackParVar1 = df.getTrack(1);

PWGHF/TableProducer/HFCandidateCreator3Prong.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ struct HFCandidateCreator3Prong {
8484
}
8585
const auto& secondaryVertex = df.getPCACandidate();
8686
auto chi2PCA = df.getChi2AtPCACandidate();
87-
auto covMatrixPCA = df.calcPCACovMatrix().Array();
87+
auto covMatrixPCA = df.calcPCACovMatrixFlat();
8888
hCovSVXX->Fill(covMatrixPCA[0]); // FIXME: Calculation of errorDecayLength(XY) gives wrong values without this line.
8989
trackParVar0 = df.getTrack(0);
9090
trackParVar1 = df.getTrack(1);

PWGHF/TableProducer/HFCandidateCreatorBPlus.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ struct HfCandidateCreatorBplus {
130130
auto trackD0 = o2::dataformats::V0(vertexD0, momentumD0, pCovMatrixD0, prong0TrackParCov, prong1TrackParCov, {0, 0}, {0, 0});
131131

132132
//loop over tracks for pi selection
133-
auto count = 0;
133+
//auto count = 0;
134134
for (auto& track : tracks) {
135135
//if(count % 100 == 0){
136136
//LOGF(info, "Col: %d (cand); %d (track)", candidate.collisionId(), track.collisionId());
@@ -168,7 +168,7 @@ struct HfCandidateCreatorBplus {
168168
bfitter.getTrack(1).getPxPyPzGlo(pVecBach); //momentum of pi+ at the B+ vertex
169169
const auto& BSecVertex = bfitter.getPCACandidate();
170170
auto chi2PCA = bfitter.getChi2AtPCACandidate();
171-
auto covMatrixPCA = bfitter.calcPCACovMatrix().Array();
171+
auto covMatrixPCA = bfitter.calcPCACovMatrixFlat();
172172
hCovSVXX->Fill(covMatrixPCA[0]); //FIXME: Calculation of errorDecayLength(XY) gives wrong values without this line.
173173

174174
pVecBCand = RecoDecay::PVec(pVecD0, pVecBach);

PWGHF/TableProducer/HFCandidateCreatorCascade.cxx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ using MyBigTracks = aod::BigTracks;
4848

4949
/// Reconstruction of heavy-flavour cascade decay candidates
5050
struct HFCandidateCreatorCascade {
51-
5251
Produces<aod::HfCandCascBase> rowCandidateBase;
5352

5453
Configurable<double> bZ{"bZ", 5., "magnetic field"};
@@ -138,7 +137,7 @@ struct HFCandidateCreatorCascade {
138137

139138
const auto& secondaryVertex = df.getPCACandidate();
140139
auto chi2PCA = df.getChi2AtPCACandidate();
141-
auto covMatrixPCA = df.calcPCACovMatrix().Array();
140+
auto covMatrixPCA = df.calcPCACovMatrixFlat();
142141
hCovSVXX->Fill(covMatrixPCA[0]); // FIXME: Calculation of errorDecayLength(XY) gives wrong values without this line.
143142
// do I have to call "df.propagateTracksToVertex();"?
144143
auto trackParVarV0 = df.getTrack(0);
@@ -240,11 +239,10 @@ struct HFCandidateCreatorCascadeMC {
240239
LOG(debug) << "\n";
241240
LOG(debug) << "Checking MC for candidate!";
242241
LOG(debug) << "Looking for K0s";
242+
#ifdef MY_DEBUG
243243
auto indexV0DaughPos = trackV0DaughPos.mcParticleId();
244244
auto indexV0DaughNeg = trackV0DaughNeg.mcParticleId();
245245
auto indexBach = bach.mcParticleId();
246-
247-
#ifdef MY_DEBUG
248246
bool isLc = isLcK0SpFunc(indexBach, indexV0DaughPos, indexV0DaughNeg, indexProton, indexK0Spos, indexK0Sneg);
249247
bool isK0SfromLc = isK0SfromLcFunc(indexV0DaughPos, indexV0DaughNeg, indexK0Spos, indexK0Sneg);
250248
#endif
@@ -275,7 +273,7 @@ struct HFCandidateCreatorCascadeMC {
275273
// checking that the final daughters (decay depth = 3) are p, pi+, pi-
276274
RecoDecay::getDaughters(particlesMC, particle, &arrDaughLcIndex, arrDaughLcPDGRef, 3); // best would be to check the K0S daughters
277275
if (arrDaughLcIndex.size() == 3) {
278-
for (auto iProng = 0; iProng < arrDaughLcIndex.size(); ++iProng) {
276+
for (std::size_t iProng = 0; iProng < arrDaughLcIndex.size(); ++iProng) {
279277
auto daughI = particlesMC.iteratorAt(arrDaughLcIndex[iProng]);
280278
arrDaughLcPDG[iProng] = daughI.pdgCode();
281279
}

PWGHF/TableProducer/HFCandidateCreatorChic.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ struct HFCandidateCreatorChic {
150150
trackJpsi.propagateToDCA(primaryVertex, magneticField, &impactParameter0);
151151

152152
// get uncertainty of the decay length
153-
double phi, theta;
153+
//double phi, theta;
154154
// getPointDirection(array{collision.posX(), collision.posY(), collision.posZ()}, ChicsecondaryVertex, phi, theta);
155155
//auto errorDecayLength = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, theta) + getRotatedCovMatrixXX(covMatrixPCA, phi, theta));
156156
//auto errorDecayLengthXY = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, 0.) + getRotatedCovMatrixXX(covMatrixPCA, phi, 0.));
@@ -211,7 +211,7 @@ struct HFCandidateCreatorChicMC {
211211
aod::ECALs const& ecals)
212212
{
213213
int indexRec = -1;
214-
int8_t sign = 0;
214+
//int8_t sign = 0;
215215
int8_t flag = 0;
216216
int8_t origin = 0;
217217
int8_t channel = 0;

PWGHF/TableProducer/HFCandidateCreatorLb.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ struct HFCandidateCreatorLb {
135135
int index0Lc = track0.globalIndex();
136136
int index1Lc = track1.globalIndex();
137137
int index2Lc = track2.globalIndex();
138-
int charge = track0.sign() + track1.sign() + track2.sign();
138+
//int charge = track0.sign() + track1.sign() + track2.sign();
139139

140140
for (auto& trackPion : tracks) {
141141
if (trackPion.pt() < ptPionMin) {
@@ -159,7 +159,7 @@ struct HFCandidateCreatorLb {
159159
// calculate relevant properties
160160
const auto& secondaryVertexLb = df2.getPCACandidate();
161161
auto chi2PCA = df2.getChi2AtPCACandidate();
162-
auto covMatrixPCA = df2.calcPCACovMatrix().Array();
162+
auto covMatrixPCA = df2.calcPCACovMatrixFlat();
163163

164164
df2.propagateTracksToVertex();
165165
df2.getTrack(0).getPxPyPzGlo(pvecLc);

PWGHF/TableProducer/HFCandidateCreatorX.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ struct HFCandidateCreatorX {
175175
// calculate relevant properties
176176
const auto& XsecondaryVertex = df3.getPCACandidate();
177177
auto chi2PCA = df3.getChi2AtPCACandidate();
178-
auto covMatrixPCA = df3.calcPCACovMatrix().Array();
178+
auto covMatrixPCA = df3.calcPCACovMatrixFlat();
179179
hCovSVXX->Fill(covMatrixPCA[0]); // FIXME: Calculation of errorDecayLength(XY) gives wrong values without this line.
180180

181181
df3.propagateTracksToVertex(); // propagate the pions and Jpsi to the X vertex

PWGHF/TableProducer/HFCandidateCreatorXicc.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ struct HfCandidateCreatorXicc {
147147
// calculate relevant properties
148148
const auto& secondaryVertexXicc = df2.getPCACandidate();
149149
auto chi2PCA = df2.getChi2AtPCACandidate();
150-
auto covMatrixPCA = df2.calcPCACovMatrix().Array();
150+
auto covMatrixPCA = df2.calcPCACovMatrixFlat();
151151

152152
df2.propagateTracksToVertex();
153153
df2.getTrack(0).getPxPyPzGlo(pvecxic);

PWGHF/TableProducer/HFD0CandidateSelectorALICE3Forward.cxx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@ struct HFD0CandidateSelectorALICE3Forward {
215215
auto trackPos = candidate.index0_as<Trks>();
216216
auto trackNeg = candidate.index1_as<Trks>();
217217

218-
auto momentumPosTrack = trackPos.p();
219-
auto momentumNegTrack = trackNeg.p();
218+
//auto momentumPosTrack = trackPos.p();
219+
//auto momentumNegTrack = trackNeg.p();
220220

221221
bool topolD0 = selectionTopolConjugate(candidate, trackPos, trackNeg);
222222
bool topolD0bar = selectionTopolConjugate(candidate, trackNeg, trackPos);
@@ -226,9 +226,9 @@ struct HFD0CandidateSelectorALICE3Forward {
226226
continue;
227227
}
228228

229-
float nsigmaTOFNegKaon = -5000.0;
229+
//float nsigmaTOFNegKaon = -5000.0;
230230
float nsigmaRICHNegKaon = -5000.0;
231-
float nsigmaTOFPosPion = -5000.0;
231+
//float nsigmaTOFPosPion = -5000.0;
232232
float nsigmaRICHPosPion = -5000.0;
233233

234234
if (trackPos.has_frich()) {
@@ -239,8 +239,8 @@ struct HFD0CandidateSelectorALICE3Forward {
239239
nsigmaRICHNegKaon = trackNeg.frich().frichNsigmaKa();
240240
}
241241

242-
bool selectPionTOFplusRICH = false;
243-
bool selectKaonTOFplusRICH = false;
242+
//bool selectPionTOFplusRICH = false;
243+
//bool selectKaonTOFplusRICH = false;
244244

245245
if (topolD0) {
246246
statusD0NoPID = 1;

0 commit comments

Comments
 (0)