Skip to content

Commit 5a1aa28

Browse files
authored
[PWGEM] SingleTrackQC update to THnSparse Data and MC (#11640)
1 parent 35e5481 commit 5a1aa28

File tree

2 files changed

+31
-40
lines changed

2 files changed

+31
-40
lines changed

PWGEM/Dilepton/Core/SingleTrackQC.h

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,9 @@ struct SingleTrackQC {
8181
// Configurable<int> cfgNtracksPV08Min{"cfgNtracksPV08Min", -1, "min. multNTracksPV"};
8282
// Configurable<int> cfgNtracksPV08Max{"cfgNtracksPV08Max", static_cast<int>(1e+9), "max. multNTracksPV"};
8383
Configurable<bool> cfgApplyWeightTTCA{"cfgApplyWeightTTCA", false, "flag to apply weighting by 1/N"};
84-
Configurable<uint> cfgDCAType{"cfgDCAType", 0, "type of DCA for output. 0:3D, 1:XY, 2:Z, else:3D"};
8584

8685
ConfigurableAxis ConfPtlBins{"ConfPtlBins", {VARIABLE_WIDTH, 0.00, 0.05, 0.10, 0.15, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00, 1.10, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.50, 3.00, 3.50, 4.00, 4.50, 5.00, 6.00, 7.00, 8.00, 9.00, 10.00}, "pTl bins for output histograms"};
87-
ConfigurableAxis ConfDCABins{"ConfDCABins", {VARIABLE_WIDTH, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0}, "DCA bins for output histograms"};
86+
ConfigurableAxis ConfDCABins{"ConfDCABins", {VARIABLE_WIDTH, -10.0, -9.0, -8.0, -7.0, -6.0, -5.0, -4.5, -4.0, -3.5, -3.0, -2.5, -2.0, -1.9, -1.8, -1.7, -1.6, -1.5, -1.4, -1.3, -1.2, -1.1, -1.0, -0.9, -0.8, -0.7, -0.6, -0.5, -0.4, -0.3, -0.2, -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0}, "DCA bins for output histograms"};
8887

8988
EMEventCut fEMEventCut;
9089
struct : ConfigurableGroup {
@@ -228,16 +227,15 @@ struct SingleTrackQC {
228227
const AxisSpec axis_pt{ConfPtlBins, "p_{T,e} (GeV/c)"};
229228
const AxisSpec axis_eta{20, -1.0, +1.0, "#eta_{e}"};
230229
const AxisSpec axis_phi{36, 0.0, 2 * M_PI, "#varphi_{e} (rad.)"};
231-
std::string dca_axis_title = "DCA_{e}^{3D} (#sigma)";
232-
if (cfgDCAType == 1) {
233-
dca_axis_title = "DCA_{e}^{XY} (#sigma)";
234-
} else if (cfgDCAType == 2) {
235-
dca_axis_title = "DCA_{e}^{Z} (#sigma)";
236-
}
237-
const AxisSpec axis_dca{ConfDCABins, dca_axis_title};
230+
std::string dca3D_axis_title = "DCA_{e}^{3D} (#sigma)";
231+
std::string dcaXY_axis_title = "DCA_{e}^{XY} (#sigma)";
232+
std::string dcaZ_axis_title = "DCA_{e}^{Z} (#sigma)";
233+
const AxisSpec axis_dca3D{ConfDCABins, dca3D_axis_title};
234+
const AxisSpec axis_dcaXY{ConfDCABins, dcaXY_axis_title};
235+
const AxisSpec axis_dcaZ{ConfDCABins, dcaZ_axis_title};
238236

239237
// track info
240-
fRegistry.add("Track/positive/hs", "rec. single electron", kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca}, true);
238+
fRegistry.add("Track/positive/hs", "rec. single electron", kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca3D, axis_dcaXY, axis_dcaZ}, true);
241239
fRegistry.add("Track/positive/hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", kTH1F, {{2000, -5, 5}}, false);
242240
fRegistry.add("Track/positive/hDCAxyz", "DCA xy vs. z;DCA_{xy} (cm);DCA_{z} (cm)", kTH2F, {{200, -1.0f, 1.0f}, {700, -3.5f, 3.5f}}, false);
243241
fRegistry.add("Track/positive/hDCAxyzSigma", "DCA xy vs. z;DCA_{xy} (#sigma);DCA_{z} (#sigma)", kTH2F, {{400, -20.0f, 20.0f}, {400, -20.0f, 20.0f}}, false);
@@ -473,18 +471,15 @@ struct SingleTrackQC {
473471
weight = map_weight[track.globalIndex()];
474472
}
475473

476-
float dca = dca3DinSigma(track);
477-
if (cfgDCAType == 1) {
478-
dca = dcaXYinSigma(track);
479-
} else if (cfgDCAType == 2) {
480-
dca = dcaZinSigma(track);
481-
}
474+
float dca3D = dca3DinSigma(track);
475+
float dcaXY = dcaXYinSigma(track);
476+
float dcaZ = dcaZinSigma(track);
482477

483478
if (track.sign() > 0) {
484-
fRegistry.fill(HIST("Track/positive/hs"), track.pt(), track.eta(), track.phi(), dca, weight);
479+
fRegistry.fill(HIST("Track/positive/hs"), track.pt(), track.eta(), track.phi(), dca3D, dcaXY, dcaZ, weight);
485480
fRegistry.fill(HIST("Track/positive/hQoverPt"), track.sign() / track.pt());
486481
fRegistry.fill(HIST("Track/positive/hDCAxyz"), track.dcaXY(), track.dcaZ());
487-
fRegistry.fill(HIST("Track/positive/hDCAxyzSigma"), track.dcaXY() / std::sqrt(track.cYY()), track.dcaZ() / std::sqrt(track.cZZ()));
482+
fRegistry.fill(HIST("Track/positive/hDCAxyzSigma"), dcaXY, dcaZ);
488483
fRegistry.fill(HIST("Track/positive/hDCAxyRes_Pt"), track.pt(), std::sqrt(track.cYY()) * 1e+4); // convert cm to um
489484
fRegistry.fill(HIST("Track/positive/hDCAzRes_Pt"), track.pt(), std::sqrt(track.cZZ()) * 1e+4); // convert cm to um
490485
fRegistry.fill(HIST("Track/positive/hDCA3dRes_Pt"), track.pt(), sigmaDca3D(track) * 1e+4); // convert cm to um
@@ -521,10 +516,10 @@ struct SingleTrackQC {
521516
fRegistry.fill(HIST("Track/positive/hITSNsigmaKa"), track.p(), track.itsNSigmaKa());
522517
fRegistry.fill(HIST("Track/positive/hITSNsigmaPr"), track.p(), track.itsNSigmaPr());
523518
} else {
524-
fRegistry.fill(HIST("Track/negative/hs"), track.pt(), track.eta(), track.phi(), dca, weight);
519+
fRegistry.fill(HIST("Track/negative/hs"), track.pt(), track.eta(), track.phi(), dca3D, dcaXY, dcaZ, weight);
525520
fRegistry.fill(HIST("Track/negative/hQoverPt"), track.sign() / track.pt());
526521
fRegistry.fill(HIST("Track/negative/hDCAxyz"), track.dcaXY(), track.dcaZ());
527-
fRegistry.fill(HIST("Track/negative/hDCAxyzSigma"), track.dcaXY() / std::sqrt(track.cYY()), track.dcaZ() / std::sqrt(track.cZZ()));
522+
fRegistry.fill(HIST("Track/negative/hDCAxyzSigma"), dcaXY, dcaZ);
528523
fRegistry.fill(HIST("Track/negative/hDCAxyRes_Pt"), track.pt(), std::sqrt(track.cYY()) * 1e+4); // convert cm to um
529524
fRegistry.fill(HIST("Track/negative/hDCAzRes_Pt"), track.pt(), std::sqrt(track.cZZ()) * 1e+4); // convert cm to um
530525
fRegistry.fill(HIST("Track/negative/hDCA3dRes_Pt"), track.pt(), sigmaDca3D(track) * 1e+4); // convert cm to um

PWGEM/Dilepton/Core/SingleTrackQCMC.h

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,10 @@ struct SingleTrackQCMC {
8888
// Configurable<int> cfgNtracksPV08Max{"cfgNtracksPV08Max", static_cast<int>(1e+9), "max. multNTracksPV"};
8989
Configurable<bool> cfgFillQA{"cfgFillQA", false, "flag to fill QA histograms"};
9090
Configurable<bool> cfgApplyWeightTTCA{"cfgApplyWeightTTCA", false, "flag to apply weighting by 1/N"};
91-
Configurable<uint> cfgDCAType{"cfgDCAType", 0, "type of DCA for output. 0:3D, 1:XY, 2:Z, else:3D"};
9291
Configurable<bool> cfgRequireTrueAssociation{"cfgRequireTrueAssociation", false, "flag to require true mc collision association"};
9392

9493
ConfigurableAxis ConfPtlBins{"ConfPtlBins", {VARIABLE_WIDTH, 0.00, 0.05, 0.10, 0.15, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00, 1.10, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.50, 3.00, 3.50, 4.00, 4.50, 5.00, 6.00, 7.00, 8.00, 9.00, 10.00}, "pTl bins for output histograms"};
95-
ConfigurableAxis ConfDCABins{"ConfDCABins", {VARIABLE_WIDTH, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0}, "DCA bins for output histograms"};
94+
ConfigurableAxis ConfDCABins{"ConfDCABins", {VARIABLE_WIDTH, -10.0, -9.0, -8.0, -7.0, -6.0, -5.0, -4.5, -4.0, -3.5, -3.0, -2.5, -2.0, -1.9, -1.8, -1.7, -1.6, -1.5, -1.4, -1.3, -1.2, -1.1, -1.0, -0.9, -0.8, -0.7, -0.6, -0.5, -0.4, -0.3, -0.2, -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0}, "DCA bins for output histograms"};
9695

9796
EMEventCut fEMEventCut;
9897
struct : ConfigurableGroup {
@@ -247,13 +246,13 @@ struct SingleTrackQCMC {
247246
const AxisSpec axis_eta{20, -1.0, +1.0, "#eta_{e}"};
248247
const AxisSpec axis_phi{36, 0.0, 2 * M_PI, "#varphi_{e} (rad.)"};
249248
const AxisSpec axis_charge_gen{3, -1.5, +1.5, "true charge"};
250-
std::string dca_axis_title = "DCA_{e}^{3D} (#sigma)";
251-
if (cfgDCAType == 1) {
252-
dca_axis_title = "DCA_{e}^{XY} (#sigma)";
253-
} else if (cfgDCAType == 2) {
254-
dca_axis_title = "DCA_{e}^{Z} (#sigma)";
255-
}
256-
const AxisSpec axis_dca{ConfDCABins, dca_axis_title};
249+
std::string dca3D_axis_title = "DCA_{e}^{3D} (#sigma)";
250+
std::string dcaXY_axis_title = "DCA_{e}^{XY} (#sigma)";
251+
std::string dcaZ_axis_title = "DCA_{e}^{Z} (#sigma)";
252+
253+
const AxisSpec axis_dca3D{ConfDCABins, dca3D_axis_title};
254+
const AxisSpec axis_dcaXY{ConfDCABins, dcaXY_axis_title};
255+
const AxisSpec axis_dcaZ{ConfDCABins, dcaZ_axis_title};
257256

258257
// generated info
259258
fRegistry.add("Generated/lf/hs", "gen. single electron", kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_charge_gen}, true);
@@ -267,7 +266,7 @@ struct SingleTrackQCMC {
267266
fRegistry.addClone("Generated/lf/", "Generated/b2c2l/");
268267

269268
// track info
270-
fRegistry.add("Track/lf/positive/hs", "rec. single electron", kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca, axis_charge_gen}, true);
269+
fRegistry.add("Track/lf/positive/hs", "rec. single electron", kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca3D, axis_dcaXY, axis_dcaZ, axis_charge_gen}, true);
271270
if (cfgFillQA) {
272271
fRegistry.add("Track/lf/positive/hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", kTH1F, {{400, -20, 20}}, false);
273272
fRegistry.add("Track/lf/positive/hDCAxyz", "DCA xy vs. z;DCA_{xy} (cm);DCA_{z} (cm)", kTH2F, {{200, -1.0f, 1.0f}, {700, -3.5f, 3.5f}}, false);
@@ -570,12 +569,9 @@ struct SingleTrackQCMC {
570569
void fillElectronInfo(TTrack const& track)
571570
{
572571
auto mctrack = track.template emmcparticle_as<TMCParticles>();
573-
float dca = dca3DinSigma(track);
574-
if (cfgDCAType == 1) {
575-
dca = dcaXYinSigma(track);
576-
} else if (cfgDCAType == 2) {
577-
dca = dcaZinSigma(track);
578-
}
572+
float dca3D = dca3DinSigma(track);
573+
float dcaXY = dcaXYinSigma(track);
574+
float dcaZ = dcaZinSigma(track);
579575

580576
float weight = 1.f;
581577
if (cfgApplyWeightTTCA) {
@@ -584,11 +580,11 @@ struct SingleTrackQCMC {
584580
// LOGF(info, "map_weight[%d] = %f", track.globalIndex(), weight);
585581

586582
if (track.sign() > 0) {
587-
fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hs"), track.pt(), track.eta(), track.phi(), dca, -mctrack.pdgCode() / pdg_lepton, weight);
583+
fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hs"), track.pt(), track.eta(), track.phi(), dca3D, dcaXY, dcaZ, -mctrack.pdgCode() / pdg_lepton, weight);
588584
if (cfgFillQA) {
589585
fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hQoverPt"), track.sign() / track.pt());
590586
fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hDCAxyz"), track.dcaXY(), track.dcaZ());
591-
fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hDCAxyzSigma"), track.dcaXY() / std::sqrt(track.cYY()), track.dcaZ() / std::sqrt(track.cZZ()));
587+
fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hDCAxyzSigma"), dcaXY, dcaZ);
592588
fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hDCAxyRes_Pt"), track.pt(), std::sqrt(track.cYY()) * 1e+4); // convert cm to um
593589
fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hDCAzRes_Pt"), track.pt(), std::sqrt(track.cZZ()) * 1e+4); // convert cm to um
594590
fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hDCA3dRes_Pt"), track.pt(), sigmaDca3D(track) * 1e+4); // convert cm to um
@@ -629,11 +625,11 @@ struct SingleTrackQCMC {
629625
fRegistry.fill(HIST("Track/PID/positive/hITSNsigmaPr"), track.p(), track.itsNSigmaPr());
630626
}
631627
} else {
632-
fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hs"), track.pt(), track.eta(), track.phi(), dca, -mctrack.pdgCode() / pdg_lepton, weight);
628+
fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hs"), track.pt(), track.eta(), track.phi(), dca3D, dcaXY, dcaZ, -mctrack.pdgCode() / pdg_lepton, weight);
633629
if (cfgFillQA) {
634630
fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hQoverPt"), track.sign() / track.pt());
635631
fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hDCAxyz"), track.dcaXY(), track.dcaZ());
636-
fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hDCAxyzSigma"), track.dcaXY() / std::sqrt(track.cYY()), track.dcaZ() / std::sqrt(track.cZZ()));
632+
fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hDCAxyzSigma"), dcaXY, dcaZ);
637633
fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hDCAxyRes_Pt"), track.pt(), std::sqrt(track.cYY()) * 1e+4); // convert cm to um
638634
fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hDCAzRes_Pt"), track.pt(), std::sqrt(track.cZZ()) * 1e+4); // convert cm to um
639635
fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hDCA3dRes_Pt"), track.pt(), sigmaDca3D(track) * 1e+4); // convert cm to um

0 commit comments

Comments
 (0)