Skip to content

Commit 667579f

Browse files
committed
Add histrogram register and track selection
1 parent 545d8a9 commit 667579f

1 file changed

Lines changed: 55 additions & 29 deletions

File tree

Analysis/Tasks/PWGLF/NucleiSpectraTask.cxx

Lines changed: 55 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,54 +7,80 @@
77
// In applying this license CERN does not waive the privileges and immunities
88
// granted to it by virtue of its status as an Intergovernmental Organization
99
// or submit itself to any jurisdiction.
10+
// O2 includes
11+
12+
#include "ReconstructionDataFormats/Track.h"
1013
#include "Framework/runDataProcessing.h"
1114
#include "Framework/AnalysisTask.h"
1215
#include "Framework/AnalysisDataModel.h"
13-
16+
#include "Framework/ASoAHelpers.h"
1417
#include "AnalysisDataModel/PID/PIDResponse.h"
18+
#include "AnalysisDataModel/TrackSelectionTables.h"
19+
20+
// #include "AnalysisDataModel/EventSelection.h"
21+
// #include "AnalysisDataModel/TrackSelectionTables.h"
22+
// #include "AnalysisDataModel/Centrality.h"
23+
24+
#include "Framework/HistogramRegistry.h"
25+
26+
#include <TLorentzVector.h>
1527

16-
#include <TH1F.h>
17-
#include <TH2F.h>
28+
#include <cmath>
1829

1930
using namespace o2;
2031
using namespace o2::framework;
2132
using namespace o2::framework::expressions;
2233

2334
struct NucleiSpecraTask {
2435

25-
OutputObj<TH2F> hTPCsignal{TH2F("hTPCsignal", ";#it{p} (GeV/#it{c}); d#it{E} / d#it{X} (a. u.)", 600, 0., 3, 1400, 0, 1400)};
26-
OutputObj<TH1F> hMomentum{TH1F("hMomentum", ";#it{p} (GeV/#it{c});", 600, 0., 3.)};
36+
HistogramRegistry spectra{"spectra", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};
2737

28-
Configurable<float> absEtaMax{"absEtaMax", 0.8, "pseudo-rapidity edges"};
29-
Configurable<float> absYmax{"absYmax", 0.5, "rapidity edges"};
30-
Configurable<float> beamRapidity{"yBeam", 0., "beam rapidity"};
31-
Configurable<float> chi2TPCperNDF{"chi2TPCperNDF", 4., "chi2 per NDF in TPC"};
32-
Configurable<float> foundFractionTPC{"foundFractionTPC", 0., "TPC clusters / TPC crossed rows"};
33-
Configurable<int> recPointsTPC{"recPointsTPC", 0, "clusters in TPC"};
34-
Configurable<int> signalClustersTPC{"signalClustersTPC", 70, "clusters with PID in TPC"};
35-
Configurable<float> minEnergyLoss{"minEnergyLoss", 0., "energy loss in TPC"};
36-
Configurable<int> recPointsITS{"recPointsITS", 2, "number of ITS points"};
37-
Configurable<int> recPointsITSInnerBarrel{"recPointsITSInnerBarrel", 1, "number of points in ITS Inner Barrel"};
38+
void init(o2::framework::InitContext&)
39+
{
40+
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.};
41+
std::vector<double> centBinning = {0., 1., 5., 10., 20., 30., 40., 50., 70., 100.};
42+
43+
AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"};
44+
AxisSpec centAxis = {centBinning, "V0M (%)"};
45+
46+
spectra.add("fTPCsignal", "Specific energy loss", HistType::kTH2F, {{600, 0., 3, "#it{p} (GeV/#it{c})"}, {1400, 0, 1400, "d#it{E} / d#it{X} (a. u.)"}});
47+
48+
spectra.add("fTPCcounts", "n-sigma TPC", HistType::kTH2F, {ptAxis, {200, -5, 5, "n#sigma_{d} (a. u.)"}});
49+
}
3850

39-
Filter etaFilter = aod::track::eta > -1 * absEtaMax&& aod::track::eta < absEtaMax;
40-
Filter chi2Filter = aod::track::tpcChi2NCl < chi2TPCperNDF;
51+
Configurable<float> yMin{"yMin", -0.5, "Maximum rapidity"};
52+
Configurable<float> yMax{"yMax", 0.5, "Minimum rapidity"};
53+
Configurable<float> yBeam{"yBeam", 0., "Beam rapidity"};
4154

42-
void process(soa::Filtered<soa::Join<aod::Tracks, aod::TracksExtra>> const& tracks)
55+
Configurable<float> cfgCutVertex{"cfgCutVertex", 10.0f, "Accepted z-vertex range"};
56+
Configurable<float> cfgCutEta{"cfgCutEta", 0.8f, "Eta range for tracks"};
57+
Configurable<float> nsigmacut{"nsigmacut", 3, "Value of the Nsigma cut"};
58+
59+
Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex;
60+
Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::isGlobalTrack == (uint8_t) true);
61+
62+
using TrackCandidates = soa::Filtered<soa::Join<aod::Tracks, aod::TracksExtra, aod::pidRespTPC, aod::pidRespTOF, aod::pidRespTOFbeta, aod::TrackSelection>>;
63+
64+
void process(/*soa::Join<aod::Collisions, aod::EvSels, aod::Cents> aod::Collisions::iterator const& col, */ TrackCandidates const& tracks)
4365
{
44-
for (auto& track : tracks) {
45-
// Part not covered by filters
46-
if (track.tpcNClsFound() < recPointsTPC) {
47-
continue;
48-
}
49-
if (track.itsNCls() < recPointsITS) {
50-
continue;
51-
}
52-
if (track.itsNClsInnerBarrel() < recPointsITSInnerBarrel) {
66+
/*
67+
if (!col.alias()[kINT7])
68+
return;
69+
if (!col.sel7())
70+
return;
71+
72+
fMultiplicity->Fill(col.centV0M());
73+
*/
74+
for (auto track : tracks) {
75+
76+
TLorentzVector cutVector{};
77+
cutVector.SetPtEtaPhiM(track.pt(), track.eta(), track.phi(), constants::physics::MassDeuteron);
78+
if (cutVector.Rapidity() < yMin + yBeam || cutVector.Rapidity() > yMax + yBeam) {
5379
continue;
5480
}
5581

56-
hTPCsignal->Fill(track.tpcInnerParam(), track.tpcSignal());
57-
hMomentum->Fill(track.p());
82+
spectra.fill(HIST("fTPCsignal"), track.p(), track.tpcSignal());
83+
spectra.fill(HIST("fTPCcounts"), fabs(track.pt()), track.tpcNSigmaDe());
5884
}
5985
}
6086
};

0 commit comments

Comments
 (0)