Skip to content

Commit 62b34be

Browse files
committed
Implement requested changes in candidate and tree creator
1 parent faad520 commit 62b34be

2 files changed

Lines changed: 44 additions & 49 deletions

File tree

PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ struct HfCandidateCreatorXicToXiPiPi {
9999

100100
void init(InitContext const&)
101101
{
102+
if ((doprocessXicplusWithDcaFitter + doprocessXicplusWithKFParticle) != 1) {
103+
LOGP(fatal, "Only one process function can be enabled at a time.");
104+
}
105+
102106
// add histograms to registry
103107
if (fillHistograms) {
104108
registry.add("hMass3", "3-prong candidates;inv. mass (#Xi #pi #pi) (GeV/#it{c}^{2});entries", {HistType::kTH1D, {{500, 2.3, 2.7}}});
@@ -115,24 +119,21 @@ struct HfCandidateCreatorXicToXiPiPi {
115119
registry.add("hDcaZProngs", "DCAz of 3-prong candidates;#it{p}_{T} (GeV/#it{c};#it{d}_{z}) (#mum);entries", {HistType::kTH2D, {{100, 0., 20.}, {200, -500., 500.}}});
116120
}
117121

122+
// fill hVertexerType histogram
123+
if ((doprocessXicplusWithDcaFitter == 1) && fillHistograms) {
124+
registry.fill(HIST("hVertexerType"), aod::hf_cand::VertexerType::DCAFitter);
125+
}
126+
if ((doprocessXicplusWithKFParticle == 1) && fillHistograms) {
127+
registry.fill(HIST("hVertexerType"), aod::hf_cand::VertexerType::KfParticle);
128+
}
129+
118130
// initialize CCDB
119131
ccdb->setURL(ccdbUrl);
120132
ccdb->setCaching(true);
121133
ccdb->setLocalObjectValidityChecking();
122134
lut = o2::base::MatLayerCylSet::rectifyPtrFromFile(ccdb->get<o2::base::MatLayerCylSet>(ccdbPathLut));
123135
runNumber = 0;
124136

125-
// fill hVertexerType histogram
126-
if ((doprocessXicPlusWithDcaFitter + doprocessXicPlusWithKFParticleFromDerivedData) != 1) {
127-
LOGP(fatal, "Only one process function can be enabled at a time.");
128-
}
129-
if ((doprocessXicPlusWithDcaFitter == 1) && fillHistograms) {
130-
registry.fill(HIST("hVertexerType"), aod::hf_cand::VertexerType::DCAFitter);
131-
}
132-
if ((doprocessXicPlusWithKFParticleFromDerivedData == 1) && fillHistograms) {
133-
registry.fill(HIST("hVertexerType"), aod::hf_cand::VertexerType::KfParticle);
134-
}
135-
136137
// initialize 3-prong vertex fitter
137138
df.setPropagateToPCA(propagateToPCA);
138139
df.setMaxR(maxR);
@@ -143,7 +144,7 @@ struct HfCandidateCreatorXicToXiPiPi {
143144
df.setWeightedFinalPCA(useWeightedFinalPCA);
144145
}
145146

146-
void processXicPlusWithDcaFitter(aod::Collisions const&,
147+
void processXicplusWithDcaFitter(aod::Collisions const&,
147148
aod::HfCascLf3Prongs const& rowsTrackIndexXicPlus,
148149
CascadesLinked const&,
149150
CascFull const&,
@@ -321,14 +322,14 @@ struct HfCandidateCreatorXicToXiPiPi {
321322
massXiPi0, massXiPi1);
322323
} // loop over track triplets
323324
}
324-
PROCESS_SWITCH(HfCandidateCreatorXicToXiPiPi, processXicPlusWithDcaFitter, "Run candidate creator with DCAFitter.", true);
325-
326-
void processXicPlusWithKFParticleFromDerivedData(aod::Collisions const&,
327-
aod::HfCascLf3Prongs const& rowsTrackIndexXicPlus,
328-
KFCascadesLinked const&,
329-
KFCascFull const&,
330-
aod::TracksWCovExtra const&,
331-
aod::BCsWithTimestamps const&)
325+
PROCESS_SWITCH(HfCandidateCreatorXicToXiPiPi, processXicplusWithDcaFitter, "Run candidate creator with DCAFitter.", true);
326+
327+
void processXicplusWithKFParticle(aod::Collisions const&,
328+
aod::HfCascLf3Prongs const& rowsTrackIndexXicPlus,
329+
KFCascadesLinked const&,
330+
KFCascFull const&,
331+
aod::TracksWCovExtra const&,
332+
aod::BCsWithTimestamps const&)
332333
{
333334
// loop over triplets of track indices
334335
for (const auto& rowTrackIndexXicPlus : rowsTrackIndexXicPlus) {
@@ -506,7 +507,7 @@ struct HfCandidateCreatorXicToXiPiPi {
506507
dcaXYPi0Pi1, dcaXYPi0Xi, dcaXYPi1Xi);
507508
} // loop over track triplets
508509
}
509-
PROCESS_SWITCH(HfCandidateCreatorXicToXiPiPi, processXicPlusWithKFParticleFromDerivedData, "Run candidate creator with KFParticle using derived data from HfTrackIndexSkimCreatorLfCascades.", false);
510+
PROCESS_SWITCH(HfCandidateCreatorXicToXiPiPi, processXicplusWithKFParticle, "Run candidate creator with KFParticle using derived data from HfTrackIndexSkimCreatorLfCascades.", false);
510511
}; // struct
511512

512513
/// Performs MC matching.

PWGHF/TableProducer/treeCreatorXicToXiPiPi.cxx

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,9 @@ DECLARE_SOA_COLUMN(DcaPi0Xi, dcaPi0Xi, float);
9292
DECLARE_SOA_COLUMN(DcaPi1Xi, dcaPi1Xi, float);
9393
DECLARE_SOA_COLUMN(InvMassXiPi0, invMassXiPi0, float);
9494
DECLARE_SOA_COLUMN(InvMassXiPi1, invMassXiPi1, float);
95-
// PID daughters
96-
DECLARE_SOA_COLUMN(NSigTpcPi1, nSigTpcPi1, float); //! TPC Nsigma separation for prong1 with pion mass hypothesis
97-
DECLARE_SOA_COLUMN(NSigTofPi1, nSigTofPi1, float); //! TOF Nsigma separation for prong1 with pion mass hypothesis
98-
// Events
99-
DECLARE_SOA_COLUMN(IsEventReject, isEventReject, int); //! Event rejection flag
100-
DECLARE_SOA_COLUMN(RunNumber, runNumber, int); //! Run number
10195
} // namespace full
10296

103-
DECLARE_SOA_TABLE(HfCandXicLites, "AOD", "HFCANDXICLITE",
97+
DECLARE_SOA_TABLE(HfCandXicToXiPiPiLites, "AOD", "HFXICXI2PILITE",
10498
full::XiId,
10599
full::Pi0Id,
106100
full::Pi1Id,
@@ -137,7 +131,7 @@ DECLARE_SOA_TABLE(HfCandXicLites, "AOD", "HFCANDXICLITE",
137131
full::CpaXYLam,
138132
hf_cand_xic_to_xi_pi_pi::FlagMcMatchRec);
139133

140-
DECLARE_SOA_TABLE(HfCandXicLiteKfs, "AOD", "HFCANDXICLITEKF",
134+
DECLARE_SOA_TABLE(HfCandXicToXiPiPiLiteKfs, "AOD", "HFXICXI2PILITKF",
141135
full::XiId,
142136
full::Pi0Id,
143137
full::Pi1Id,
@@ -179,7 +173,7 @@ DECLARE_SOA_TABLE(HfCandXicLiteKfs, "AOD", "HFCANDXICLITEKF",
179173
full::DcaPi1Xi,
180174
hf_cand_xic_to_xi_pi_pi::FlagMcMatchRec);
181175

182-
DECLARE_SOA_TABLE(HfCandXicFulls, "AOD", "HFCANDXICFULL",
176+
DECLARE_SOA_TABLE(HfCandXicToXiPiPiFulls, "AOD", "HFXICXI2PIFULL",
183177
full::XiId,
184178
full::Pi0Id,
185179
full::Pi1Id,
@@ -236,7 +230,7 @@ DECLARE_SOA_TABLE(HfCandXicFulls, "AOD", "HFCANDXICFULL",
236230
full::InvMassXiPi1,
237231
hf_cand_xic_to_xi_pi_pi::FlagMcMatchRec);
238232

239-
DECLARE_SOA_TABLE(HfCandXicFullKfs, "AOD", "HFCANDXICFULLKF",
233+
DECLARE_SOA_TABLE(HfCandXicToXiPiPiFullKfs, "AOD", "HFXICXI2PIFULKF",
240234
full::XiId,
241235
full::Pi0Id,
242236
full::Pi1Id,
@@ -298,14 +292,14 @@ DECLARE_SOA_TABLE(HfCandXicFullKfs, "AOD", "HFCANDXICFULLKF",
298292
full::DcaPi1Xi,
299293
hf_cand_xic_to_xi_pi_pi::FlagMcMatchRec);
300294

301-
DECLARE_SOA_TABLE(HfCandXicFullEvs, "AOD", "HFCANDXICFULLEV",
295+
DECLARE_SOA_TABLE(HfCandXicToXiPiPiFullEvs, "AOD", "HFXICXI2PIFULEV",
302296
collision::BCId,
303297
collision::NumContrib,
304298
collision::PosX,
305299
collision::PosY,
306300
collision::PosZ);
307301

308-
DECLARE_SOA_TABLE(HfCandXicFullPs, "AOD", "HFCANDXICFULLP",
302+
DECLARE_SOA_TABLE(HfCandXicToXiPiPiFullPs, "AOD", "HFXICXI2PIFULLP",
309303
collision::BCId,
310304
full::Pt,
311305
full::Eta,
@@ -316,12 +310,12 @@ DECLARE_SOA_TABLE(HfCandXicFullPs, "AOD", "HFCANDXICFULLP",
316310

317311
/// Writes the full information in an output TTree
318312
struct HfTreeCreatorXicToXiPiPi {
319-
Produces<o2::aod::HfCandXicLites> rowCandidateLite;
320-
Produces<o2::aod::HfCandXicLiteKfs> rowCandidateLiteKf;
321-
Produces<o2::aod::HfCandXicFulls> rowCandidateFull;
322-
Produces<o2::aod::HfCandXicFullKfs> rowCandidateFullKf;
323-
Produces<o2::aod::HfCandXicFullEvs> rowCandidateFullEvents;
324-
Produces<o2::aod::HfCandXicFullPs> rowCandidateFullParticles;
313+
Produces<o2::aod::HfCandXicToXiPiPiLites> rowCandidateLite;
314+
Produces<o2::aod::HfCandXicToXiPiPiLiteKfs> rowCandidateLiteKf;
315+
Produces<o2::aod::HfCandXicToXiPiPiFulls> rowCandidateFull;
316+
Produces<o2::aod::HfCandXicToXiPiPiFullKfs> rowCandidateFullKf;
317+
Produces<o2::aod::HfCandXicToXiPiPiFullEvs> rowCandidateFullEvents;
318+
Produces<o2::aod::HfCandXicToXiPiPiFullPs> rowCandidateFullParticles;
325319

326320
Configurable<int> selectionFlagXic{"selectionXic", 1, "Selection Flag for Xic"};
327321
Configurable<bool> fillCandidateLiteTable{"fillCandidateLiteTable", false, "Switch to fill lite table with candidate properties"};
@@ -359,14 +353,14 @@ struct HfTreeCreatorXicToXiPiPi {
359353
collision.posZ());
360354
}
361355

362-
template <bool doMc = false, bool noKf = true, typename T>
356+
template <bool doMc, bool doKf, typename T>
363357
void fillCandidateTable(const T& candidate)
364358
{
365359
int8_t flagMc = 0;
366360
if constexpr (doMc) {
367361
flagMc = candidate.flagMcMatchRec();
368362
}
369-
if constexpr (noKf) {
363+
if constexpr (!doKf) {
370364
if (fillCandidateLiteTable) {
371365
rowCandidateLite(
372366
candidate.cascadeId(),
@@ -594,7 +588,7 @@ struct HfTreeCreatorXicToXiPiPi {
594588
continue;
595589
}
596590
}
597-
fillCandidateTable(candidate);
591+
fillCandidateTable<false, false>(candidate);
598592
}
599593
}
600594
PROCESS_SWITCH(HfTreeCreatorXicToXiPiPi, processData, "Process data", true);
@@ -622,7 +616,7 @@ struct HfTreeCreatorXicToXiPiPi {
622616
continue;
623617
}
624618
}
625-
fillCandidateTable<false, false>(candidate);
619+
fillCandidateTable<false, true>(candidate);
626620
}
627621
}
628622
PROCESS_SWITCH(HfTreeCreatorXicToXiPiPi, processDataKf, "Process data with KF Particle reconstruction", false);
@@ -647,7 +641,7 @@ struct HfTreeCreatorXicToXiPiPi {
647641
rowCandidateFull.reserve(recSig.size());
648642
}
649643
for (const auto& candidate : recSig) {
650-
fillCandidateTable<true, true>(candidate);
644+
fillCandidateTable<true, false>(candidate);
651645
}
652646
} else if (fillOnlyBackground) {
653647
if (fillCandidateLiteTable) {
@@ -660,7 +654,7 @@ struct HfTreeCreatorXicToXiPiPi {
660654
if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) {
661655
continue;
662656
}
663-
fillCandidateTable<true, true>(candidate);
657+
fillCandidateTable<true, false>(candidate);
664658
}
665659
} else {
666660
if (fillCandidateLiteTable) {
@@ -669,7 +663,7 @@ struct HfTreeCreatorXicToXiPiPi {
669663
rowCandidateFull.reserve(candidates.size());
670664
}
671665
for (const auto& candidate : candidates) {
672-
fillCandidateTable<true, true>(candidate);
666+
fillCandidateTable<true, false>(candidate);
673667
}
674668
}
675669

@@ -709,7 +703,7 @@ struct HfTreeCreatorXicToXiPiPi {
709703
rowCandidateFull.reserve(recSigKf.size());
710704
}
711705
for (const auto& candidate : recSigKf) {
712-
fillCandidateTable<true, false>(candidate);
706+
fillCandidateTable<true, true>(candidate);
713707
}
714708
} else if (fillOnlyBackground) {
715709
if (fillCandidateLiteTable) {
@@ -722,7 +716,7 @@ struct HfTreeCreatorXicToXiPiPi {
722716
if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) {
723717
continue;
724718
}
725-
fillCandidateTable<true, false>(candidate);
719+
fillCandidateTable<true, true>(candidate);
726720
}
727721
} else {
728722
if (fillCandidateLiteTable) {
@@ -731,7 +725,7 @@ struct HfTreeCreatorXicToXiPiPi {
731725
rowCandidateFull.reserve(candidates.size());
732726
}
733727
for (const auto& candidate : candidates) {
734-
fillCandidateTable<true, false>(candidate);
728+
fillCandidateTable<true, true>(candidate);
735729
}
736730
}
737731

0 commit comments

Comments
 (0)