Skip to content

Commit 8927567

Browse files
authored
Several small bugfixes (mostly histogram binning and filling) (#6748)
1 parent 4827bce commit 8927567

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

Analysis/Tasks/PWGLF/NucleiSpectraEfficiency.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
4545

4646
#include "Framework/runDataProcessing.h" // important to declare after the options
4747

48-
struct NucleiSpectraEfficienctyVtx {
49-
OutputObj<TH1F> histVertexTrueZ{TH1F("histVertexTrueZ", "MC true z position of z-vertex; vertex z (cm)", 100, -20., 20.)};
48+
struct NucleiSpectraEfficiencyVtx {
49+
OutputObj<TH1F> histVertexTrueZ{TH1F("histVertexTrueZ", "MC true z position of z-vertex; vertex z (cm)", 200, -20., 20.)};
5050

5151
void process(aod::McCollision const& mcCollision)
5252
{
@@ -103,7 +103,7 @@ struct NucleiSpectraEfficiencyRec {
103103
AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"};
104104
AxisSpec centAxis = {centBinning, "V0M (%)"};
105105
//
106-
spectra.add("histRecVtxZ", "collision z position", HistType::kTH1F, {{600, -20., +20., "z position (cm)"}});
106+
spectra.add("histRecVtxZ", "collision z position", HistType::kTH1F, {{200, -20., +20., "z position (cm)"}});
107107
spectra.add("histRecPt", "reconstructed particles", HistType::kTH1F, {ptAxis});
108108
spectra.add("histTpcSignal", "Specific energy loss", HistType::kTH2F, {{600, -6., 6., "#it{p} (GeV/#it{c})"}, {1400, 0, 1400, "d#it{E} / d#it{X} (a. u.)"}});
109109
spectra.add("histTpcNsigma", "n-sigma TPC", HistType::kTH2F, {ptAxis, {200, -100., +100., "n#sigma_{He} (a. u.)"}});
@@ -167,7 +167,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
167167
WorkflowSpec workflow{};
168168
//
169169
if (vertex) {
170-
workflow.push_back(adaptAnalysisTask<NucleiSpectraEfficienctyVtx>(cfgc, TaskName{"nuclei-efficiency-vtx"}));
170+
workflow.push_back(adaptAnalysisTask<NucleiSpectraEfficiencyVtx>(cfgc, TaskName{"nuclei-efficiency-vtx"}));
171171
}
172172
if (gen) {
173173
workflow.push_back(adaptAnalysisTask<NucleiSpectraEfficiencyGen>(cfgc, TaskName{"nuclei-efficiency-gen"}));

Analysis/Tasks/PWGLF/NucleiSpectraTask.cxx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,14 @@ struct NucleiSpectraTask {
4040

4141
void init(o2::framework::InitContext&)
4242
{
43-
std::vector<double> ptBinning = {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.8, 2.0, 2.2, 2.4, 2.8, 3.2, 3.6, 4., 5.};
43+
std::vector<double> ptBinning = {0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6,
44+
1.8, 2.0, 2.2, 2.4, 2.8, 3.2, 3.6, 4., 5., 6., 8., 10., 12., 14.};
4445
std::vector<double> centBinning = {0., 1., 5., 10., 20., 30., 40., 50., 70., 100.};
4546

4647
AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"};
4748
AxisSpec centAxis = {centBinning, "V0M (%)"};
4849

49-
spectra.add("histRecVtxZData", "collision z position", HistType::kTH1F, {{600, -20., +20., "z position (cm)"}});
50+
spectra.add("histRecVtxZData", "collision z position", HistType::kTH1F, {{200, -20., +20., "z position (cm)"}});
5051
spectra.add("histKeepEventData", "skimming histogram", HistType::kTH1F, {{2, -0.5, +1.5, "true: keep event, false: reject event"}});
5152
spectra.add("histTpcSignalData", "Specific energy loss", HistType::kTH2F, {{600, -6., 6., "#it{p} (GeV/#it{c})"}, {1400, 0, 1400, "d#it{E} / d#it{X} (a. u.)"}});
5253
spectra.add("histTofSignalData", "TOF signal", HistType::kTH2F, {{600, -6., 6., "#it{p} (GeV/#it{c})"}, {500, 0.0, 1.0, "#beta (TOF)"}});
@@ -94,14 +95,16 @@ struct NucleiSpectraTask {
9495
nSigmaHe3 += 94.222101 * TMath::Exp(-0.905203 * track.tpcInnerParam());
9596
//
9697
spectra.fill(HIST("histTpcSignalData"), track.tpcInnerParam() * track.sign(), track.tpcSignal());
97-
spectra.fill(HIST("histTpcNsigmaData"), track.tpcInnerParam(), nSigmaHe3);
98+
if (track.sign() < 0) {
99+
spectra.fill(HIST("histTpcNsigmaData"), track.pt() * 2.0, nSigmaHe3);
100+
}
98101
//
99102
// check offline-trigger (skimming) condidition
100103
//
101104
if (nSigmaHe3 > nsigmacutLow && nSigmaHe3 < nsigmacutHigh) {
102105
keepEvent = kTRUE;
103106
if (track.sign() < 0) {
104-
spectra.fill(HIST("histDcaVsPtData"), track.pt(), track.dcaXY());
107+
spectra.fill(HIST("histDcaVsPtData"), track.pt() * 2.0, track.dcaXY());
105108
}
106109
//
107110
// store tracks for invariant mass calculation

0 commit comments

Comments
 (0)