Skip to content

Commit 27bbe2a

Browse files
committed
Cleanup
1 parent 02ba117 commit 27bbe2a

File tree

8 files changed

+83
-222
lines changed

8 files changed

+83
-222
lines changed

ALICE3/DataModel/A3DecayFinderTables.h

Lines changed: 38 additions & 69 deletions
Large diffs are not rendered by default.

ALICE3/ML/alice3-mlresponse3prong.h

Lines changed: 19 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#ifndef ALICE3_ML_ALICE3MLRESPONSE3PRONG_H_
1717
#define ALICE3_ML_ALICE3MLRESPONSE3PRONG_H_
1818

19+
#include "ALICE3/utils/mcParticlesInfo.h"
20+
1921
#include "Tools/ML/MlResponse.h"
2022
#include "PWGHF/DataModel/CandidateReconstructionTables.h"
2123

@@ -34,16 +36,6 @@
3436
#FEATURE, static_cast<uint8_t>(InputFeatures3Prong::FEATURE) \
3537
}
3638

37-
// Check if the index of mCachedIndices (index associated to a FEATURE)
38-
// matches the entry in EnumInputFeatures associated to this FEATURE
39-
// if so, the inputFeatures vector is filled with the FEATURE's value
40-
// by calling the corresponding GETTER from OBJECT
41-
#define CHECK_AND_FILL_VEC_3PRONG_FULL(OBJECT, FEATURE, GETTER) \
42-
case static_cast<uint8_t>(InputFeatures3Prong::FEATURE): { \
43-
inputFeatures.emplace_back(OBJECT.GETTER()); \
44-
break; \
45-
}
46-
4739
// Specific case of CHECK_AND_FILL_VEC_3PRONG_FULL(OBJECT, FEATURE, GETTER)
4840
// where OBJECT is named candidate and FEATURE = GETTER
4941
#define CHECK_AND_FILL_VEC_3PRONG(GETTER) \
@@ -52,39 +44,6 @@
5244
break; \
5345
}
5446

55-
// Variation of CHECK_AND_FILL_VEC_3PRONG_FULL(OBJECT, FEATURE, GETTER)
56-
// where GETTER is a method of hfHelper
57-
#define CHECK_AND_FILL_VEC_3PRONG_HFHELPER(OBJECT, FEATURE, GETTER) \
58-
case static_cast<uint8_t>(InputFeatures3Prong::FEATURE): { \
59-
inputFeatures.emplace_back(hfHelper.GETTER(OBJECT)); \
60-
break; \
61-
}
62-
63-
// Variation of CHECK_AND_FILL_VEC_3PRONG_OBJECT_SIGNED(OBJECT1, OBJECT2, FEATURE, GETTER)
64-
// where OBJECT1 and OBJECT2 are the objects from which we call the GETTER method, and the variable
65-
// is filled depending on whether it is a LcToPKPi or a LcToPiKP
66-
#define CHECK_AND_FILL_VEC_3PRONG_OBJECT_SIGNED(OBJECT1, OBJECT2, FEATURE, GETTER) \
67-
case static_cast<uint8_t>(InputFeatures3Prong::FEATURE): { \
68-
if (caseLcToPKPi) { \
69-
inputFeatures.emplace_back(OBJECT1.GETTER()); \
70-
} else { \
71-
inputFeatures.emplace_back(OBJECT2.GETTER()); \
72-
} \
73-
break; \
74-
}
75-
76-
// Variation of CHECK_AND_FILL_VEC_3PRONG_HFHELPER_SIGNED(OBJECT, FEATURE, GETTER1, GETTER2)
77-
// where GETTER1 and GETTER2 are methods of the OBJECT
78-
#define CHECK_AND_FILL_VEC_3PRONG_SIGNED(OBJECT, FEATURE, GETTER1, GETTER2) \
79-
case static_cast<uint8_t>(InputFeatures3Prong::FEATURE): { \
80-
if (caseLcToPKPi) { \
81-
inputFeatures.emplace_back(OBJECT.GETTER1()); \
82-
} else { \
83-
inputFeatures.emplace_back(OBJECT.GETTER2()); \
84-
} \
85-
break; \
86-
}
87-
8847
namespace o2::analysis
8948
{
9049
enum class InputFeatures3Prong : uint8_t {
@@ -166,9 +125,9 @@ class Alice3MlResponse3Prong : public MlResponse<TypeOutputScore>
166125
CHECK_AND_FILL_VEC_3PRONG(ptProng0);
167126
CHECK_AND_FILL_VEC_3PRONG(ptProng1);
168127
CHECK_AND_FILL_VEC_3PRONG(ptProng2);
169-
CHECK_AND_FILL_VEC_3PRONG_FULL(candidate, impactParameterXY0, impactParameter0);
170-
CHECK_AND_FILL_VEC_3PRONG_FULL(candidate, impactParameterXY1, impactParameter1);
171-
CHECK_AND_FILL_VEC_3PRONG_FULL(candidate, impactParameterXY2, impactParameter2);
128+
CHECK_AND_FILL_VEC_3PRONG(impactParameterXY0);
129+
CHECK_AND_FILL_VEC_3PRONG(impactParameterXY1);
130+
CHECK_AND_FILL_VEC_3PRONG(impactParameterXY2);
172131
CHECK_AND_FILL_VEC_3PRONG(impactParameterZ0);
173132
CHECK_AND_FILL_VEC_3PRONG(impactParameterZ1);
174133
CHECK_AND_FILL_VEC_3PRONG(impactParameterZ2);
@@ -179,23 +138,24 @@ class Alice3MlResponse3Prong : public MlResponse<TypeOutputScore>
179138
CHECK_AND_FILL_VEC_3PRONG(cpaXY);
180139
CHECK_AND_FILL_VEC_3PRONG(chi2PCA);
181140
switch (part) {
182-
case 0: {
141+
case o2::a3_mc_parts_info::Particle::Lc:
142+
case o2::a3_mc_parts_info::Particle::AntiLc: {
183143
// RICH PID variables
184-
CHECK_AND_FILL_VEC_3PRONG_FULL(candidate, nSigRichPr0, nSigRichPr0);
185-
CHECK_AND_FILL_VEC_3PRONG_FULL(candidate, nSigRichKa1, nSigRichKa1);
186-
CHECK_AND_FILL_VEC_3PRONG_FULL(candidate, nSigRichPi2, nSigRichPi2);
144+
CHECK_AND_FILL_VEC_3PRONG(nSigRichPr0);
145+
CHECK_AND_FILL_VEC_3PRONG(nSigRichKa1);
146+
CHECK_AND_FILL_VEC_3PRONG(nSigRichPi2);
187147
// INNER TOF PID variables
188-
CHECK_AND_FILL_VEC_3PRONG_FULL(candidate, nSigInnTofPr0, nSigInnTofPr0);
189-
CHECK_AND_FILL_VEC_3PRONG_FULL(candidate, nSigInnTofKa1, nSigInnTofKa1);
190-
CHECK_AND_FILL_VEC_3PRONG_FULL(candidate, nSigInnTofPi2, nSigInnTofPi2);
148+
CHECK_AND_FILL_VEC_3PRONG(nSigInnTofPr0);
149+
CHECK_AND_FILL_VEC_3PRONG(nSigInnTofKa1);
150+
CHECK_AND_FILL_VEC_3PRONG(nSigInnTofPi2);
191151
// OUTER TOF PID variables
192-
CHECK_AND_FILL_VEC_3PRONG_FULL(candidate, nSigOutTofPr0, nSigOutTofPr0);
193-
CHECK_AND_FILL_VEC_3PRONG_FULL(candidate, nSigOutTofKa1, nSigOutTofKa1);
194-
CHECK_AND_FILL_VEC_3PRONG_FULL(candidate, nSigOutTofPi2, nSigOutTofPi2);
152+
CHECK_AND_FILL_VEC_3PRONG(nSigOutTofPr0);
153+
CHECK_AND_FILL_VEC_3PRONG(nSigOutTofKa1);
154+
CHECK_AND_FILL_VEC_3PRONG(nSigOutTofPi2);
195155
// TRACKER PID variables
196-
CHECK_AND_FILL_VEC_3PRONG_FULL(candidate, nSigTrkPr0, nSigTrkPr0);
197-
CHECK_AND_FILL_VEC_3PRONG_FULL(candidate, nSigTrkKa1, nSigTrkKa1);
198-
CHECK_AND_FILL_VEC_3PRONG_FULL(candidate, nSigTrkPi2, nSigTrkPi2);
156+
CHECK_AND_FILL_VEC_3PRONG(nSigTrkPr0);
157+
CHECK_AND_FILL_VEC_3PRONG(nSigTrkKa1);
158+
CHECK_AND_FILL_VEC_3PRONG(nSigTrkPi2);
199159
break;
200160
}
201161
}
@@ -270,7 +230,6 @@ class Alice3MlResponse3Prong : public MlResponse<TypeOutputScore>
270230
} // namespace o2::analysis
271231

272232
#undef FILL_MAP_3PRONG
273-
#undef CHECK_AND_FILL_VEC_3PRONG_FULL
274233
#undef CHECK_AND_FILL_VEC_3PRONG
275234
#undef CHECK_AND_FILL_VEC_3PRONG_HFHELPER
276235
#undef CHECK_AND_FILL_VEC_3PRONG_OBJECT_SIGNED

ALICE3/TableProducer/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ o2physics_add_dpl_workflow(alice3-selector-3prong
5454
o2physics_add_dpl_workflow(alice3-tree-creator-3prong
5555
SOURCES alice3-treecreator3prong.cxx
5656
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter O2Physics::MLCore
57-
COMPONENT_NAME Analysis)
57+
COMPONENT_NAME Analysis)

ALICE3/TableProducer/OTF/onTheFlyTrackerPid.cxx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,6 @@ struct OnTheFlyTrackerPid {
431431

432432
void init(o2::framework::InitContext&)
433433
{
434-
LOG(info) << "[TrkPid] Init function";
435434
ccdb->setURL("http://alice-ccdb.cern.ch");
436435
ccdb->setTimestamp(-1);
437436

@@ -542,7 +541,6 @@ struct OnTheFlyTrackerPid {
542541
h2dBarrelNsigmaTrue[iTrue][iHyp] = histos.add<TH2>(histName.c_str(), histTitle.c_str(), kTH2F, {axisMomentum, axisNsigma});
543542
}
544543
}
545-
LOG(info) << "[TrkPid] Finished Init function";
546544
}
547545

548546
void process(soa::Join<aod::Collisions, aod::McCollisionLabels>::iterator const& collision,

ALICE3/TableProducer/alice3-decayfinder.cxx

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,6 @@ using std::array;
6161
#define bitoff(var, nbit) ((var) &= ~(static_cast<uint32_t>(1) << (nbit))) //((a) &= ~(1ULL<<(b)))
6262
// #define bitcheck(var, nbit) ((var) & (static_cast<uint32_t>(1) << (nbit)))
6363

64-
// enum Particle {
65-
// Lc = 0,
66-
// AntiLc = 1
67-
// };
68-
69-
// enum MassHypo {
70-
// Main = 1,
71-
// Swapped = -1
72-
// };
73-
7464
// For MC association in pre-selection
7565
// using FullTracksExt = soa::Join<aod::Tracks, aod::TracksCov>;
7666
// using labeledTracks = soa::Join<aod::Tracks, aod::McTrackLabels>;
@@ -366,7 +356,6 @@ struct alice3decayFinder {
366356
cand3prong.chi2PCA = fitter3.getChi2AtPCACandidate();
367357
cand3prong.dcaDau = TMath::Sqrt(fitter3.getChi2AtPCACandidate());
368358
if (cand3prong.dcaDau > dcaDaughtersSelection) {
369-
LOG(info) << "dcaDau cut exceeded: " << cand3prong.dcaDau;
370359
return false;
371360
}
372361

@@ -594,14 +583,10 @@ struct alice3decayFinder {
594583
histos.add("h2dGen3Prong", "h2dGen3Prong", kTH2F, {axisPt, axisEta});
595584
histos.add("h2dGen3ProngBar", "h2dGen3ProngBar", kTH2F, {axisPt, axisEta});
596585
histos.add("h3dRec3Prong", "h3dRec3Prong", kTH3F, {axisPt, axisEta, axisLcMass});
597-
// histos.add("h3dRec3Prongbar", "h3dRec3Prongbar", kTH3F, {axisPt, axisEta, axisLcMass});
598-
599586
histos.add("hMass3Prong", "hMass3Prong", kTH1F, {axisLcMass});
600-
// histos.add("hMass3Prongbar", "hMass3Prongbar", kTH1F, {axisLcMass});
601587

602-
if (doDCAplotsD) {
588+
if (doDCAplots3Prong) {
603589
histos.add("hDCA3ProngDaughters", "hDCA3ProngDaughters", kTH1D, {axisDCADaughters});
604-
// histos.add("hDCALcbarDaughters", "hDCALcbarDaughters", kTH1D, {axisDCA});
605590
histos.add("h2dDCAxyVsPtPiPlusFrom3P", "h2dDCAxyVsPtPiPlusFrom3P", kTH2F, {axisPt, axisDCA});
606591
histos.add("h2dDCAxyVsPtPiMinusFrom3P", "h2dDCAxyVsPtPiMinusFrom3P", kTH2F, {axisPt, axisDCA});
607592
histos.add("h2dDCAxyVsPtKaPlusFrom3P", "h2dDCAxyVsPtKaPlusFrom3P", kTH2F, {axisPt, axisDCA});
@@ -1047,7 +1032,6 @@ struct alice3decayFinder {
10471032
}
10481033
}
10491034
}
1050-
// LOG(info) << "3-prong candidates filled.";
10511035
}
10521036
//*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*
10531037

ALICE3/TableProducer/alice3-decaypreselector.cxx

Lines changed: 23 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -85,20 +85,14 @@ struct alice3decaypreselector {
8585
template <typename TTrack>
8686
bool checkPDG(TTrack const& track, int pdgMother, int pdg)
8787
{
88-
// LOG(info) << "------------------------";
8988
bool returnValue = false;
9089
// Association check
9190
if (track.has_mcParticle()) {
92-
// LOG(info) << "[" << pdg << ", " << pdgMother << "] Track has MC particle";
9391
auto mcParticle = track.template mcParticle_as<aod::McParticles>();
9492
if (mcParticle.has_mothers()) {
95-
// LOG(info) << "[" << pdg << ", " << pdgMother << "] MC particle has mothers";
9693
for (auto& mcParticleMother : mcParticle.template mothers_as<aod::McParticles>()) {
97-
// LOG(info) << "[" << pdg << ", " << pdgMother << "] Mother PDG: " << mcParticleMother.pdgCode();
98-
if (mcParticle.pdgCode() == pdg && mcParticleMother.pdgCode() == pdgMother) {
99-
LOG(info) << "[" << pdg << ", " << pdgMother << "] PDG match found!";
94+
if (mcParticle.pdgCode() == pdg && mcParticleMother.pdgCode() == pdgMother)
10095
returnValue = true;
101-
}
10296
}
10397
}
10498
} // end association check
@@ -109,7 +103,6 @@ struct alice3decaypreselector {
109103
void init(InitContext&)
110104
{
111105
// future dev if needed
112-
LOG(info) << "Initializing ALICE 3 decay pre-selector";
113106
}
114107

115108
// go declarative: use partitions instead of "if", then just toggle bits to allow for mask selection later
@@ -170,74 +163,43 @@ struct alice3decaypreselector {
170163
void processFilterOnMonteCarloTruth(labeledTracks const& tracks, aod::McParticles const&)
171164
{
172165
for (auto const& track : tracks) {
173-
// // D mesons
174-
// if (!checkPDG(track, 421, -321)) //+421 -> -321 +211
175-
// bitoff(selectionMap[track.globalIndex()], kTrueKaMinusFromD);
176-
// if (!checkPDG(track, -421, +321)) //-421 -> +321 -211
177-
// bitoff(selectionMap[track.globalIndex()], kTrueKaPlusFromD);
178-
// if (!checkPDG(track, 421, +211)) //+421 -> -321 +211
179-
// bitoff(selectionMap[track.globalIndex()], kTruePiPlusFromD);
180-
// if (!checkPDG(track, -421, -211)) //-421 -> +321 -211
181-
// bitoff(selectionMap[track.globalIndex()], kTruePiMinusFromD);
166+
// D mesons
167+
if (!checkPDG(track, 421, -321)) //+421 -> -321 +211
168+
bitoff(selectionMap[track.globalIndex()], kTrueKaMinusFromD);
169+
if (!checkPDG(track, -421, +321)) //-421 -> +321 -211
170+
bitoff(selectionMap[track.globalIndex()], kTrueKaPlusFromD);
171+
if (!checkPDG(track, 421, +211)) //+421 -> -321 +211
172+
bitoff(selectionMap[track.globalIndex()], kTruePiPlusFromD);
173+
if (!checkPDG(track, -421, -211)) //-421 -> +321 -211
174+
bitoff(selectionMap[track.globalIndex()], kTruePiMinusFromD);
182175

183176
// Lambdac baryons
184-
bool matchCandPart = true;
185-
bool matchCandAntiPart = true;
186-
if (!checkPDG(track, +4122, +2212)) {
187-
//+4122 -> +2212 -321 +211
188-
matchCandPart = false;
177+
if (!checkPDG(track, +4122, +2212)) { //+4122 -> +2212 -321 +211
189178
bitoff(selectionMap[track.globalIndex()], kTruePrPlusFromLc);
190-
} else {
191-
LOG(info) << "Passed proton from Lc check";
192179
}
193-
if (!checkPDG(track, +4122, -321)) {
194-
//+4122 -> +2212 -321 +211
195-
matchCandPart = false;
180+
if (!checkPDG(track, +4122, -321)) { //+4122 -> +2212 -321 +211
196181
bitoff(selectionMap[track.globalIndex()], kTrueKaMinusFromLc);
197-
} else {
198-
LOG(info) << "Passed kaon from Lc check";
199182
}
200-
if (!checkPDG(track, +4122, +211)) {
201-
//+4122 -> +2212 -321 +211
202-
matchCandPart = false;
183+
if (!checkPDG(track, +4122, +211)) { //+4122 -> +2212 -321 +211
203184
bitoff(selectionMap[track.globalIndex()], kTruePiPlusFromLc);
204-
} else {
205-
LOG(info) << "Passed pion from Lc check";
206185
}
207-
if (!checkPDG(track, -4122, -2212)){
208-
//-4122 -> -2212 +321 -211
209-
matchCandAntiPart = false;
186+
if (!checkPDG(track, -4122, -2212)){ //-4122 -> -2212 +321 -211
210187
bitoff(selectionMap[track.globalIndex()], kTruePrMinusFromLc);
211-
} else {
212-
LOG(info) << "Passed antiproton from Lc check";
213188
}
214-
if (!checkPDG(track, -4122, +321)) {
215-
//-4122 -> -2212 +321 -211
216-
matchCandAntiPart = false;
189+
if (!checkPDG(track, -4122, +321)) { //-4122 -> -2212 +321 -211
217190
bitoff(selectionMap[track.globalIndex()], kTrueKaPlusFromLc);
218-
} else {
219-
LOG(info) << "Passed kaon plus from Lc check";
220191
}
221-
if (!checkPDG(track, -4122, -211)) {
222-
//-4122 -> -2212 +321 -211
223-
matchCandAntiPart = false;
192+
if (!checkPDG(track, -4122, -211)) { //-4122 -> -2212 +321 -211
224193
bitoff(selectionMap[track.globalIndex()], kTruePiMinusFromLc);
225-
} else {
226-
LOG(info) << "Passed pion minus from Lc check";
227-
}
228-
if (matchCandPart) {
229-
LOG(info) << "Candidate Part Lc matched!";
230-
} else if (matchCandAntiPart) {
231-
LOG(info) << "Candidate AntiPart Lc matched!";
232194
}
233195

234-
// // XiCC daughters
235-
// if (!checkPDG(track, 4422, 211)) // 4422 -> 4232 211, pi from xicc
236-
// bitoff(selectionMap[track.globalIndex()], kTruePiFromXiCC);
237-
// if (!checkPDG(track, 4232, 3312)) // 4232 -> 3312 211 211, xi from xic
238-
// bitoff(selectionMap[track.globalIndex()], kTrueXiFromXiC);
239-
// if (!checkPDG(track, 4232, 211)) // 4232 -> 3312 211 211, pi from xic
240-
// bitoff(selectionMap[track.globalIndex()], kTruePiFromXiC);
196+
// XiCC daughters
197+
if (!checkPDG(track, 4422, 211)) // 4422 -> 4232 211, pi from xicc
198+
bitoff(selectionMap[track.globalIndex()], kTruePiFromXiCC);
199+
if (!checkPDG(track, 4232, 3312)) // 4232 -> 3312 211 211, xi from xic
200+
bitoff(selectionMap[track.globalIndex()], kTrueXiFromXiC);
201+
if (!checkPDG(track, 4232, 211)) // 4232 -> 3312 211 211, pi from xic
202+
bitoff(selectionMap[track.globalIndex()], kTruePiFromXiC);
241203
}
242204
}
243205
//*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*

ALICE3/utils/mcParticlesInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ enum MassHypo {
1414
};
1515

1616
} // namespace a3_mc_parts_info
17-
} // namespace o2
17+
} // namespace o2

0 commit comments

Comments
 (0)