Skip to content

Commit 21bc759

Browse files
authored
Rename HF tables, adjust index to V0 (#501)
* add V0Link table to finder * Rename HF tables, adjust index to V0
1 parent 150b00d commit 21bc759

8 files changed

Lines changed: 75 additions & 54 deletions

File tree

Common/Tools/aodDataModelGraph.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,8 @@ int main(int, char**)
281281

282282
displayEntities<MFTTracks, FwdTracks, FwdTracksCov>();
283283

284-
displayEntities<HfTrackIndexProng2, HfCandProng2>();
285-
displayEntities<HfTrackIndexProng3, HfCandProng3>();
284+
displayEntities<Hf2Prong, HfCandProng2>();
285+
displayEntities<Hf3Prong, HfCandProng3>();
286286

287287
graphFooter();
288288
return 0;

EventFiltering/PWGHF/HFFilter.cxx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ struct AddCollisionId {
225225
Produces<o2::aod::Colls2Prong> colls2Prong;
226226
Produces<o2::aod::Colls3Prong> colls3Prong;
227227

228-
void process(aod::HfTrackIndexProng2 const& cand2Prongs,
229-
aod::HfTrackIndexProng3 const& cand3Prongs,
228+
void process(aod::Hf2Prong const& cand2Prongs,
229+
aod::Hf3Prong const& cand3Prongs,
230230
aod::Tracks const&)
231231
{
232232
for (const auto& cand2Prong : cand2Prongs) {
@@ -572,7 +572,7 @@ struct HfFilter { // Main struct for HF triggers
572572
/// \param CharmCandMomentum is the three momentum of a charm candidate
573573
/// \param CharmMass is the mass of the charm hadron
574574
/// \return relative momentum of pair
575-
template <typename T> //template <typename T, typename C>
575+
template <typename T> // template <typename T, typename C>
576576
float computeRelativeMomentum(const T& track, const std::array<float, 3>& CharmCandMomentum, const float& CharmMass)
577577
{
578578
ROOT::Math::PxPyPzMVector part1(track.px(), track.py(), track.pz(), massProton);
@@ -586,10 +586,10 @@ struct HfFilter { // Main struct for HF triggers
586586

587587
float kStar = 0.5 * trackRelK.P();
588588
return kStar;
589-
} //float computeRelativeMomentum(const T& track, const std::array<float, 3>& CharmCandMomentum, const float& CharmMass)
589+
} // float computeRelativeMomentum(const T& track, const std::array<float, 3>& CharmCandMomentum, const float& CharmMass)
590590

591-
using HfTrackIndexProng2withColl = soa::Join<aod::HfTrackIndexProng2, aod::Colls2Prong>;
592-
using HfTrackIndexProng3withColl = soa::Join<aod::HfTrackIndexProng3, aod::Colls3Prong>;
591+
using HfTrackIndexProng2withColl = soa::Join<aod::Hf2Prong, aod::Colls2Prong>;
592+
using HfTrackIndexProng3withColl = soa::Join<aod::Hf3Prong, aod::Colls3Prong>;
593593
using BigTracksWithProtonPID = soa::Join<aod::BigTracksExtended, aod::TrackSelection, aod::pidTPCFullPr, aod::pidTOFFullPr>;
594594
using BigTracksMCPID = soa::Join<aod::BigTracksExtended, aod::pidTPCFullPi, aod::pidTOFFullPi, aod::pidTPCFullKa, aod::pidTOFFullKa, aod::pidTPCFullPr, aod::pidTOFFullPr, aod::BigTracksMC>;
595595

@@ -863,8 +863,8 @@ struct HfFilter { // Main struct for HF triggers
863863
}
864864
}
865865

866-
void processTraining(aod::HfTrackIndexProng2 const& cand2Prongs,
867-
aod::HfTrackIndexProng3 const& cand3Prongs,
866+
void processTraining(aod::Hf2Prong const& cand2Prongs,
867+
aod::Hf3Prong const& cand3Prongs,
868868
aod::McParticles_000 const& particlesMC,
869869
BigTracksMCPID const&)
870870
{
@@ -918,7 +918,7 @@ struct HfFilter { // Main struct for HF triggers
918918
}
919919
if (indexRec < 0) {
920920
// Ds± → K± K∓ π±
921-
indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, 431, array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign); //TODO: replace hard coded pdg code
921+
indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, 431, array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign); // TODO: replace hard coded pdg code
922922
if (indexRec >= 0) {
923923
channel = kDs;
924924
}

PWGHF/DataModel/HFSecondaryVertex.h

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,11 @@ using BigTracksPIDExtended = soa::Join<BigTracksPID, aod::TracksExtended>;
6464

6565
namespace hf_track_index
6666
{
67-
DECLARE_SOA_INDEX_COLUMN_FULL(Index0, index0, int, Tracks, "_0"); //!
68-
DECLARE_SOA_INDEX_COLUMN_FULL(Index1, index1, int, Tracks, "_1"); //!
69-
DECLARE_SOA_INDEX_COLUMN_FULL(Index2, index2, int, Tracks, "_2"); //!
70-
DECLARE_SOA_INDEX_COLUMN_FULL(Index3, index3, int, Tracks, "_3"); //!
71-
DECLARE_SOA_INDEX_COLUMN_FULL(IndexV0, indexV0, int, aod::V0Datas, "_V0"); //!
72-
DECLARE_SOA_COLUMN(HFflag, hfflag, uint8_t); //!
67+
DECLARE_SOA_INDEX_COLUMN_FULL(Index0, index0, int, Tracks, "_0"); //! Index to first prong
68+
DECLARE_SOA_INDEX_COLUMN_FULL(Index1, index1, int, Tracks, "_1"); //! Index to second prong
69+
DECLARE_SOA_INDEX_COLUMN_FULL(Index2, index2, int, Tracks, "_2"); //! Index to third prong
70+
DECLARE_SOA_INDEX_COLUMN(V0, v0); //! Index to V0 prong
71+
DECLARE_SOA_COLUMN(HFflag, hfflag, uint8_t); //!
7372

7473
DECLARE_SOA_COLUMN(D0ToKPiFlag, d0ToKPiFlag, uint8_t); //!
7574
DECLARE_SOA_COLUMN(JpsiToEEFlag, jpsiToEEFlag, uint8_t); //!
@@ -81,27 +80,40 @@ DECLARE_SOA_COLUMN(DsKKPiFlag, dsKKPiFlag, uint8_t); //!
8180
DECLARE_SOA_COLUMN(XicToPKPiFlag, xicToPKPiFlag, uint8_t); //!
8281
} // namespace hf_track_index
8382

84-
DECLARE_SOA_TABLE(HfTrackIndexProng2, "AOD", "HFTRACKIDXP2", //!
83+
DECLARE_SOA_TABLE(Hf2Prong, "AOD", "HF2PRONG", //! Table for HF 2 prong candidates
84+
o2::soa::Index<>,
8585
hf_track_index::Index0Id,
8686
hf_track_index::Index1Id,
8787
hf_track_index::HFflag);
8888

89-
DECLARE_SOA_TABLE(HfTrackIndexCasc, "AOD", "HFTRACKIDXCASC", //!
89+
DECLARE_SOA_TABLE(HfCascade, "AOD", "HFCASCADE", //! Table for HF candidates with a V0
90+
o2::soa::Index<>,
9091
hf_track_index::Index0Id,
91-
hf_track_index::IndexV0Id,
92+
hf_track_index::V0Id,
9293
hf_track_index::HFflag);
9394

94-
DECLARE_SOA_TABLE(HfCutStatusProng2, "AOD", "HFCUTSTATUSP2", //!
95-
hf_track_index::D0ToKPiFlag,
96-
hf_track_index::JpsiToEEFlag,
97-
hf_track_index::JpsiToMuMuFlag);
98-
99-
DECLARE_SOA_TABLE(HfTrackIndexProng3, "AOD", "HFTRACKIDXP3", //!
95+
DECLARE_SOA_TABLE(Hf3Prong, "AOD", "HF3PRONG", //! Table for HF 3 prong candidates
96+
o2::soa::Index<>,
10097
hf_track_index::Index0Id,
10198
hf_track_index::Index1Id,
10299
hf_track_index::Index2Id,
103100
hf_track_index::HFflag);
104101

102+
namespace hf_track_index
103+
{
104+
DECLARE_SOA_INDEX_COLUMN_FULL(IndexD0, indexD0, int, Hf2Prong, ""); //! Index to a D0 prong
105+
} // namespace hf_track_index
106+
107+
DECLARE_SOA_TABLE(HfDStar, "AOD", "HFDSTAR", //! D* -> D0pi candidates
108+
o2::soa::Index<>,
109+
hf_track_index::Index0Id,
110+
hf_track_index::IndexD0Id);
111+
112+
DECLARE_SOA_TABLE(HfCutStatusProng2, "AOD", "HFCUTSTATUSP2", //!
113+
hf_track_index::D0ToKPiFlag,
114+
hf_track_index::JpsiToEEFlag,
115+
hf_track_index::JpsiToMuMuFlag);
116+
105117
DECLARE_SOA_TABLE(HfCutStatusProng3, "AOD", "HFCUTSTATUSP3", //!
106118
hf_track_index::DPlusPiKPiFlag,
107119
hf_track_index::LcPKPiFlag,
@@ -236,7 +248,7 @@ DECLARE_SOA_COLUMN(OriginMCGen, originMCGen, int8_t); //! particle origin,
236248
enum DecayType { D0ToPiK = 0,
237249
JpsiToEE,
238250
JpsiToMuMu,
239-
N2ProngDecays }; //always keep N2ProngDecays at the end
251+
N2ProngDecays }; // always keep N2ProngDecays at the end
240252

241253
// functions for specific particles
242254

@@ -402,7 +414,7 @@ DECLARE_SOA_EXPRESSION_COLUMN(Py, py, //!
402414
float, 1.f * aod::hf_cand::pyProng0 + 1.f * aod::hf_cand::pyProng1);
403415
DECLARE_SOA_EXPRESSION_COLUMN(Pz, pz, //!
404416
float, 1.f * aod::hf_cand::pzProng0 + 1.f * aod::hf_cand::pzProng1);
405-
//DECLARE_SOA_DYNAMIC_COLUMN(M, m, [](float px0, float py0, float pz0, float px1, float py1, float pz1, const array<double, 2>& m) { return RecoDecay::M(array{array{px0, py0, pz0}, array{px1, py1, pz1}}, m); });
417+
// DECLARE_SOA_DYNAMIC_COLUMN(M, m, [](float px0, float py0, float pz0, float px1, float py1, float pz1, const array<double, 2>& m) { return RecoDecay::M(array{array{px0, py0, pz0}, array{px1, py1, pz1}}, m); });
406418
DECLARE_SOA_DYNAMIC_COLUMN(PtV0Pos, ptV0Pos, //!
407419
[](float px, float py) { return RecoDecay::Pt(px, py); });
408420
DECLARE_SOA_DYNAMIC_COLUMN(PtV0Neg, ptV0Neg, //!
@@ -425,15 +437,15 @@ auto InvMassGamma(const T& candidate)
425437
} // namespace hf_cand_casc
426438

427439
DECLARE_SOA_TABLE(HfCandCascBase, "AOD", "HFCANDCASCBASE", //!
428-
// general columns
440+
// general columns
429441
HFCAND_COLUMNS,
430442
// cascade specific columns
431443
hf_cand::PxProng0, hf_cand::PyProng0, hf_cand::PzProng0,
432444
hf_cand::PxProng1, hf_cand::PyProng1, hf_cand::PzProng1,
433445
hf_cand::ImpactParameter0, hf_cand::ImpactParameter1,
434446
hf_cand::ErrorImpactParameter0, hf_cand::ErrorImpactParameter1,
435447
hf_track_index::Index0Id,
436-
hf_track_index::IndexV0Id, // V0 index
448+
hf_track_index::V0Id, // V0 index
437449
hf_track_index::HFflag,
438450
// V0
439451
v0data::X, v0data::Y, v0data::Z,
@@ -613,7 +625,7 @@ enum DecayType { DPlusToPiKPi = 0,
613625
LcToPKPi,
614626
DsToPiKK,
615627
XicToPKPi,
616-
N3ProngDecays }; //always keep N3ProngDecays at the end
628+
N3ProngDecays }; // always keep N3ProngDecays at the end
617629

618630
// functions for specific particles
619631

@@ -1132,7 +1144,7 @@ DECLARE_SOA_COLUMN(DebugMCRec, debugMCRec, int8_t); // debug flag for mi
11321144
enum DecayType { LbToLcPi }; // move this to a dedicated cascade namespace in the future?
11331145

11341146
// Λb → Λc+ π- → p K- π+ π-
1135-
//float massLb = RecoDecay::getMassPDG(pdg::Code::kLambdaB0);
1147+
// float massLb = RecoDecay::getMassPDG(pdg::Code::kLambdaB0);
11361148
template <typename T>
11371149
auto CtLb(const T& candidate)
11381150
{

PWGHF/TableProducer/HFCandidateCreator2Prong.cxx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ struct HFCandidateCreator2Prong {
5050
double massKPi{0.};
5151

5252
void process(aod::Collisions const& collisions,
53-
aod::HfTrackIndexProng2 const& rowsTrackIndexProng2,
53+
aod::Hf2Prong const& rowsTrackIndexProng2,
5454
aod::BigTracks const& tracks)
5555
{
5656
// 2-prong vertex fitter
@@ -152,21 +152,21 @@ struct HFCandidateCreator2ProngExpressions {
152152
// Match reconstructed candidates.
153153
// Spawned table can be used directly
154154
for (auto& candidate : *rowCandidateProng2) {
155-
//Printf("New rec. candidate");
155+
// Printf("New rec. candidate");
156156
flag = 0;
157157
origin = 0;
158158
auto arrayDaughters = array{candidate.index0_as<aod::BigTracksMC>(), candidate.index1_as<aod::BigTracksMC>()};
159159

160160
// D0(bar) → π± K∓
161-
//Printf("Checking D0(bar) → π± K∓");
161+
// Printf("Checking D0(bar) → π± K∓");
162162
indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdg::Code::kD0, array{+kPiPlus, -kKPlus}, true, &sign);
163163
if (indexRec > -1) {
164164
flag = sign * (1 << DecayType::D0ToPiK);
165165
}
166166

167167
// J/ψ → e+ e−
168168
if (flag == 0) {
169-
//Printf("Checking J/ψ → e+ e−");
169+
// Printf("Checking J/ψ → e+ e−");
170170
indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdg::Code::kJpsi, array{+kElectron, -kElectron}, true);
171171
if (indexRec > -1) {
172172
flag = 1 << DecayType::JpsiToEE;
@@ -175,7 +175,7 @@ struct HFCandidateCreator2ProngExpressions {
175175

176176
// J/ψ → μ+ μ−
177177
if (flag == 0) {
178-
//Printf("Checking J/ψ → μ+ μ−");
178+
// Printf("Checking J/ψ → μ+ μ−");
179179
indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdg::Code::kJpsi, array{+kMuonPlus, -kMuonPlus}, true);
180180
if (indexRec > -1) {
181181
flag = 1 << DecayType::JpsiToMuMu;
@@ -193,27 +193,27 @@ struct HFCandidateCreator2ProngExpressions {
193193

194194
// Match generated particles.
195195
for (auto& particle : particlesMC) {
196-
//Printf("New gen. candidate");
196+
// Printf("New gen. candidate");
197197
flag = 0;
198198
origin = 0;
199199

200200
// D0(bar) → π± K∓
201-
//Printf("Checking D0(bar) → π± K∓");
201+
// Printf("Checking D0(bar) → π± K∓");
202202
if (RecoDecay::isMatchedMCGen(particlesMC, particle, pdg::Code::kD0, array{+kPiPlus, -kKPlus}, true, &sign)) {
203203
flag = sign * (1 << DecayType::D0ToPiK);
204204
}
205205

206206
// J/ψ → e+ e−
207207
if (flag == 0) {
208-
//Printf("Checking J/ψ → e+ e−");
208+
// Printf("Checking J/ψ → e+ e−");
209209
if (RecoDecay::isMatchedMCGen(particlesMC, particle, pdg::Code::kJpsi, array{+kElectron, -kElectron}, true)) {
210210
flag = 1 << DecayType::JpsiToEE;
211211
}
212212
}
213213

214214
// J/ψ → μ+ μ−
215215
if (flag == 0) {
216-
//Printf("Checking J/ψ → μ+ μ−");
216+
// Printf("Checking J/ψ → μ+ μ−");
217217
if (RecoDecay::isMatchedMCGen(particlesMC, particle, pdg::Code::kJpsi, array{+kMuonPlus, -kMuonPlus}, true)) {
218218
flag = 1 << DecayType::JpsiToMuMu;
219219
}

PWGHF/TableProducer/HFCandidateCreator3Prong.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ struct HFCandidateCreator3Prong {
5555
double massPiKPi{0.};
5656

5757
void process(aod::Collisions const& collisions,
58-
aod::HfTrackIndexProng3 const& rowsTrackIndexProng3,
58+
aod::Hf3Prong const& rowsTrackIndexProng3,
5959
aod::BigTracks const& tracks)
6060
{
6161
// 3-prong vertex fitter

PWGHF/TableProducer/HFCandidateCreatorCascade.cxx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,11 @@ struct HFCandidateCreatorCascade {
7575
double massLc = RecoDecay::getMassPDG(pdg::Code::kLambdaCPlus);
7676
double mass2K0sP{0.};
7777

78-
void process(aod::Collisions const& collisions,
79-
aod::HfTrackIndexCasc const& rowsTrackIndexCasc,
80-
MyBigTracks const& tracks,
81-
aod::V0Datas const& V0s
78+
void process(aod::Collisions const&,
79+
aod::HfCascade const& rowsTrackIndexCasc,
80+
MyBigTracks const&,
81+
aod::V0sLinked const&,
82+
aod::V0Datas const&
8283
#ifdef MY_DEBUG
8384
,
8485
aod::McParticles_000& mcParticles
@@ -99,7 +100,11 @@ struct HFCandidateCreatorCascade {
99100
for (const auto& casc : rowsTrackIndexCasc) {
100101

101102
const auto& bach = casc.index0_as<MyBigTracks>();
102-
const auto& v0 = casc.indexV0_as<o2::aod::V0Datas>();
103+
if (!casc.v0_as<aod::V0sLinked>().has_v0Data()) {
104+
LOGF(warning, "V0Data not there for V0 %d in HF cascade %d. Skipping candidate.", casc.v0Id(), casc.globalIndex());
105+
continue;
106+
}
107+
const auto& v0 = casc.v0_as<aod::V0sLinked>().v0Data();
103108
const auto& trackV0DaughPos = v0.posTrack_as<MyBigTracks>();
104109
const auto& trackV0DaughNeg = v0.negTrack_as<MyBigTracks>();
105110

@@ -176,7 +181,7 @@ struct HFCandidateCreatorCascade {
176181
pVecV0[0], pVecV0[1], pVecV0[2],
177182
impactParameterBach.getY(), impactParameterV0.getY(),
178183
std::sqrt(impactParameterBach.getSigmaY2()), std::sqrt(impactParameterV0.getSigmaY2()),
179-
casc.index0Id(), casc.indexV0Id(),
184+
casc.index0Id(), casc.v0Id(),
180185
casc.hfflag(),
181186
v0.x(), v0.y(), v0.z(),
182187
//v0.posTrack(), v0.negTrack(), // why this was not fine?

PWGHF/TableProducer/HFTrackIndexSkimsCreator.cxx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -524,9 +524,9 @@ struct HfTagSelTracks {
524524

525525
/// Pre-selection of 2-prong and 3-prong secondary vertices
526526
struct HfTrackIndexSkimsCreator {
527-
Produces<aod::HfTrackIndexProng2> rowTrackIndexProng2;
527+
Produces<aod::Hf2Prong> rowTrackIndexProng2;
528528
Produces<aod::HfCutStatusProng2> rowProng2CutStatus;
529-
Produces<aod::HfTrackIndexProng3> rowTrackIndexProng3;
529+
Produces<aod::Hf3Prong> rowTrackIndexProng3;
530530
Produces<aod::HfCutStatusProng3> rowProng3CutStatus;
531531

532532
//Configurable<int> nCollsMax{"nCollsMax", -1, "Max collisions per file"}; //can be added to run over limited collisions per file - for tesing purposes
@@ -1323,15 +1323,15 @@ struct HfTrackIndexSkimsCreator {
13231323
//________________________________________________________________________________________________________________________
13241324

13251325
/// Pre-selection of cascade secondary vertices
1326-
/// It will produce in any case a HfTrackIndexProng2 object, but mixing a V0
1326+
/// It will produce in any case a Hf2Prong object, but mixing a V0
13271327
/// with a track, instead of 2 tracks
13281328

13291329
/// to run: o2-analysis-weak-decay-indices --aod-file AO2D.root -b | o2-analysis-lambdakzerobuilder -b |
13301330
/// o2-analysis-trackextension -b | o2-analysis-hf-track-index-skims-creator -b
13311331

13321332
struct HfTrackIndexSkimsCreatorCascades {
1333-
Produces<aod::HfTrackIndexCasc> rowTrackIndexCasc;
1334-
// Produces<aod::HfTrackIndexProng2> rowTrackIndexCasc;
1333+
Produces<aod::HfCascade> rowTrackIndexCasc;
1334+
// Produces<aod::Hf2Prong> rowTrackIndexCasc;
13351335

13361336
// whether to do or not validation plots
13371337
Configurable<bool> doValPlots{"doValPlots", true, "fill histograms"};

PWGLF/TableProducer/lambdakzerofinder.cxx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ struct lambdakzeroprefilter {
122122

123123
struct lambdakzerofinder {
124124
Produces<aod::StoredV0Datas> v0data;
125+
Produces<aod::V0s> v0;
126+
Produces<aod::V0DataLink> v0datalink;
125127

126128
HistogramRegistry registry{
127129
"registry",
@@ -155,7 +157,7 @@ struct lambdakzerofinder {
155157

156158
Long_t lNCand = 0;
157159

158-
for (auto& t0id : ptracks) { //FIXME: turn into combination(...)
160+
for (auto& t0id : ptracks) { // FIXME: turn into combination(...)
159161
auto t0 = t0id.goodTrack_as<soa::Join<aod::FullTracks, aod::TracksCov>>();
160162
auto Track1 = getTrackParCov(t0);
161163
for (auto& t1id : ntracks) {
@@ -197,13 +199,15 @@ struct lambdakzerofinder {
197199
}
198200

199201
lNCand++;
202+
v0(t0.collisionId(), t0.globalIndex(), t1.globalIndex());
200203
v0data(t0.globalIndex(), t1.globalIndex(), t0.collisionId(),
201204
fitter.getTrack(0).getX(), fitter.getTrack(1).getX(), 0,
202205
pos[0], pos[1], pos[2],
203206
pvec0[0], pvec0[1], pvec0[2],
204207
pvec1[0], pvec1[1], pvec1[2],
205208
fitter.getChi2AtPCACandidate(),
206209
t0id.dcaXY(), t1id.dcaXY());
210+
v0datalink(v0data.lastIndex());
207211
}
208212
}
209213
registry.fill(HIST("hCandPerEvent"), lNCand);

0 commit comments

Comments
 (0)