Skip to content

Commit d217352

Browse files
authored
[PWGJE] Add MC efficiency information to Ds jet task (#18009)
1 parent 0d3e70a commit d217352

1 file changed

Lines changed: 47 additions & 20 deletions

File tree

‎PWGJE/Tasks/jetDsSpecSubs.cxx‎

Lines changed: 47 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,11 @@ consteval float getValFromBin(int bin)
5252
enum BinExpColCntr { AllCollisions = 1,
5353
Sel8ZCut = 2 };
5454

55-
enum BinMCColCntr { AllMCCollisions = 1,
56-
SelectedMCCollisions = 2,
57-
AssociatedRecoCollisions = 3,
58-
SelectedAssociatedRecoCollisions = 4
55+
enum BinMCColCntr {
56+
AllMCCollisions = 1,
57+
EventSelection = 2,
58+
VertexZCut = 3,
59+
HasMCPDsJet = 4
5960
};
6061

6162
enum BinMCJetCntr {
@@ -318,13 +319,20 @@ struct JetDsSpecSubs {
318319
// Detector-level sparse histograms
319320
registry.add(
320321
"hSparse_ds_mcd1",
321-
";m_{D_{S}}^{rec};#it{p}_{T,D_{S}}^{det};#it{p}_{T,jet}^{det};z^{D_{S},jet}_{||,det};Origin(D_{S});Matching status",
322+
";m_{D_{S}}^{rec};"
323+
"#it{p}_{T,D_{S}}^{det};"
324+
"#it{p}_{T,jet}^{det};"
325+
"z^{D_{S},jet}_{||,det};"
326+
"Origin(D_{S});"
327+
"flagMcMatchRec;"
328+
"Jet matching status",
322329
{HistType::kTHnSparseF,
323330
{{350, 1.6, 2.3},
324331
{100, 0., 50.},
325332
{100, 0., 100.},
326333
{200, 0., 1.},
327334
{3, -0.5, 2.5},
335+
{21, -10.5, 10.5},
328336
{2, -0.5, 1.5}}});
329337

330338
registry.add(
@@ -356,13 +364,20 @@ struct JetDsSpecSubs {
356364
// Particle-level sparse with origin and matching status
357365
registry.add(
358366
"hSparse_ds_mcp",
359-
";#it{p}_{T,D_{S}}^{part};#it{p}_{T,jet}^{part};z^{D_{S},jet}_{||,part};#DeltaR_{D_{S},jet}^{part};Origin(D_{S});Matching status",
367+
";#it{p}_{T,D_{S}}^{part};"
368+
"#it{p}_{T,jet}^{part};"
369+
"z^{D_{S},jet}_{||,part};"
370+
"#DeltaR_{D_{S},jet}^{part};"
371+
"Origin(D_{S});"
372+
"flagMcMatchGen;"
373+
"Jet matching status",
360374
{HistType::kTHnSparseF,
361375
{{100, 0., 50.},
362376
{100, 0., 100.},
363377
{200, 0., 1.},
364378
{200, 0., 1.},
365379
{3, -0.5, 2.5},
380+
{21, -10.5, 10.5},
366381
{2, -0.5, 1.5}}});
367382

368383
// Matched detector-level Ds-tagged jets
@@ -418,10 +433,10 @@ struct JetDsSpecSubs {
418433

419434
// Counter labels
420435
auto mcCollisionCounter = registry.get<TH1>(HIST("hMCColCounter"));
421-
mcCollisionCounter->GetXaxis()->SetBinLabel(BinMCColCntr::AllMCCollisions, "All MC coll.");
422-
mcCollisionCounter->GetXaxis()->SetBinLabel(BinMCColCntr::SelectedMCCollisions, "Selected MC coll.");
423-
mcCollisionCounter->GetXaxis()->SetBinLabel(BinMCColCntr::AssociatedRecoCollisions, "MC-associated reco coll.");
424-
mcCollisionCounter->GetXaxis()->SetBinLabel(BinMCColCntr::SelectedAssociatedRecoCollisions, "Selected MC-associated reco coll.");
436+
mcCollisionCounter->GetXaxis()->SetBinLabel(BinMCColCntr::AllMCCollisions, "All MC collisions");
437+
mcCollisionCounter->GetXaxis()->SetBinLabel(BinMCColCntr::EventSelection, "Event selection");
438+
mcCollisionCounter->GetXaxis()->SetBinLabel(BinMCColCntr::VertexZCut, "|z_{vtx}| < cut");
439+
mcCollisionCounter->GetXaxis()->SetBinLabel(BinMCColCntr::HasMCPDsJet, "Has MCP D_{s}-jet");
425440

426441
auto jetCounter = registry.get<TH1>(HIST("hMCJetCounter"));
427442
jetCounter->GetXaxis()->SetBinLabel(BinMCJetCntr::MCPJets, "MCP Ds-jets");
@@ -432,12 +447,12 @@ struct JetDsSpecSubs {
432447

433448
// Matching-status labels
434449
auto hSparseMCD = registry.get<THnSparse>(HIST("hSparse_ds_mcd1"));
435-
hSparseMCD->GetAxis(5)->SetBinLabel(1, "Unmatched");
436-
hSparseMCD->GetAxis(5)->SetBinLabel(2, "Matched");
450+
hSparseMCD->GetAxis(6)->SetBinLabel(1, "Unmatched");
451+
hSparseMCD->GetAxis(6)->SetBinLabel(2, "Matched");
437452

438453
auto hSparseMCP = registry.get<THnSparse>(HIST("hSparse_ds_mcp"));
439-
hSparseMCP->GetAxis(5)->SetBinLabel(1, "Unmatched");
440-
hSparseMCP->GetAxis(5)->SetBinLabel(2, "Matched");
454+
hSparseMCP->GetAxis(6)->SetBinLabel(1, "Unmatched");
455+
hSparseMCP->GetAxis(6)->SetBinLabel(2, "Matched");
441456
}
442457

443458
void addMCPOnTheFlyHistograms()
@@ -755,17 +770,27 @@ struct JetDsSpecSubs {
755770
// All MC collisions
756771
registry.fill(HIST("hMCColCounter"), getValFromBin(BinMCColCntr::AllMCCollisions));
757772

758-
// MC collision selection
759-
if (!jetderiveddatautilities::selectCollision(mccollision, eventSelectionBits) ||
760-
!(std::abs(mccollision.posZ()) < vertexZCut)) {
773+
// Event selection
774+
if (!jetderiveddatautilities::selectCollision(mccollision, eventSelectionBits)) {
761775
continue;
762776
}
763-
// Selected MC collisions
764-
registry.fill(HIST("hMCColCounter"), getValFromBin(BinMCColCntr::SelectedMCCollisions));
777+
778+
registry.fill(HIST("hMCColCounter"), getValFromBin(BinMCColCntr::EventSelection));
779+
780+
// Vertex-z selection
781+
if (std::abs(mccollision.posZ()) >= vertexZCut) {
782+
continue;
783+
}
784+
785+
registry.fill(HIST("hMCColCounter"), getValFromBin(BinMCColCntr::VertexZCut));
765786

766787
// Particle-level jets belonging to the current MC collision
767788
const auto mcpJetsPerMCCollision = mcpjets.sliceBy(MCPJetsPerMCCollisionPreslice, mccollision.globalIndex());
768789

790+
if (mcpJetsPerMCCollision.size() > 0) {
791+
registry.fill(HIST("hMCColCounter"), getValFromBin(BinMCColCntr::HasMCPDsJet));
792+
}
793+
769794
// Particle-level Ds-tagged jets
770795
for (const auto& mcpjet : mcpJetsPerMCCollision) {
771796

@@ -806,6 +831,7 @@ struct JetDsSpecSubs {
806831
zParallelMCP,
807832
deltaRMCP,
808833
originMCP,
834+
flagMcMatchGen,
809835
static_cast<float>(isMatchedMCP));
810836

811837
// Store all particle-level Ds-tagged jets
@@ -984,14 +1010,15 @@ struct JetDsSpecSubs {
9841010
registry.fill(HIST("h_ds_phi_mcd"), mcdcand.phi());
9851011
registry.fill(HIST("h_ds_mass_mcd"), mcdcand.m());
9861012

987-
// Detector-level sparse: mass, pT Ds, pT jet, z_parallel, origin, matching status
1013+
// Detector-level sparse: mass, pT Ds, pT jet, z_parallel, origin, flagMcMatchRec, matching status
9881014
registry.fill(
9891015
HIST("hSparse_ds_mcd1"),
9901016
mcdcand.m(),
9911017
mcdcand.pt(),
9921018
mcdjet.pt(),
9931019
zParallelMCD,
9941020
originMCD,
1021+
flagMcMatchRec,
9951022
static_cast<float>(isMatchedMCD));
9961023

9971024
// Detector-level sparse: pT Ds, pT jet, DeltaR

0 commit comments

Comments
 (0)