Skip to content

Commit 39289f5

Browse files
author
arkaprabha
committed
Add new task for nuclei analysis in light ions.
1 parent 2edd75a commit 39289f5

File tree

2 files changed

+166
-0
lines changed

2 files changed

+166
-0
lines changed
Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
12+
/// \file Antinucleitask.cxx
13+
///
14+
/// \author Arkaprabha Saha <arkaprabha.saha@cern.ch>
15+
///
16+
/// \brief An analysis task to select and analyze anti-nuclei events and tracks.
17+
18+
#include "Framework/runDataProcessing.h"
19+
#include "Framework/AnalysisTask.h"
20+
#include "Framework/HistogramRegistry.h"
21+
#include "Framework/AnalysisDataModel.h"
22+
#include <TParameter.h>
23+
#include <cmath>
24+
#include "Common/DataModel/EventSelection.h"
25+
#include "Common/Core/TrackSelection.h"
26+
#include "Common/Core/TrackSelectionDefaults.h"
27+
#include "Common/DataModel/PIDResponse.h"
28+
#include "Common/Core/PID/TPCPIDResponse.h"
29+
#include "Common/DataModel/TrackSelectionTables.h"
30+
#include "Common/DataModel/Centrality.h"
31+
#include "DataFormatsTPC/BetheBlochAleph.h"
32+
33+
using namespace o2;
34+
using namespace o2::framework;
35+
using CollisionWithEvSel = soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Cs>;
36+
using TotalTracks = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::pidTOFDe>;
37+
38+
namespace {
39+
static const std::vector<std::string> particleName{"d"};
40+
static const double kBetheBlochDefault[6]{-1.e32, -1.e32, -1.e32, -1.e32, -1.e32, -1.e32};
41+
static const std::vector<std::string> betheBlochParNames{"p0", "p1", "p2", "p3", "p4", "resolution"};
42+
}
43+
44+
struct Antinucleitask {
45+
// Histogram registry: for holding histograms
46+
HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject};
47+
48+
// Configurable track cuts
49+
Configurable<float> mtrackNclusTPCcut{"trackNclusTPCcut", 70.0f, "min number of TPC clusters"};
50+
Configurable<float> mtrackNclusITScut{"trackNclusITScut", 4.0f, "min number of ITS clusters"};
51+
Configurable<float> mChi2TPC{"Chi2TPC", 4.0f, "max chi2 per cluster TPC"};
52+
Configurable<float> mChi2ITS{"Chi2ITS", 36.0f, "max chi2 per cluster ITS"};
53+
Configurable<float> mtrackDCAz{"trackDCAz", 0.1f, "maxDCAz"};
54+
Configurable<float> mtrackDCAxy{"trackDCAxy", 0.1f, "maxDCAxy"};
55+
Configurable<LabeledArray<double>> cfgBetheBlochParams{"cfgBetheBlochParams", {kBetheBlochDefault, 1, 6, particleName, betheBlochParNames}, "TPC Bethe-Bloch parameterisation for deuteron"};
56+
57+
void init(InitContext const&)
58+
{ // Defining the Histogram Axes
59+
ConfigurableAxis etaAxis{"etaAxis", {16, -0.8, +0.8}, "#eta"};
60+
ConfigurableAxis phiAxis{"phiAxis", {70, 0.f, 7.f}, "#phi"};
61+
ConfigurableAxis zVtxAxis{"zVtxAxis", {100, -20.f, 20.f}, "Primary Vertex z (cm)"};
62+
ConfigurableAxis NSigmaAxis{"NSigmaAxis", {50, -5.f, 5.f}, "N_{#sigma}"};
63+
ConfigurableAxis ptAxis{"ptAxis", {100, -5.0f, 5.0f}, "p_{T} (GeV/c)"};
64+
ConfigurableAxis centAxis{"centAxis", {100, 0, 100.0f}, "Centrality"};
65+
ConfigurableAxis momAxis{"momAxis", {5.e2, 0.f, 5.f}, "momentum axis binning"};
66+
ConfigurableAxis tpcAxis{"tpcAxis", {4.e2, 0.f, 4.e3f}, "tpc signal axis binning"};
67+
68+
69+
// Creating histograms
70+
histos.add("RawzVtx", "RawzVtx", kTH1F, {{zVtxAxis, "Primary Vertex z (cm)"}});
71+
histos.add("zVtx", "zVtx", kTH1F,{{zVtxAxis, "Primary Vertex z (cm)"}});
72+
histos.add("RawEta", "RawEta", kTH1F, {{etaAxis, "#eta"}});
73+
histos.add("Eta", "Eta", kTH1F, {{etaAxis, "#eta"}});
74+
histos.add("RawPhi", "RawPhi", kTH1F, {{phiAxis, "#phi (rad)"}});
75+
histos.add("Phi", "Phi", kTH1F, {{phiAxis, "#phi (rad)"}});
76+
histos.add("RawPt", "RawPt", kTH1F, {{ptAxis, "#it{p}_{T} (GeV/#it{c})"}});
77+
histos.add("Pt", "Pt", kTH1F, {{ptAxis, "#it{p}_{T} (GeV/#it{c})"}});
78+
histos.add("TpcSignal", "TpcSignal", kTH2F, {{momAxis, "#it{p}_{TPC} (GeV/#it{c})"}, {tpcAxis, "d#it{E}/d#it{x}_{TPC}"}});
79+
histos.add("RawtpcNSigma", "RawtpcNSigma", kTH3F, {{centAxis, "Centrality"}, {ptAxis, "#it{p}_{T} (GeV/#it{c})"}, {NSigmaAxis, "N_{#sigma}"}});
80+
histos.add("tpcNSigma", "tpcNSigma", kTH3F, {{centAxis, "Centrality"}, {ptAxis, "#it{p}_{T} (GeV/#it{c})"}, {NSigmaAxis, "N_{#sigma}"}});
81+
histos.add("RawtofNSigma", "RawtofNSigma", kTH3F, {{centAxis, "Centrality"}, {ptAxis, "#it{p}_{T} (GeV/#it{c})"}, {NSigmaAxis, "N_{#sigma}"}});
82+
histos.add("tofNSigma", "tofNSigma", kTH3F, {{centAxis, "Centrality"}, {ptAxis, "#it{p}_{T} (GeV/#it{c})"}, {NSigmaAxis, "N_{#sigma}"}});
83+
84+
}
85+
86+
//Function to apply track cuts
87+
template <typename T>
88+
bool isGoodTrack(const T& track)
89+
{
90+
if (track.eta() > 0.8f) return false;
91+
if (track.tpcNClsFound() < mtrackNclusTPCcut) return false;
92+
if (track.tpcNClsCrossedRows() < 70) return false;
93+
if (track.itsNCls() < mtrackNclusITScut) return false;
94+
if (track.tpcChi2NCl() > mChi2TPC) return false;
95+
if (track.itsChi2NCl() > mChi2ITS) return false;
96+
if (std::abs(track.dcaXY()) > mtrackDCAxy) return false;
97+
if (std::abs(track.dcaZ()) > mtrackDCAz) return false;
98+
99+
return true;
100+
}
101+
102+
// The process function
103+
void process(CollisionWithEvSel::iterator const& collision, TotalTracks const& tracks)
104+
{
105+
// Event Selection
106+
if (std::abs(collision.posZ()) > 10.f) {
107+
return;
108+
}
109+
110+
// Filling the z-vertex histogram before the event selection cuts.
111+
histos.fill(HIST("RawzVtx"), collision.posZ());
112+
113+
// Applying the built-in O2 event selection (sel8).
114+
if (!collision.sel8()) {
115+
return;
116+
}
117+
118+
// Filling the z-vertex histogram after the event selection cuts.
119+
histos.fill(HIST("zVtx"), collision.posZ());
120+
121+
// Track Selection
122+
for (auto& track : tracks) {
123+
124+
double expBethe{tpc::BetheBlochAleph(static_cast<double>(track.tpcInnerParam() / o2::constants::physics::MassDeuteron), cfgBetheBlochParams->get("p0"), cfgBetheBlochParams->get("p1"), cfgBetheBlochParams->get("p2"), cfgBetheBlochParams->get("p3"), cfgBetheBlochParams->get("p4"))};
125+
double expSigma{expBethe * cfgBetheBlochParams->get("resolution")};
126+
float tpcNSigmaDeuteron = static_cast<float>((track.tpcSignal() - expBethe) / expSigma);
127+
128+
float pt = track.sign() > 0 ? track.pt() : -track.pt();
129+
// Filling histograms with track data before applying any cuts.
130+
histos.fill(HIST("RawEta"), track.eta());
131+
histos.fill(HIST("RawPhi"), track.phi());
132+
histos.fill(HIST("RawPt"), pt);
133+
histos.fill(HIST("RawtpcNSigma"), collision.centFT0C(), pt, tpcNSigmaDeuteron);
134+
histos.fill(HIST("RawtofNSigma"), collision.centFT0C(), pt, track.tofNSigmaDe());
135+
136+
// If the track is good, fill the "after cuts" histograms.
137+
if (isGoodTrack(track)) {
138+
histos.fill(HIST("Eta"), track.eta());
139+
histos.fill(HIST("Phi"), track.phi());
140+
histos.fill(HIST("Pt"), pt);
141+
142+
histos.fill(HIST("tpcNSigma"), collision.centFT0C(), pt, tpcNSigmaDeuteron);
143+
144+
histos.fill(HIST("TpcSignal"), track.tpcInnerParam(), track.tpcSignal());
145+
146+
if (std::abs(tpcNSigmaDeuteron)< 3.f) {
147+
histos.fill(HIST("tofNSigma"), collision.centFT0C(), pt, track.tofNSigmaDe());
148+
}
149+
150+
}
151+
}
152+
}
153+
154+
PROCESS_SWITCH(Antinucleitask, process, "process", true);
155+
};
156+
157+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
158+
{
159+
return WorkflowSpec{
160+
adaptAnalysisTask<Antinucleitask>(cfgc)};
161+
}

PWGLF/Tasks/Nuspex/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ o2physics_add_dpl_workflow(nuclei-ebye
119119
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
120120
COMPONENT_NAME Analysis)
121121

122+
o2physics_add_dpl_workflow(anti-nuclei-hist
123+
SOURCES Antinucleitask.cxx
124+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
125+
COMPONENT_NAME Analysis)
126+
122127
o2physics_add_dpl_workflow(nuclei-toward-transv
123128
SOURCES nuclei_in_toward_transv_regions.cxx
124129
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore

0 commit comments

Comments
 (0)