Skip to content

Commit 17bf4a5

Browse files
author
fcolamar
committed
Clang fixes
1 parent b573546 commit 17bf4a5

File tree

4 files changed

+71
-77
lines changed

4 files changed

+71
-77
lines changed

ALICE3/DataModel/A3DecayFinderTables.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ using Alice3DecayMap = Alice3DecayMaps::iterator;
6363
namespace a3D0meson
6464
{
6565
DECLARE_SOA_INDEX_COLUMN(Collision, collision); //!
66-
DECLARE_SOA_COLUMN(PxProng0, pxProng0, float); //! positive track
67-
DECLARE_SOA_COLUMN(PyProng0, pyProng0, float); //!
68-
DECLARE_SOA_COLUMN(PzProng0, pzProng0, float); //!
69-
DECLARE_SOA_COLUMN(PxProng1, pxProng1, float); //! negative track
70-
DECLARE_SOA_COLUMN(PyProng1, pyProng1, float); //!
71-
DECLARE_SOA_COLUMN(PzProng1, pzProng1, float); //!
72-
DECLARE_SOA_DYNAMIC_COLUMN(PtProng0, ptProng0, //!
66+
DECLARE_SOA_COLUMN(PxProng0, pxProng0, float); //! positive track
67+
DECLARE_SOA_COLUMN(PyProng0, pyProng0, float); //!
68+
DECLARE_SOA_COLUMN(PzProng0, pzProng0, float); //!
69+
DECLARE_SOA_COLUMN(PxProng1, pxProng1, float); //! negative track
70+
DECLARE_SOA_COLUMN(PyProng1, pyProng1, float); //!
71+
DECLARE_SOA_COLUMN(PzProng1, pzProng1, float); //!
72+
DECLARE_SOA_DYNAMIC_COLUMN(PtProng0, ptProng0, //!
7373
[](float px, float py) -> float { return RecoDecay::pt(px, py); });
7474
DECLARE_SOA_DYNAMIC_COLUMN(PtProng1, ptProng1, //!
7575
[](float px, float py) -> float { return RecoDecay::pt(px, py); });
@@ -80,8 +80,8 @@ DECLARE_SOA_EXPRESSION_COLUMN(Py, py, //!
8080
DECLARE_SOA_EXPRESSION_COLUMN(Pz, pz, //!
8181
float, 1.f * aod::a3D0meson::pzProng0 + 1.f * aod::a3D0meson::pzProng1);
8282
DECLARE_SOA_COLUMN(Pt, pt, float); //!
83-
DECLARE_SOA_COLUMN(M, m, float); //!
84-
DECLARE_SOA_DYNAMIC_COLUMN(E, e, //!
83+
DECLARE_SOA_COLUMN(M, m, float); //!
84+
DECLARE_SOA_DYNAMIC_COLUMN(E, e, //!
8585
[](float px, float py, float pz, double m) -> float { return RecoDecay::e(px, py, pz, m); });
8686
DECLARE_SOA_COLUMN(Eta, eta, float); //!
8787
DECLARE_SOA_COLUMN(Phi, phi, float); //!
@@ -90,8 +90,8 @@ DECLARE_SOA_COLUMN(Y, y, float);
9090
DECLARE_SOA_TABLE(Alice3D0Meson, "AOD", "ALICE3D0MESON", //!
9191
o2::soa::Index<>,
9292
a3D0meson::CollisionId,
93-
a3D0meson::PxProng0, a3D0meson::PyProng0, a3D0meson::PzProng0, //positive track
94-
a3D0meson::PxProng1, a3D0meson::PyProng1, a3D0meson::PzProng1, //negative track
93+
a3D0meson::PxProng0, a3D0meson::PyProng0, a3D0meson::PzProng0, // positive track
94+
a3D0meson::PxProng1, a3D0meson::PyProng1, a3D0meson::PzProng1, // negative track
9595
a3D0meson::PtProng0<a3D0meson::PxProng0, a3D0meson::PyProng0>,
9696
a3D0meson::PtProng1<a3D0meson::PxProng1, a3D0meson::PyProng1>,
9797
a3D0meson::Px, a3D0meson::Py, a3D0meson::Pz,
@@ -104,20 +104,20 @@ DECLARE_SOA_TABLE(Alice3D0Meson, "AOD", "ALICE3D0MESON", //!
104104

105105
namespace a3D0Selection
106106
{
107-
DECLARE_SOA_COLUMN(IsSelD0, isSelD0, int); //!
108-
DECLARE_SOA_COLUMN(IsSelD0bar, isSelD0bar, int); //!
107+
DECLARE_SOA_COLUMN(IsSelD0, isSelD0, int); //!
108+
DECLARE_SOA_COLUMN(IsSelD0bar, isSelD0bar, int); //!
109109
} // namespace a3D0Selection
110110
DECLARE_SOA_TABLE(Alice3D0Sel, "AOD", "ALICE3D0SEL", //!
111111
a3D0Selection::IsSelD0,
112112
a3D0Selection::IsSelD0bar);
113113

114114
namespace a3D0MCTruth
115115
{
116-
DECLARE_SOA_COLUMN(McTruthInfo, mcTruthInfo, int); //! 0 for bkg, 1 for true D0, 2 for true D0bar
116+
DECLARE_SOA_COLUMN(McTruthInfo, mcTruthInfo, int); //! 0 for bkg, 1 for true D0, 2 for true D0bar
117117
} // namespace a3D0MCTruth
118118
DECLARE_SOA_TABLE(Alice3D0MCTruth, "AOD", "ALICE3D0MCTRUTH", //!
119-
a3D0MCTruth::McTruthInfo); //!
119+
a3D0MCTruth::McTruthInfo); //!
120120

121121
} // namespace o2::aod
122122

123-
#endif // ALICE3_DATAMODEL_A3DECAYFINDERTABLES_H_
123+
#endif // ALICE3_DATAMODEL_A3DECAYFINDERTABLES_H_

ALICE3/TableProducer/alice3-correlatorDDbar.cxx

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828

2929
#include "PWGHF/Core/HfHelper.h"
3030
#include "PWGHF/HFC/DataModel/CorrelationTables.h"
31-
//#include "PWGHF/DataModel/CandidateReconstructionTables.h"
32-
//#include "PWGHF/DataModel/CandidateSelectionTables.h"
31+
// #include "PWGHF/DataModel/CandidateReconstructionTables.h"
32+
// #include "PWGHF/DataModel/CandidateSelectionTables.h"
3333

3434
using namespace o2;
3535
using namespace o2::analysis;
@@ -84,10 +84,10 @@ struct alice3correlatorddbar {
8484
Configurable<std::vector<double>> binsPt{"binsPt", std::vector<double>{o2::analysis::hf_cuts_d0_to_pi_k::vecBinsPt}, "pT bin limits for candidate mass plots and efficiency"};
8585
Configurable<std::vector<double>> efficiencyD{"efficiencyD", std::vector<double>{efficiencyDmeson_v}, "Efficiency values for D0 meson"};
8686

87-
//HfHelper hfHelper; //not needed for now
87+
// HfHelper hfHelper; //not needed for now
8888

89-
Partition<soa::Join<aod::Alice3D0Meson, aod::Alice3D0Sel>> selectedCandidates = aod::a3D0meson::y > -yCandMax && aod::a3D0meson::y < yCandMax && aod::a3D0meson::pt > ptCandMin && (aod::a3D0Selection::isSelD0 >= selectionFlagD0 || aod::a3D0Selection::isSelD0bar >= selectionFlagD0bar);
90-
Partition<soa::Join<aod::Alice3D0Meson, aod::Alice3D0Sel, aod::Alice3D0MCTruth>> selectedCandidatesMC = aod::a3D0meson::y > -yCandMax && aod::a3D0meson::y < yCandMax && aod::a3D0meson::pt > ptCandMin && (aod::a3D0Selection::isSelD0 >= selectionFlagD0 || aod::a3D0Selection::isSelD0bar >= selectionFlagD0bar);
89+
Partition<soa::Join<aod::Alice3D0Meson, aod::Alice3D0Sel>> selectedCandidates = aod::a3D0meson::y > -yCandMax&& aod::a3D0meson::y<yCandMax && aod::a3D0meson::pt> ptCandMin && (aod::a3D0Selection::isSelD0 >= selectionFlagD0 || aod::a3D0Selection::isSelD0bar >= selectionFlagD0bar);
90+
Partition<soa::Join<aod::Alice3D0Meson, aod::Alice3D0Sel, aod::Alice3D0MCTruth>> selectedCandidatesMC = aod::a3D0meson::y > -yCandMax&& aod::a3D0meson::y<yCandMax && aod::a3D0meson::pt> ptCandMin && (aod::a3D0Selection::isSelD0 >= selectionFlagD0 || aod::a3D0Selection::isSelD0bar >= selectionFlagD0bar);
9191

9292
HistogramRegistry registry{
9393
"registry",
@@ -128,7 +128,7 @@ struct alice3correlatorddbar {
128128
{
129129
auto selectedCandidatesGrouped = selectedCandidates->sliceByCached(aod::a3D0meson::collisionId, collision.globalIndex(), cache);
130130

131-
for (const auto& candidate1 : selectedCandidatesGrouped) { //loop over reconstructed and selected D0 and D0bar (together, to fill mass plots first)
131+
for (const auto& candidate1 : selectedCandidatesGrouped) { // loop over reconstructed and selected D0 and D0bar (together, to fill mass plots first)
132132
double efficiencyWeight = 1.;
133133
if (applyEfficiency) {
134134
efficiencyWeight = 1. / efficiencyD->at(o2::analysis::findBin(binsPt, candidate1.pt()));
@@ -162,18 +162,18 @@ struct alice3correlatorddbar {
162162
continue;
163163
}
164164
// excluding trigger self-correlations (possible in case of both mass hypotheses accepted)
165-
if (candidate1.mRowIndex == candidate2.mRowIndex) { //this by definition should never happen, since each candidate is either D0 or D0bar
165+
if (candidate1.mRowIndex == candidate2.mRowIndex) { // this by definition should never happen, since each candidate is either D0 or D0bar
166166
continue;
167167
}
168-
if((candidate1.pt() - candidate2.pt()) < 1e-5 && (candidate1.eta() - candidate2.eta()) < 1e-5 && (candidate1.phi() - candidate2.phi()) < 1e-5) { //revised, temporary condition to avoid self-correlations (the best would be check the daughterIDs, but we don't store them at the moment)
168+
if ((candidate1.pt() - candidate2.pt()) < 1e-5 && (candidate1.eta() - candidate2.eta()) < 1e-5 && (candidate1.phi() - candidate2.phi()) < 1e-5) { // revised, temporary condition to avoid self-correlations (the best would be check the daughterIDs, but we don't store them at the moment)
169169
continue;
170-
}
170+
}
171171
entryD0D0barPair(getDeltaPhi(candidate2.phi(), candidate1.phi()),
172172
candidate2.eta() - candidate1.eta(),
173173
candidate1.pt(),
174174
candidate2.pt());
175-
entryD0D0barRecoInfo(candidate1.m(), //mD0
176-
candidate2.m(), //mD0bar
175+
entryD0D0barRecoInfo(candidate1.m(), // mD0
176+
candidate2.m(), // mD0bar
177177
0);
178178
double etaCut = 0.;
179179
double ptCut = 0.;
@@ -214,7 +214,7 @@ struct alice3correlatorddbar {
214214
efficiencyWeight = 1. / efficiencyD->at(o2::analysis::findBin(binsPt, candidate1.pt()));
215215
}
216216

217-
if (candidate1.mcTruthInfo()) { //1 or 2, i.e. true D0 or D0bar
217+
if (candidate1.mcTruthInfo()) { // 1 or 2, i.e. true D0 or D0bar
218218
// fill per-candidate distributions from D0/D0bar true candidates
219219
registry.fill(HIST("hPtCandMCRec"), candidate1.pt());
220220
registry.fill(HIST("hPtProng0MCRec"), candidate1.ptProng0());
@@ -225,18 +225,18 @@ struct alice3correlatorddbar {
225225
registry.fill(HIST("hSelectionStatusMCRec"), candidate1.isSelD0() + (candidate1.isSelD0bar() * 2));
226226
}
227227
// fill invariant mass plots from D0/D0bar signal and background candidates
228-
if (candidate1.isSelD0() >= selectionFlagD0) { // only reco as D0
229-
if (candidate1.mcTruthInfo() == 1) { // also matched as D0
230-
registry.fill(HIST("hMassD0MCRecSig"), candidate1.m(), candidate1.pt(), efficiencyWeight); //here m is univoque, since a given candidate passes the selection with only a single mass option
228+
if (candidate1.isSelD0() >= selectionFlagD0) { // only reco as D0
229+
if (candidate1.mcTruthInfo() == 1) { // also matched as D0
230+
registry.fill(HIST("hMassD0MCRecSig"), candidate1.m(), candidate1.pt(), efficiencyWeight); // here m is univoque, since a given candidate passes the selection with only a single mass option
231231
} else if (candidate1.mcTruthInfo() == 2) {
232232
registry.fill(HIST("hMassD0MCRecRefl"), candidate1.m(), candidate1.pt(), efficiencyWeight);
233233
} else {
234234
registry.fill(HIST("hMassD0MCRecBkg"), candidate1.m(), candidate1.pt(), efficiencyWeight);
235235
}
236236
}
237-
if (candidate1.isSelD0bar() >= selectionFlagD0bar) { // only reco as D0bar
238-
if (candidate1.mcTruthInfo() == 2) { // also matched as D0bar
239-
registry.fill(HIST("hMassD0barMCRecSig"), candidate1.m(), candidate1.pt(), efficiencyWeight); //here m is univoque, since a given candidate passes the selection with only a single mass option
237+
if (candidate1.isSelD0bar() >= selectionFlagD0bar) { // only reco as D0bar
238+
if (candidate1.mcTruthInfo() == 2) { // also matched as D0bar
239+
registry.fill(HIST("hMassD0barMCRecSig"), candidate1.m(), candidate1.pt(), efficiencyWeight); // here m is univoque, since a given candidate passes the selection with only a single mass option
240240
} else if (candidate1.mcTruthInfo() == 1) {
241241
registry.fill(HIST("hMassD0barMCRecRefl"), candidate1.m(), candidate1.pt(), efficiencyWeight);
242242
} else {
@@ -250,23 +250,23 @@ struct alice3correlatorddbar {
250250
continue;
251251
}
252252

253-
flagD0Signal = candidate1.mcTruthInfo() == 1; // flagD0Signal 'true' if candidate1 matched to D0 (particle)
253+
flagD0Signal = candidate1.mcTruthInfo() == 1; // flagD0Signal 'true' if candidate1 matched to D0 (particle)
254254
flagD0Reflection = candidate1.mcTruthInfo() == 2; // flagD0Reflection 'true' if candidate1, selected as D0 (particle), is matched to D0bar (antiparticle)
255255

256256
for (const auto& candidate2 : selectedCandidatesGroupedMC) {
257257
if (candidate2.isSelD0bar() < selectionFlagD0bar) { // discard candidates not selected as D0bar in inner loop
258258
continue;
259259
}
260-
flagD0barSignal = candidate2.mcTruthInfo() == 2; // flagD0barSignal 'true' if candidate2 matched to D0bar (antiparticle)
260+
flagD0barSignal = candidate2.mcTruthInfo() == 2; // flagD0barSignal 'true' if candidate2 matched to D0bar (antiparticle)
261261
flagD0barReflection = candidate2.mcTruthInfo() == 1; // flagD0barReflection 'true' if candidate2, selected as D0bar (antiparticle), is matched to D0 (particle)
262262

263263
// Excluding trigger self-correlations (possible in case of both mass hypotheses of the same real particle, reconstructed as candidate1 for D0 and candidate2 for D0bar)
264-
if (candidate1.mRowIndex == candidate2.mRowIndex) { //this by definition should never happen, since each candidate is either D0 or D0bar
264+
if (candidate1.mRowIndex == candidate2.mRowIndex) { // this by definition should never happen, since each candidate is either D0 or D0bar
265265
continue;
266266
}
267-
if((candidate1.pt() - candidate2.pt()) < 1e-5 && (candidate1.eta() - candidate2.eta()) < 1e-5 && (candidate1.phi() - candidate2.phi()) < 1e-5) { //revised, temporary condition to avoid self-correlations (the best would be check the daughterIDs, but we don't store them at the moment)
267+
if ((candidate1.pt() - candidate2.pt()) < 1e-5 && (candidate1.eta() - candidate2.eta()) < 1e-5 && (candidate1.phi() - candidate2.phi()) < 1e-5) { // revised, temporary condition to avoid self-correlations (the best would be check the daughterIDs, but we don't store them at the moment)
268268
continue;
269-
}
269+
}
270270
// choice of options (D0/D0bar signal/bkg)
271271
int pairSignalStatus = 0; // 0 = bkg/bkg, 1 = bkg/ref, 2 = bkg/sig, 3 = ref/bkg, 4 = ref/ref, 5 = ref/sig, 6 = sig/bkg, 7 = sig/ref, 8 = sig/sig
272272
if (flagD0Signal) {
@@ -285,8 +285,8 @@ struct alice3correlatorddbar {
285285
candidate2.eta() - candidate1.eta(),
286286
candidate1.pt(),
287287
candidate2.pt());
288-
entryD0D0barRecoInfo(candidate1.m(), //mD0
289-
candidate2.m(), //mD0bar
288+
entryD0D0barRecoInfo(candidate1.m(), // mD0
289+
candidate2.m(), // mD0bar
290290
pairSignalStatus);
291291
double etaCut = 0.;
292292
double ptCut = 0.;
@@ -306,7 +306,6 @@ struct alice3correlatorddbar {
306306
}
307307

308308
PROCESS_SWITCH(alice3correlatorddbar, processMcRec, "Process MC Reco mode", false);
309-
310309
};
311310

312311
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)

ALICE3/TableProducer/alice3-decayfinder.cxx

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ using alice3tracks = soa::Join<aod::Tracks, aod::TracksCov, aod::Alice3DecayMaps
6969
struct alice3decayFinder {
7070
SliceCache cache;
7171

72-
Produces<aod::Alice3D0Meson> candidateD0meson; //contains D0 and D0bar selected candidates (separated, i.e. each row with a single mass hypothesis)
73-
Produces<aod::Alice3D0Sel> selectionOutcome; //flags for isSelD0 and isSelD0bar
74-
Produces<aod::Alice3D0MCTruth> mcTruthOutcome; //contains MC truth info (is true D0, true D0bar, or bkg)
72+
Produces<aod::Alice3D0Meson> candidateD0meson; // contains D0 and D0bar selected candidates (separated, i.e. each row with a single mass hypothesis)
73+
Produces<aod::Alice3D0Sel> selectionOutcome; // flags for isSelD0 and isSelD0bar
74+
Produces<aod::Alice3D0MCTruth> mcTruthOutcome; // contains MC truth info (is true D0, true D0bar, or bkg)
7575

7676
// Operation and minimisation criteria
7777
Configurable<float> magneticField{"magneticField", 20.0f, "Magnetic field (in kilogauss)"};
@@ -165,8 +165,8 @@ struct alice3decayFinder {
165165
float mass;
166166
std::array<float, 3> posSV;
167167
std::array<float, 3> P;
168-
std::array<float, 3> Pdaug; //positive track
169-
std::array<float, 3> Ndaug; //negative track
168+
std::array<float, 3> Pdaug; // positive track
169+
std::array<float, 3> Ndaug; // negative track
170170
float pt;
171171
float phi;
172172
float eta;
@@ -175,7 +175,7 @@ struct alice3decayFinder {
175175
float cosPAxy;
176176
float cosThetaStar;
177177
float normalizedDecayLength;
178-
int mcTruth; //0 = bkg, 1 = D0, 2 = D0bar
178+
int mcTruth; // 0 = bkg, 1 = D0, 2 = D0bar
179179
} dmeson;
180180

181181
struct {
@@ -233,20 +233,18 @@ struct alice3decayFinder {
233233
parentTrack.getPxPyPzGlo(dmeson.P);
234234
dmeson.cosThetaStar = RecoDecay::cosThetaStar(std::array{std::array{posP[0], posP[1], posP[2]}, std::array{negP[0], negP[1], negP[2]}}, std::array{posMass, negMass}, dmeson.mass, 0);
235235

236-
//MC truth check
236+
// MC truth check
237237
int indexRec = -1;
238238
int8_t sign = 0;
239-
auto arrayDaughters = std::array{posTrackRow,negTrackRow};
239+
auto arrayDaughters = std::array{posTrackRow, negTrackRow};
240240
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign);
241241
if (indexRec < 0) {
242-
dmeson.mcTruth = 0; //bkg
243-
}
244-
else {
242+
dmeson.mcTruth = 0; // bkg
243+
} else {
245244
if (sign > 0) {
246-
dmeson.mcTruth = 1; //D0
247-
}
248-
else {
249-
dmeson.mcTruth = 2; //D0bar
245+
dmeson.mcTruth = 1; // D0
246+
} else {
247+
dmeson.mcTruth = 2; // D0bar
250248
}
251249
}
252250
return true;
@@ -471,7 +469,7 @@ struct alice3decayFinder {
471469
histos.fill(HIST("hMassD"), dmeson.mass);
472470
histos.fill(HIST("h3dRecD"), dmeson.pt, dmeson.eta, dmeson.mass);
473471

474-
//store D0 in output table
472+
// store D0 in output table
475473
candidateD0meson(collision.globalIndex(),
476474
dmeson.Pdaug[0], dmeson.Pdaug[1], dmeson.Pdaug[2],
477475
dmeson.Ndaug[0], dmeson.Ndaug[1], dmeson.Ndaug[2],
@@ -481,7 +479,7 @@ struct alice3decayFinder {
481479
dmeson.eta,
482480
dmeson.phi,
483481
dmeson.y);
484-
selectionOutcome(1, 0); //isSelD0 true, isSelD0bar false
482+
selectionOutcome(1, 0); // isSelD0 true, isSelD0bar false
485483
mcTruthOutcome(dmeson.mcTruth);
486484
}
487485
}
@@ -531,7 +529,7 @@ struct alice3decayFinder {
531529
histos.fill(HIST("hMassDbar"), dmeson.mass);
532530
histos.fill(HIST("h3dRecDbar"), dmeson.pt, dmeson.eta, dmeson.mass);
533531

534-
//store D0bar in output table
532+
// store D0bar in output table
535533
candidateD0meson(collision.globalIndex(),
536534
dmeson.Pdaug[0], dmeson.Pdaug[1], dmeson.Pdaug[2],
537535
dmeson.Ndaug[0], dmeson.Ndaug[1], dmeson.Ndaug[2],
@@ -540,10 +538,9 @@ struct alice3decayFinder {
540538
dmeson.mass,
541539
dmeson.eta,
542540
dmeson.phi,
543-
dmeson.y
544-
);
545-
selectionOutcome(0, 1); //isSelD0 true, isSelD0bar false
546-
mcTruthOutcome(dmeson.mcTruth);
541+
dmeson.y);
542+
selectionOutcome(0, 1); // isSelD0 true, isSelD0bar false
543+
mcTruthOutcome(dmeson.mcTruth);
547544
}
548545
}
549546
}

0 commit comments

Comments
 (0)