Skip to content

Commit b33574e

Browse files
[PWGLF] NucleiTask - Fix cut in vertex & add purity histos (#14214)
1 parent a0814e7 commit b33574e

File tree

1 file changed

+54
-34
lines changed

1 file changed

+54
-34
lines changed

PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx

Lines changed: 54 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ struct LFNucleiBATask {
9797
Configurable<bool> useTVXtrigger{"useTVXtrigger", false, "Use TVX for Event Selection (default w/ Sel8)"};
9898
Configurable<bool> removeTFBorder{"removeTFBorder", false, "Remove TimeFrame border (default w/ Sel8)"};
9999
Configurable<bool> removeITSROFBorder{"removeITSROFBorder", false, "Remove ITS Read-Out Frame border (default w/ Sel8)"};
100+
Configurable<bool> enableGenVzCut{"enableGenVzCut", true, "Apply cut in z-Vertex in the processGen function"};
100101
} evselOptions;
101102

102103
// Set the multiplity event limits
@@ -1012,7 +1013,9 @@ struct LFNucleiBATask {
10121013
histos.add<TH1>("tracks/helium/TOF/h1HeliumSpectraTruePrim_Z2", "#it{p}_{T} (He)", HistType::kTH1F, {ptHeAxis});
10131014
histos.add<TH1>("tracks/helium/TOF/h1antiHeliumSpectraTruePrim_Z2", "#it{p}_{T} (He)", HistType::kTH1F, {ptHeAxis});
10141015
if (enableCentrality) {
1016+
histos.add<TH2>("tracks/helium/TOF/h2HeliumSpectraTrueWPIDVsMult_Z2", "#it{p}_{T} (He)", HistType::kTH2F, {{ptHeAxis}, {binsPercentile}});
10151017
histos.add<TH2>("tracks/helium/TOF/h2HeliumSpectraTruePrimVsMult_Z2", "#it{p}_{T} (He)", HistType::kTH2F, {{ptHeAxis}, {binsPercentile}});
1018+
histos.add<TH2>("tracks/helium/TOF/h2antiHeliumSpectraTrueWPIDVsMult_Z2", "#it{p}_{T} (He)", HistType::kTH2F, {{ptHeAxis}, {binsPercentile}});
10161019
histos.add<TH2>("tracks/helium/TOF/h2antiHeliumSpectraTruePrimVsMult_Z2", "#it{p}_{T} (He)", HistType::kTH2F, {{ptHeAxis}, {binsPercentile}});
10171020
}
10181021
}
@@ -2168,7 +2171,7 @@ struct LFNucleiBATask {
21682171

21692172
spectraGen.add("helium/histPtGenHe", "PtGenHe", HistType::kTH1F, {{800, 0.f, 8.f}});
21702173
spectraGen.add("helium/histPtRecHe", "PtRecHe", HistType::kTH1F, {{800, 0.f, 8.f}});
2171-
spectraGen.add("helium/histPtShiftHe", "PtReco-PtGen vs PtReco", HistType::kTH2F, {{800, 0.f, 8.f}, {400, -4.f, 4.f}});
2174+
spectraGen.add("helium/histPtShiftHe", "PtReco-PtGen vs PtReco;#it{p}_{T}(reco); #it{p}_{T}(reco) - #it{p}_{T}(gen)", HistType::kTH2F, {{800, 0.f, 8.f}, {400, -4.f, 4.f}});
21722175
spectraGen.add("helium/histPtShiftVsEtaHe", "PtReco-PtGen vs #eta", HistType::kTH2F, {{200, -2.f, 2.f}, {400, -4.f, 4.f}});
21732176

21742177
spectraGen.add("helium/histPGenHe", "PGenHe", HistType::kTH1F, {{800, 0.f, 8.f}});
@@ -2178,7 +2181,7 @@ struct LFNucleiBATask {
21782181

21792182
spectraGen.add("helium/histPtGenantiHe", "PtGenantiHe", HistType::kTH1F, {{800, 0.f, 8.f}});
21802183
spectraGen.add("helium/histPtRecantiHe", "PtRecantiHe", HistType::kTH1F, {{800, 0.f, 8.f}});
2181-
spectraGen.add("helium/histPtShiftantiHe", "PtReco-PtGen vs PtReco", HistType::kTH2F, {{800, 0.f, 8.f}, {400, -4.f, 4.f}});
2184+
spectraGen.add("helium/histPtShiftantiHe", "PtReco-PtGen vs PtReco; #it{p}_{T}(reco); #it{p}_{T}(reco) - #it{p}_{T}(gen)", HistType::kTH2F, {{800, 0.f, 8.f}, {400, -4.f, 4.f}});
21822185
spectraGen.add("helium/histPtShiftVsEtaantiHe", "PtReco-PtGen vs #eta", HistType::kTH2F, {{200, -2.f, 2.f}, {400, -4.f, 4.f}});
21832186

21842187
spectraGen.add("helium/histPGenantiHe", "PGenantiHe", HistType::kTH1F, {{800, 0.f, 8.f}});
@@ -3650,20 +3653,7 @@ struct LFNucleiBATask {
36503653
if (track.hasTOF() && outFlagOptions.doTOFplots) {
36513654
histos.fill(HIST("tracks/helium/dca/before/TOF/hDCAxyVsPtHeliumTrue"), hePt, track.dcaXY());
36523655
}
3653-
}
3654-
if (isPhysPrim) {
3655-
if constexpr (!IsFilteredData) {
3656-
spectraGen.fill(HIST("helium/histPtGenHe"), std::abs(track.mcParticle().pt()));
3657-
spectraGen.fill(HIST("helium/histPtRecHe"), 2.f * hePt);
3658-
spectraGen.fill(HIST("helium/histPtShiftHe"), 2.f * hePt, 2.f * hePt - track.mcParticle().pt());
3659-
spectraGen.fill(HIST("helium/histPtShiftVsEtaHe"), track.eta(), 2.f * hePt - track.mcParticle().pt());
3660-
3661-
spectraGen.fill(HIST("helium/histPGenHe"), std::abs(track.mcParticle().p()));
3662-
spectraGen.fill(HIST("helium/histPRecHe"), 2.f * heP);
3663-
spectraGen.fill(HIST("helium/histPShiftHe"), 2.f * heP, 2.f * heP - track.mcParticle().p());
3664-
spectraGen.fill(HIST("helium/histPShiftVsEtaHe"), track.eta(), 2.f * heP - track.mcParticle().p());
3665-
}
3666-
if (outFlagOptions.makeDCABeforeCutPlots) {
3656+
if (isPhysPrim) {
36673657
histos.fill(HIST("tracks/helium/dca/before/hDCAxyVsPtHeliumTruePrim"), hePt, track.dcaXY());
36683658
if (track.hasTOF() && outFlagOptions.doTOFplots) {
36693659
histos.fill(HIST("tracks/helium/dca/before/TOF/hDCAxyVsPtHeliumTruePrim"), hePt, track.dcaXY());
@@ -3733,6 +3723,21 @@ struct LFNucleiBATask {
37333723
}
37343724
}
37353725
}
3726+
if (isHeWoTPCpid) {
3727+
if (isPhysPrim) {
3728+
if constexpr (!IsFilteredData) {
3729+
spectraGen.fill(HIST("helium/histPtGenHe"), std::abs(track.mcParticle().pt()));
3730+
spectraGen.fill(HIST("helium/histPtRecHe"), 2.f * hePt);
3731+
spectraGen.fill(HIST("helium/histPtShiftHe"), 2.f * hePt, 2.f * hePt - track.mcParticle().pt());
3732+
spectraGen.fill(HIST("helium/histPtShiftVsEtaHe"), track.eta(), 2.f * hePt - track.mcParticle().pt());
3733+
3734+
spectraGen.fill(HIST("helium/histPGenHe"), std::abs(track.mcParticle().p()));
3735+
spectraGen.fill(HIST("helium/histPRecHe"), 2.f * heP);
3736+
spectraGen.fill(HIST("helium/histPShiftHe"), 2.f * heP, 2.f * heP - track.mcParticle().p());
3737+
spectraGen.fill(HIST("helium/histPShiftVsEtaHe"), track.eta(), 2.f * heP - track.mcParticle().p());
3738+
}
3739+
}
3740+
}
37363741
}
37373742
break;
37383743
case -PDGHelium:
@@ -3742,20 +3747,7 @@ struct LFNucleiBATask {
37423747
if (track.hasTOF() && outFlagOptions.doTOFplots) {
37433748
histos.fill(HIST("tracks/helium/dca/before/TOF/hDCAxyVsPtantiHeliumTrue"), antihePt, track.dcaXY());
37443749
}
3745-
}
3746-
if (isPhysPrim) {
3747-
if constexpr (!IsFilteredData) {
3748-
spectraGen.fill(HIST("helium/histPtGenantiHe"), std::abs(track.mcParticle().pt()));
3749-
spectraGen.fill(HIST("helium/histPtRecantiHe"), 2.f * antihePt);
3750-
spectraGen.fill(HIST("helium/histPtShiftantiHe"), 2.f * antihePt, 2.f * antihePt - track.mcParticle().pt());
3751-
spectraGen.fill(HIST("helium/histPtShiftVsEtaantiHe"), track.eta(), 2.f * antihePt - track.mcParticle().pt());
3752-
3753-
spectraGen.fill(HIST("helium/histPGenantiHe"), std::abs(track.mcParticle().p()));
3754-
spectraGen.fill(HIST("helium/histPRecantiHe"), 2.f * antiheP);
3755-
spectraGen.fill(HIST("helium/histPShiftantiHe"), 2.f * antiheP, 2.f * antiheP - track.mcParticle().p());
3756-
spectraGen.fill(HIST("helium/histPShiftVsEtaantiHe"), track.eta(), 2.f * antiheP - track.mcParticle().p());
3757-
}
3758-
if (outFlagOptions.makeDCABeforeCutPlots) {
3750+
if (isPhysPrim) {
37593751
histos.fill(HIST("tracks/helium/dca/before/hDCAxyVsPtantiHeliumTruePrim"), antihePt, track.dcaXY());
37603752
if (track.hasTOF() && outFlagOptions.doTOFplots) {
37613753
histos.fill(HIST("tracks/helium/dca/before/TOF/hDCAxyVsPtantiHeliumTruePrim"), antihePt, track.dcaXY());
@@ -3804,6 +3796,23 @@ struct LFNucleiBATask {
38043796
}
38053797
}
38063798
}
3799+
if (isHeWoTPCpid) {
3800+
if (isPhysPrim) {
3801+
if constexpr (!IsFilteredData) {
3802+
spectraGen.fill(HIST("helium/histPtGenantiHe"), std::abs(track.mcParticle().pt()));
3803+
spectraGen.fill(HIST("helium/histPtRecantiHe"), 2.f * antihePt);
3804+
spectraGen.fill(HIST("helium/histPtShiftantiHe"), 2.f * antihePt, 2.f * antihePt - track.mcParticle().pt());
3805+
spectraGen.fill(HIST("helium/histPtShiftVsEtaantiHe"), track.eta(), 2.f * antihePt - track.mcParticle().pt());
3806+
3807+
spectraGen.fill(HIST("helium/histPGenantiHe"), std::abs(track.mcParticle().p()));
3808+
spectraGen.fill(HIST("helium/histPRecantiHe"), 2.f * antiheP);
3809+
spectraGen.fill(HIST("helium/histPShiftantiHe"), 2.f * antiheP, 2.f * antiheP - track.mcParticle().p());
3810+
spectraGen.fill(HIST("helium/histPShiftVsEtaantiHe"), track.eta(), 2.f * antiheP - track.mcParticle().p());
3811+
}
3812+
if (outFlagOptions.makeDCABeforeCutPlots) {
3813+
}
3814+
}
3815+
}
38073816
}
38083817
break;
38093818
case PDGAlpha:
@@ -4858,6 +4867,7 @@ struct LFNucleiBATask {
48584867
}
48594868

48604869
if (isHeWTPCpid) {
4870+
histos.fill(HIST("tracks/helium/TOF/h1HeliumSpectra_Z2"), 2 * hePt);
48614871
histos.fill(HIST("tracks/helium/h2HeliumTOFbetaVsP"), heP, track.beta());
48624872
if (outFlagOptions.enableEffPlots) {
48634873
histos.fill(HIST("tracks/eff/helium/h2pVsTOFExpMomentumHe"), track.tofExpMom(), heP);
@@ -4866,6 +4876,7 @@ struct LFNucleiBATask {
48664876
}
48674877

48684878
if (isAntiHeWTPCpid) {
4879+
histos.fill(HIST("tracks/helium/TOF/h1antiHeliumSpectra_Z2"), 2 * hePt);
48694880
histos.fill(HIST("tracks/helium/h2antiHeliumTOFbetaVsP"), antiheP, track.beta());
48704881
if (outFlagOptions.enableEffPlots) {
48714882
histos.fill(HIST("tracks/eff/helium/h2pVsTOFExpMomentumantiHe"), track.tofExpMom(), antiheP);
@@ -5807,8 +5818,12 @@ struct LFNucleiBATask {
58075818
}
58085819
if (std::abs(track.tpcNSigmaHe()) < nsigmaTPCvar.nsigmaTPCHe) {
58095820
histos.fill(HIST("tracks/helium/h1HeliumSpectraTrueWPID_Z2"), 2 * hePt);
5810-
if (enableCentrality)
5821+
if (enableCentrality) {
58115822
histos.fill(HIST("tracks/helium/h2HeliumSpectraTrueWPIDVsMult_Z2"), 2 * hePt, centFT0M);
5823+
if (track.hasTOF() && outFlagOptions.doTOFplots) {
5824+
histos.fill(HIST("tracks/helium/TOF/h2HeliumSpectraTrueWPIDVsMult_Z2"), 2 * hePt, centFT0M);
5825+
}
5826+
}
58125827
if (outFlagOptions.enableEffPlots) {
58135828
histos.fill(HIST("tracks/eff/helium/hPtHeTrue_Z2"), 2 * hePt);
58145829
if (track.hasTOF() && outFlagOptions.doTOFplots) {
@@ -5820,7 +5835,6 @@ struct LFNucleiBATask {
58205835
histos.fill(HIST("tracks/helium/h1HeliumSpectraTruePrim_Z2"), 2 * hePt);
58215836
if (enableCentrality)
58225837
histos.fill(HIST("tracks/helium/h2HeliumSpectraTruePrimVsMult_Z2"), 2 * hePt, centFT0M);
5823-
58245838
if (std::abs(track.tpcNSigmaHe()) < nsigmaTPCvar.nsigmaTPCHe) {
58255839
if (track.hasTOF() && outFlagOptions.doTOFplots) {
58265840
histos.fill(HIST("tracks/helium/TOF/h1HeliumSpectraTruePrim_Z2"), 2 * hePt);
@@ -5838,7 +5852,6 @@ struct LFNucleiBATask {
58385852
}
58395853
}
58405854
}
5841-
58425855
if (!isPhysPrim && !isProdByGen) {
58435856
histos.fill(HIST("tracks/helium/h1HeliumSpectraTrueTransport_Z2"), 2 * hePt);
58445857
if (outFlagOptions.makeDCAAfterCutPlots) {
@@ -5870,7 +5883,9 @@ struct LFNucleiBATask {
58705883
histos.fill(HIST("tracks/helium/h1antiHeliumSpectraTrue_Z2"), 2 * antihePt);
58715884
if (enableCentrality)
58725885
histos.fill(HIST("tracks/helium/h2antiHeliumSpectraTrueVsMult_Z2"), 2 * antihePt, centFT0M);
5873-
5886+
if (track.hasTOF() && outFlagOptions.doTOFplots) {
5887+
histos.fill(HIST("tracks/helium/TOF/h2antiHeliumSpectraTrueWPIDVsMult_Z2"), 2 * antihePt, centFT0M);
5888+
}
58745889
if (outFlagOptions.makeDCAAfterCutPlots) {
58755890
histos.fill(HIST("tracks/helium/dca/after/hDCAxyVsPtantiHeliumTrue"), antihePt, track.dcaXY());
58765891
histos.fill(HIST("tracks/helium/dca/after/hDCAzVsPtantiHeliumTrue"), antihePt, track.dcaZ());
@@ -6316,6 +6331,11 @@ struct LFNucleiBATask {
63166331
if (mcCollision.centFT0M() < cfgMultCutLow || mcCollision.centFT0M() > cfgMultCutHigh)
63176332
return;
63186333

6334+
if (evselOptions.enableGenVzCut) {
6335+
if (mcCollision.posZ() < cfgVzCutLow || mcCollision.posZ() > cfgVzCutHigh)
6336+
return;
6337+
}
6338+
63196339
if (enableCentrality)
63206340
spectraGen.fill(HIST("histGenVetxZ"), mcCollision.posZ(), mcCollision.centFT0M());
63216341
else

0 commit comments

Comments
 (0)