Skip to content

Commit 3fa8d3e

Browse files
author
Valerio Di Bella
committed
add tiny table + histograms
1 parent 5b3e9be commit 3fa8d3e

File tree

3 files changed

+64
-26
lines changed

3 files changed

+64
-26
lines changed

PWGHF/HFC/DataModel/ReducedDMesonPairsTables.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,17 @@ DECLARE_SOA_TABLE(HfCandDpMls, "AOD", "HFCANDDPML",
9696
full::MlScore0,
9797
full::MlScore1)
9898

99+
DECLARE_SOA_TABLE(HfCandDpTinys, "AOD", "HFCANDDPTINY",
100+
full::CandidateSelFlag,
101+
full::M,
102+
full::Pt,
103+
full::Eta,
104+
full::Phi,
105+
full::HfCandDpFullEvId,
106+
hf_cand_3prong::FlagMcMatchRec,
107+
hf_cand_3prong::OriginMcRec,
108+
hf_cand_3prong::FlagMcDecayChanRec)
109+
99110
DECLARE_SOA_TABLE(HfCandDpLites, "AOD", "HFCANDDPLITE",
100111
hf_cand::Chi2PCA,
101112
full::DecayLength,
@@ -139,7 +150,6 @@ DECLARE_SOA_TABLE(HfCandDpLites, "AOD", "HFCANDDPLITE",
139150
full::Phi,
140151
full::Y,
141152
full::Centrality,
142-
collision::NumContrib,
143153
full::HfCandDpFullEvId,
144154
hf_cand_3prong::FlagMcMatchRec,
145155
hf_cand_3prong::OriginMcRec,

PWGHF/HFC/TableProducer/correlatorDplusDplusReduced.cxx

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ using namespace o2::hf_centrality;
5252
struct HfCorrelatorDplusDplusReduced {
5353
Produces<o2::aod::HfCandDpFulls> rowCandidateFull;
5454
Produces<o2::aod::HfCandDpLites> rowCandidateLite;
55+
Produces<o2::aod::HfCandDpTinys> rowCandidateTiny;
5556
Produces<o2::aod::HfCandDpFullEvs> rowCandidateFullEvents;
5657
Produces<o2::aod::HfCandDpMls> rowCandidateMl;
5758

@@ -60,6 +61,7 @@ struct HfCorrelatorDplusDplusReduced {
6061

6162
Configurable<int> selectionFlagDplus{"selectionFlagDplus", 1, "Selection Flag for Dplus"};
6263
Configurable<bool> fillCandidateLiteTable{"fillCandidateLiteTable", false, "Switch to fill lite table with candidate properties"};
64+
Configurable<bool> fillCandidateTinyTable{"fillCandidateTinyTable", false, "Switch to fill tiny table with candidate properties"};
6365
// parameters for production of training samples
6466
Configurable<bool> fillCorrBkgs{"fillCorrBkgs", false, "Flag to fill derived tables with correlated background candidates"};
6567
Configurable<std::vector<int>> classMlIndexes{"classMlIndexes", {0, 2}, "Indexes of ML bkg and non-prompt scores."};
@@ -113,11 +115,12 @@ struct HfCorrelatorDplusDplusReduced {
113115
}
114116

115117
template <typename Coll, bool doMc = false, bool doMl = false, typename T>
116-
void fillCandidateTable(const T& candidate, int localEvIdx = -1)
118+
void fillCandidateTable(const T& candidate, int localEvIdx = -1, int sign = 1)
117119
{
118120
int8_t flagMc = 0;
119121
int8_t originMc = 0;
120122
int8_t channelMc = 0;
123+
121124
if constexpr (doMc) {
122125
flagMc = candidate.flagMcMatchRec();
123126
originMc = candidate.originMcRec();
@@ -140,7 +143,18 @@ struct HfCorrelatorDplusDplusReduced {
140143
cent = getCentralityColl(coll, centEstimator);
141144
}
142145

143-
if (fillCandidateLiteTable) {
146+
if (fillCandidateTinyTable) {
147+
rowCandidateTiny(
148+
candidate.isSelDplusToPiKPi(),
149+
hfHelper.invMassDplusToPiKPi(candidate),
150+
sign * candidate.pt(),
151+
candidate.eta(),
152+
candidate.phi(),
153+
localEvIdx,
154+
flagMc,
155+
originMc,
156+
channelMc);
157+
} else if (fillCandidateLiteTable) {
144158
rowCandidateLite(
145159
candidate.chi2PCA(),
146160
candidate.decayLength(),
@@ -176,15 +190,14 @@ struct HfCorrelatorDplusDplusReduced {
176190
candidate.tpcTofNSigmaKa2(),
177191
candidate.isSelDplusToPiKPi(),
178192
hfHelper.invMassDplusToPiKPi(candidate),
179-
candidate.pt(),
193+
sign * candidate.pt(),
180194
candidate.cpa(),
181195
candidate.cpaXY(),
182196
candidate.maxNormalisedDeltaIP(),
183197
candidate.eta(),
184198
candidate.phi(),
185199
hfHelper.yDplus(candidate),
186200
cent,
187-
coll.numContrib(),
188201
localEvIdx,
189202
flagMc,
190203
originMc,
@@ -252,7 +265,7 @@ struct HfCorrelatorDplusDplusReduced {
252265
candidate.tpcTofNSigmaKa2(),
253266
candidate.isSelDplusToPiKPi(),
254267
hfHelper.invMassDplusToPiKPi(candidate),
255-
candidate.pt(),
268+
sign * candidate.pt(),
256269
candidate.p(),
257270
candidate.cpa(),
258271
candidate.cpaXY(),
@@ -270,7 +283,7 @@ struct HfCorrelatorDplusDplusReduced {
270283
}
271284
}
272285

273-
void processData(aod::Collisions const& collisions, SelectedCandidates const& candidates)
286+
void processData(aod::Collisions const& collisions, SelectedCandidates const& candidates, aod::Tracks const&)
274287
{
275288
static int lastRunNumber = -1;
276289
// reserve memory
@@ -297,14 +310,14 @@ struct HfCorrelatorDplusDplusReduced {
297310

298311
const auto colId = collision.globalIndex();
299312
auto candidatesInThisCollision = candidates.sliceBy(tracksPerCollision, colId);
300-
if (skipSingleD) {
301-
if (candidatesInThisCollision.size() < 2) { // o2-linter: disable=magic-number (number of candidate must be larger than 1)
313+
if (skipSingleD)
314+
if (candidatesInThisCollision.size() < 2) // o2-linter: disable=magic-number (number of candidate must be larger than 1)
302315
continue;
303-
}
304-
}
305316
fillEvent(collision);
306317
for (const auto& candidate : candidatesInThisCollision) {
307-
fillCandidateTable<aod::Collisions>(candidate, rowCandidateFullEvents.lastIndex());
318+
auto prong_candidate = candidate.prong1_as<aod::Tracks>();
319+
auto candidate_sign = prong_candidate.sign();
320+
fillCandidateTable<aod::Collisions>(candidate, rowCandidateFullEvents.lastIndex(), candidate_sign);
308321
}
309322
}
310323
}
@@ -324,14 +337,14 @@ struct HfCorrelatorDplusDplusReduced {
324337
for (const auto& collision : collisions) { // No skimming for MC data. No Zorro !
325338
const auto colId = collision.globalIndex();
326339
auto candidatesInThisCollision = candidates.sliceBy(tracksPerCollision, colId);
327-
if (skipSingleD) {
328-
if (candidatesInThisCollision.size() < 2) { // o2-linter: disable=magic-number (number of candidate must be larger than 1)
340+
if (skipSingleD)
341+
if (candidatesInThisCollision.size() < 2) // o2-linter: disable=magic-number (number of candidate must be larger than 1)
329342
continue;
330-
}
331-
}
332343
fillEvent(collision);
333344
for (const auto& candidate : candidatesInThisCollision) {
334-
fillCandidateTable<aod::Collisions, true>(candidate, rowCandidateFullEvents.lastIndex());
345+
auto prong_candidate = candidate.prong1_as<aod::Tracks>();
346+
auto candidate_sign = prong_candidate.sign();
347+
fillCandidateTable<aod::Collisions, true>(candidate, rowCandidateFullEvents.lastIndex(), candidate_sign);
335348
}
336349
}
337350
}
@@ -346,11 +359,9 @@ struct HfCorrelatorDplusDplusReduced {
346359
for (const auto& mccollision : mccollisions) { // No skimming for MC data. No Zorro !
347360
const auto colId = mccollision.globalIndex();
348361
const auto particlesInThisCollision = mcparticles.sliceBy(mcParticlesPerMcCollision, colId);
349-
if (skipSingleD) {
350-
if (particlesInThisCollision.size() < 2) { // o2-linter: disable=magic-number (number of candidate must be larger than 1)
362+
if (skipSingleD)
363+
if (particlesInThisCollision.size() < 2) // o2-linter: disable=magic-number (number of candidate must be larger than 1)
351364
continue;
352-
}
353-
}
354365
rowCandidateMcCollisions(
355366
mccollision.posX(),
356367
mccollision.posY(),

PWGHF/HFC/Tasks/taskCorrelationDplusDplusReduced.cxx

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ using namespace o2::framework::expressions;
3838
struct HfTaskCorrelationDplusDplusReduced {
3939
Configurable<int> selectionFlagDplus{"selectionFlagDplus", 1, "Selection Flag for Dplus"};
4040

41-
using SelectedCandidates = soa::Filtered<o2::aod::HfCandDpFulls>;
41+
using SelectedCandidates = soa::Filtered<o2::aod::HfCandDpTinys>;
4242
using SelectedMcParticles = o2::aod::HfCandDpMcPs;
4343

4444
Filter filterSelectCandidates = aod::full::candidateSelFlag >= selectionFlagDplus;
@@ -56,7 +56,9 @@ struct HfTaskCorrelationDplusDplusReduced {
5656
{
5757
registry.add("hMassDplus", "D+ candidates;inv. mass (#pi#pi K) (GeV/#it{c}^{2}))", {HistType::kTH1F, {{120, 1.5848, 2.1848}}});
5858
registry.add("hMassDplusMatched", "D+ matched candidates;inv. mass (#pi#pi K) (GeV/#it{c}^{2}))", {HistType::kTH1F, {{120, 1.5848, 2.1848}}});
59-
registry.add("hMassDMesonPair", "D Meson pair candidates;inv. mass (#pi K) (GeV/#it{c}^{2});inv. mass (#pi K) (GeV/#it{c}^{2})", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {120, 1.5848, 2.1848}}});
59+
registry.add("hMassDplusminusPair", "D plus-minus pair candidates;inv. mass (#pi K) (GeV/#it{c}^{2});inv. mass (#pi K) (GeV/#it{c}^{2})", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {120, 1.5848, 2.1848}}});
60+
registry.add("hMassDplusPair", "D plus pair candidates;inv. mass (#pi K) (GeV/#it{c}^{2});inv. mass (#pi K) (GeV/#it{c}^{2})", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {120, 1.5848, 2.1848}}});
61+
registry.add("hMassDminusPair", "D minus pair candidates;inv. mass (#pi K) (GeV/#it{c}^{2});inv. mass (#pi K) (GeV/#it{c}^{2})", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {120, 1.5848, 2.1848}}});
6062
registry.add("hDltPhiMcGen", "Azimuthal correlation for D mesons; #Delta#phi", {HistType::kTH1F, {{100, -3.141593, 3.141593}}});
6163
}
6264

@@ -67,9 +69,25 @@ struct HfTaskCorrelationDplusDplusReduced {
6769

6870
for (const auto& cand1 : localCandidates) {
6971
auto mass1 = cand1.m();
72+
auto sign1 = 1;
73+
if (cand1.pt() < 0) {
74+
sign1 = -1;
75+
}
7076
for (auto cand2 = cand1 + 1; cand2 != localCandidates.end(); ++cand2) {
7177
auto mass2 = cand2.m();
72-
registry.fill(HIST("hMassDMesonPair"), mass2, mass1);
78+
auto sign2 = 1;
79+
if (cand2.pt() < 0) {
80+
sign2 = -1;
81+
}
82+
if (sign1 == sign2) {
83+
if (sign1 == 1) {
84+
registry.fill(HIST("hMassDplusPair"), mass2, mass1);
85+
} else {
86+
registry.fill(HIST("hMassDminusPair"), mass2, mass1);
87+
}
88+
} else {
89+
registry.fill(HIST("hMassDplusminusPair"), mass2, mass1);
90+
}
7391
}
7492
}
7593
}
@@ -83,9 +101,8 @@ struct HfTaskCorrelationDplusDplusReduced {
83101
for (const auto& cand1 : localCandidates) {
84102
auto mass1 = cand1.m();
85103
registry.fill(HIST("hMassDplus"), mass1);
86-
if (std::abs(cand1.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) {
104+
if (std::abs(cand1.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi)
87105
registry.fill(HIST("hMassDplusMatched"), mass1);
88-
}
89106
}
90107
}
91108
PROCESS_SWITCH(HfTaskCorrelationDplusDplusReduced, processLocalDataMcRec, "Process local MC data", false);

0 commit comments

Comments
 (0)