Skip to content

Commit 8802460

Browse files
committed
Refactor OTF tracker
1 parent d46f77c commit 8802460

8 files changed

Lines changed: 979 additions & 1039 deletions

File tree

ALICE3/DataModel/A3DecayFinderTables.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,11 @@ DECLARE_SOA_DYNAMIC_COLUMN(ImpactParameterXY, impactParameterXY, //!
202202
DECLARE_SOA_COLUMN(MlScore0, mlScore0, float); //!
203203
DECLARE_SOA_COLUMN(MlScore1, mlScore1, float); //!
204204
DECLARE_SOA_COLUMN(MlScore2, mlScore2, float); //!
205+
206+
// Secondary vertex gen-reco position
207+
DECLARE_SOA_COLUMN(DeltaXSecVtx, deltaXSecVtx, float); //!
208+
DECLARE_SOA_COLUMN(DeltaYSecVtx, deltaYSecVtx, float); //!
209+
DECLARE_SOA_COLUMN(DeltaZSecVtx, deltaZSecVtx, float); //!
205210
} // namespace a3_hf_cand
206211

207212
#define HFCAND_COLUMNS \
@@ -235,6 +240,11 @@ DECLARE_SOA_COLUMN(MlScore2, mlScore2, float); //!
235240
a3_hf_cand::Pt2Prong2<a3_hf_cand::PxProng2, a3_hf_cand::PyProng2>, \
236241
a3_hf_cand::PVectorProng2<a3_hf_cand::PxProng2, a3_hf_cand::PyProng2, a3_hf_cand::PzProng2>
237242

243+
DECLARE_SOA_TABLE(Alice3SVResos, "AOD", "ALICE3SVRESO", //!
244+
a3_hf_cand::DeltaXSecVtx,
245+
a3_hf_cand::DeltaYSecVtx,
246+
a3_hf_cand::DeltaZSecVtx);
247+
238248
namespace a3DecayMap
239249
{
240250
DECLARE_SOA_COLUMN(DecayMap, decayMap, uint32_t); //! simple map to process passing / not passing criteria

ALICE3/DataModel/tracksAlice3.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ DECLARE_SOA_COLUMN(IsReconstructed, isReconstructed, bool); //! is reconstructed
3030
DECLARE_SOA_COLUMN(NSiliconHits, nSiliconHits, int); //! number of silicon hits
3131
DECLARE_SOA_COLUMN(NTPCHits, nTPCHits, int); //! number of tpc hits
3232
DECLARE_SOA_COLUMN(PdgCode, pdgCode, int); //! PDG code of the linked truth MC particle
33+
DECLARE_SOA_COLUMN(TrackType, trackType, int); //! Type of the track
3334
} // namespace track_alice3
3435
DECLARE_SOA_TABLE(TracksAlice3, "AOD", "TRACKSALICE3",
3536
track_alice3::IsReconstructed);
@@ -41,7 +42,8 @@ using TrackAlice3Pdg = TracksAlice3Pdg::iterator;
4142

4243
DECLARE_SOA_TABLE(TracksExtraA3, "AOD", "TracksExtraA3",
4344
track_alice3::NSiliconHits,
44-
track_alice3::NTPCHits);
45+
track_alice3::NTPCHits,
46+
track_alice3::TrackType);
4547
using TrackExtraA3 = TracksExtraA3::iterator;
4648

4749
namespace mcparticle_alice3

ALICE3/TableProducer/OTF/onTheFlyTracker.cxx

Lines changed: 922 additions & 1008 deletions
Large diffs are not rendered by default.

ALICE3/TableProducer/alice3-decayfinder.cxx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ struct alice3decayFinder {
7979
Produces<aod::Alice3McRecFlags> mcRecFlags; // contains MC truth info (is true Lc, or bkg)
8080
Produces<aod::Alice3PidLcs> pidInfoLcDaugs; // contains PID info for Lc candidates
8181
Produces<aod::Alice3McGenFlags> mcGenFlags; // contains MC gen info for 3-prong candidates
82+
Produces<aod::Alice3SVResos> coordsSVResos; // contains MC gen and reco coordinates of the secondary vertex info for 3-prong candidates
8283

8384
// Vertexing
8485
struct : ConfigurableGroup {
@@ -231,6 +232,7 @@ struct alice3decayFinder {
231232
std::array<float, 3> Pdaug2; // pion track
232233
std::array<float, 3> primaryVertex; // primary vertex coordinates
233234
std::array<double, 3> secondaryVertex; // secondary vertex coordinates
235+
std::array<double, 3> deltaRecoGenSV; // difference between reconstructed and generated secondary vertex coordinates
234236
float impactParameterY0; // impact parameters
235237
float errorImpactParameterY0; // impact parameters error
236238
float impactParameterY1; // impact parameters
@@ -434,6 +436,9 @@ struct alice3decayFinder {
434436
mCandidate3Prong.origin = 0; // Default: unknown origin
435437
if (mCandidate3Prong.particleMcRec > -1) {
436438
const auto& motherParticle = mcParticles.rawIteratorAt(mCandidate3Prong.particleMcRec);
439+
mCandidate3Prong.deltaRecoGenSV[0] = mCandidate3Prong.secondaryVertex[0] - motherParticle.vx();
440+
mCandidate3Prong.deltaRecoGenSV[1] = mCandidate3Prong.secondaryVertex[1] - motherParticle.vy();
441+
mCandidate3Prong.deltaRecoGenSV[2] = mCandidate3Prong.secondaryVertex[2] - motherParticle.vz();
437442
mCandidate3Prong.flagMc = motherParticle.pdgCode() > 0 ? charmHadFlag : -charmHadFlag; // Particle
438443
std::vector<int> idxBhadMothers{};
439444
mCandidate3Prong.origin = RecoDecay::getCharmHadronOrigin(mcParticles, motherParticle, false, &idxBhadMothers);
@@ -1054,8 +1059,9 @@ struct alice3decayFinder {
10541059
std::sqrt(mCandidate3Prong.errorImpactParameterZ1),
10551060
std::sqrt(mCandidate3Prong.errorImpactParameterZ2),
10561061
candPx, candPy, candPz);
1057-
mcRecFlags(mCandidate3Prong.origin, mCandidate3Prong.ptBMotherRec, mCandidate3Prong.flagMc, mCandidate3Prong.particleMcRec); // placeholder for prompt/non-prompt
1062+
mcRecFlags(mCandidate3Prong.origin, mCandidate3Prong.ptBMotherRec, mCandidate3Prong.flagMc, mCandidate3Prong.particleMcRec);
10581063
fillPidTable(prong0, prong1, prong2);
1064+
coordsSVResos(mCandidate3Prong.deltaRecoGenSV[0], mCandidate3Prong.deltaRecoGenSV[1], mCandidate3Prong.deltaRecoGenSV[2]);
10591065
}
10601066
}
10611067
}

ALICE3/TableProducer/alice3TrackingTranslator.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,8 @@ struct Alice3TrackingTranslator {
582582
tableTracksAlice3Pdg(pdgCode); // PdgCode to the linked MC truth particle
583583

584584
tableTracksExtraA3(m_nMeasurements, // nSiliconHits (using m_nMeasurements as proxy)
585-
0); // nTPCHits
585+
0, // nTPCHits
586+
0); // trackType
586587

587588
// Fill extra track info
588589
tableStoredTracksExtra(0.f, // TPCInnerParam

ALICE3/Tasks/alice3HfTask3Prong.cxx

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ struct Alice3HfTask3Prong {
6464

6565
int selectedPdg{-1};
6666

67-
using Cands3PReco = soa::Filtered<soa::Join<aod::Alice3Cand3Ps, aod::Alice3Sel3Ps, aod::Alice3McRecFlags>>;
68-
using Cands3PRecoWMl = soa::Filtered<soa::Join<aod::Alice3Cand3Ps, aod::Alice3Sel3Ps, aod::Alice3Ml3Ps, aod::Alice3McRecFlags>>;
67+
using Cands3PReco = soa::Filtered<soa::Join<aod::Alice3Cand3Ps, aod::Alice3Sel3Ps, aod::Alice3McRecFlags, aod::Alice3SVResos>>;
68+
using Cands3PRecoWMl = soa::Filtered<soa::Join<aod::Alice3Cand3Ps, aod::Alice3Sel3Ps, aod::Alice3Ml3Ps, aod::Alice3McRecFlags, aod::Alice3SVResos>>;
6969
using Cands3PGen = soa::Join<aod::McParticles, aod::Alice3McGenFlags>;
7070

7171
Filter filterSelectCandidates = (aod::a3_hf_sel_3prong::isSelMassHypo0 == true || aod::a3_hf_sel_3prong::isSelMassHypo1 == true);
@@ -79,6 +79,7 @@ struct Alice3HfTask3Prong {
7979
ConfigurableAxis thnConfigAxisCanType{"thnConfigAxisCanType", {5, 0., 5.}, ""};
8080
ConfigurableAxis thnAxisRapidity{"thnAxisRapidity", {20, -1, 1}, "Cand. rapidity bins"};
8181
ConfigurableAxis thnConfigAxisGenPtB{"thnConfigAxisGenPtB", {1000, 0, 100}, "Gen Pt B"};
82+
ConfigurableAxis thnConfigAxisDeltaSecVtxCoord{"thnConfigAxisDeltaSecVtxCoord", {1000, -10, 10}, ""};
8283

8384
HistogramRegistry registry{"registry", {}};
8485

@@ -142,6 +143,9 @@ struct Alice3HfTask3Prong {
142143
addHistogramsRec("hCPAxy", "cosine of pointing angle xy", "entries", {HistType::kTH1F, {{110, -1.1, 1.1}}});
143144
addHistogramsRec("hDca2", "prong Chi2PCA to sec. vertex (cm)", "entries", {HistType::kTH1F, {{400, 0., 20.}}});
144145
addHistogramsRec("hEta", "#it{#eta}", "entries", {HistType::kTH1F, {{100, -2., 2.}}});
146+
addHistogramsRec("hDeltaXRecoGenSecVtx", "p_{T} (GeV/#it{c})", "#Delta X Sec. Vtx. (cm)", {HistType::kTH2F, {thnConfigAxisPt, thnConfigAxisDeltaSecVtxCoord}});
147+
addHistogramsRec("hDeltaYRecoGenSecVtx", "p_{T} (GeV/#it{c})", "#Delta Y Sec. Vtx. (cm)", {HistType::kTH2F, {thnConfigAxisPt, thnConfigAxisDeltaSecVtxCoord}});
148+
addHistogramsRec("hDeltaZRecoGenSecVtx", "p_{T} (GeV/#it{c})", "#Delta Z Sec. Vtx. (cm)", {HistType::kTH2F, {thnConfigAxisPt, thnConfigAxisDeltaSecVtxCoord}});
145149
addHistogramsRec("hd0VsPtProng0", "prong 0 DCAxy to prim. vertex (cm)", "#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins}}});
146150
addHistogramsRec("hd0VsPtProng1", "prong 1 DCAxy to prim. vertex (cm)", "#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins}}});
147151
addHistogramsRec("hd0VsPtProng2", "prong 2 DCAxy to prim. vertex (cm)", "#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins}}});
@@ -257,15 +261,18 @@ struct Alice3HfTask3Prong {
257261
registry.fill(histoPrefix + HIST("hImpParErrProng1VsPt") + histoSuffix, candidate.errorImpactParameterY1(), candidate.pt());
258262
registry.fill(histoPrefix + HIST("hImpParErrProng2VsPt") + histoSuffix, candidate.errorImpactParameterY2(), candidate.pt());
259263
registry.fill(histoPrefix + HIST("hDecLenErrVsPt") + histoSuffix, candidate.errorDecayLength(), candidate.pt());
264+
registry.fill(histoPrefix + HIST("hDeltaXRecoGenSecVtx") + histoSuffix, candidate.pt(), candidate.deltaXSecVtx());
265+
registry.fill(histoPrefix + HIST("hDeltaYRecoGenSecVtx") + histoSuffix, candidate.pt(), candidate.deltaYSecVtx());
266+
registry.fill(histoPrefix + HIST("hDeltaZRecoGenSecVtx") + histoSuffix, candidate.pt(), candidate.deltaZSecVtx());
260267
}
261268

262269
/// Fill MC histograms at reconstruction level
263270
/// \tparam CharmHad is the charm hadron species
264271
/// \tparam SaveMl indicates whether ML scores are saved in the THnSparse
265272
/// \tparam CandsRec is the type of the reconstructed candidates collection
266273
/// \param candidates is the collection of reconstructed candidates
267-
template <CharmHadAlice3 CharmHad, bool SaveMl, typename CandsRec, typename AllParticles>
268-
void fillHistosMcRec(CandsRec const& candidates, AllParticles const& allParticles)
274+
template <CharmHadAlice3 CharmHad, bool SaveMl, typename CandsRec, typename GenParticles>
275+
void fillHistosMcRec(CandsRec const& candidates, GenParticles const& genParticles)
269276
{
270277
registry.fill(HIST("MC/rec/hCandidateCounter"), 0.);
271278
for (const auto& candidate : candidates) {
@@ -277,13 +284,13 @@ struct Alice3HfTask3Prong {
277284
registry.fill(HIST("MC/rec/hCandidateCounter"), 2.);
278285
if (candidate.particleMcRec() >= 0) {
279286
registry.fill(HIST("MC/rec/hCandidateCounter"), 3.);
280-
auto mcParticle = allParticles.iteratorAt(candidate.particleMcRec());
287+
auto mcParticle = genParticles.iteratorAt(candidate.particleMcRec());
281288
if (mcParticle.has_daughters()) {
282289
auto daughters = mcParticle.daughtersIds();
283290
LOG(debug) << "Reco candidate matched to MC particle with PDG " << mcParticle.pdgCode() << " daughters: " << daughters.size();
284291
int prongIdx = 0;
285292
for (int dauId = daughters[0]; dauId <= daughters[1]; dauId++) {
286-
auto dau = allParticles.iteratorAt(dauId);
293+
auto dau = genParticles.iteratorAt(dauId);
287294
LOG(debug) << " dauId: " << dauId << " PDG: " << dau.pdgCode() << " with pT: " << dau.pt();
288295
switch (prongIdx) {
289296
case 0:
@@ -376,9 +383,9 @@ struct Alice3HfTask3Prong {
376383
/// \tparam ParticleType is the type of the generated particle
377384
/// \tparam TableType is the type of the full table (non-Partition)
378385
/// \param particle is a generated particle
379-
/// \param allParticles is the full table of particles for iteratorAt access
386+
/// \param genParticles is the full table of particles for iteratorAt access
380387
template <CharmHadAlice3 CharmHad, int SignalType, typename ParticleType, typename TableType>
381-
void fillHistogramsGen(ParticleType const& particle, TableType const& allParticles)
388+
void fillHistogramsGen(ParticleType const& particle, TableType const& genParticles)
382389
{
383390
LOG(debug) << "Filling generated histograms for signal type " << SignalType;
384391
static constexpr auto histoPrefix = HIST("MC/gen/") + HIST(SignalFolders[SignalType]) + HIST("/");
@@ -400,7 +407,7 @@ struct Alice3HfTask3Prong {
400407
float pz = 0.f;
401408
float e = 0.f;
402409
for (int iDau = firstDauIdx; iDau <= lastDauIdx && iDau > 0; iDau++) {
403-
const auto& dau = allParticles.iteratorAt(iDau);
410+
const auto& dau = genParticles.iteratorAt(iDau);
404411
e += dau.e();
405412
px += dau.px();
406413
py += dau.py();
@@ -415,11 +422,11 @@ struct Alice3HfTask3Prong {
415422
/// Fill MC histograms at generated level
416423
/// \tparam CharmHad is the charm hadron species
417424
/// \tparam CandsGen is the type of the generated candidates collection
418-
/// \tparam AllParticles is the type of the full particle table
425+
/// \tparam GenParticles is the type of the full particle table
419426
/// \param mcParticles is the collection of generated particles (can be a Partition)
420-
/// \param allParticles is the full table of particles
421-
template <CharmHadAlice3 CharmHad, typename CandsGen, typename AllParticles>
422-
void fillHistosMcGen(CandsGen const& mcParticles, AllParticles const& allParticles)
427+
/// \param genParticles is the full table of particles
428+
template <CharmHadAlice3 CharmHad, typename CandsGen, typename GenParticles>
429+
void fillHistosMcGen(CandsGen const& mcParticles, GenParticles const& genParticles)
423430
{
424431
// MC gen.
425432
for (const auto& particle : mcParticles) {
@@ -431,14 +438,14 @@ struct Alice3HfTask3Prong {
431438
const auto ptGen = particle.pt();
432439
const auto originType = particle.originMcGen();
433440

434-
fillHistogramsGen<CharmHad, Signal>(particle, allParticles);
441+
fillHistogramsGen<CharmHad, Signal>(particle, genParticles);
435442

436443
float ptGenB = -1.f;
437444
if (originType == RecoDecay::OriginType::Prompt) {
438-
fillHistogramsGen<CharmHad, Prompt>(particle, allParticles);
445+
fillHistogramsGen<CharmHad, Prompt>(particle, genParticles);
439446
} else if (particle.originMcGen() == RecoDecay::OriginType::NonPrompt) {
440447
ptGenB = particle.bHadMotherPtGen();
441-
fillHistogramsGen<CharmHad, NonPrompt>(particle, allParticles);
448+
fillHistogramsGen<CharmHad, NonPrompt>(particle, genParticles);
442449
}
443450

444451
if (fillThn) {

Common/TableProducer/qVectorsTable.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -590,15 +590,15 @@ struct qVectorsTable {
590590
float sumAmplFT0C = 0.;
591591
float sumAmplFT0M = 0.;
592592
float sumAmplFV0A = 0.;
593-
593+
594594
if (coll.has_foundFT0() && (useDetector["QvectorFT0As"] || useDetector["QvectorFT0Cs"] || useDetector["QvectorFT0Ms"])) {
595595
auto ft0 = coll.foundFT0();
596-
596+
597597
if (useDetector["QvectorFT0As"]) {
598598
for (std::size_t iChA = 0; iChA < ft0.channelA().size(); iChA++) {
599599
float ampl = ft0.amplitudeA()[iChA];
600600
int FT0AchId = ft0.channelA()[iChA];
601-
601+
602602
histosQA.fill(HIST("FT0Amp"), ampl, FT0AchId);
603603
histosQA.fill(HIST("FT0AmpCor"), ampl / FT0RelGainConst[FT0AchId], FT0AchId);
604604

PWGJE/Tasks/CMakeLists.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,10 @@ if(FastJet_FOUND)
188188
SOURCES v0QA.cxx
189189
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
190190
COMPONENT_NAME Analysis)
191-
o2physics_add_dpl_workflow(jet-finder-charged-qa
192-
SOURCES jetFinderQA.cxx
193-
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
194-
COMPONENT_NAME Analysis)
191+
# o2physics_add_dpl_workflow(jet-finder-charged-qa
192+
# SOURCES jetFinderQA.cxx
193+
# PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
194+
# COMPONENT_NAME Analysis)
195195
o2physics_add_dpl_workflow(jet-outlier-qa
196196
SOURCES jetOutlierQA.cxx
197197
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
@@ -366,11 +366,11 @@ if(FastJet_FOUND)
366366
SOURCES dijetFinderQA.cxx
367367
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
368368
COMPONENT_NAME Analysis)
369-
o2physics_add_dpl_workflow(bjet-tagging-gnn
370-
SOURCES bjetTaggingGnn.cxx
371-
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2Physics::EventFilteringUtils
372-
O2Physics::AnalysisCCDB
373-
COMPONENT_NAME Analysis)
369+
# o2physics_add_dpl_workflow(bjet-tagging-gnn
370+
# SOURCES bjetTaggingGnn.cxx
371+
# PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2Physics::EventFilteringUtils
372+
# O2Physics::AnalysisCCDB
373+
# COMPONENT_NAME Analysis)
374374
o2physics_add_dpl_workflow(jet-shape
375375
SOURCES jetShape.cxx
376376
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore

0 commit comments

Comments
 (0)