Skip to content

Commit 24a3126

Browse files
author
arkaprabha
committed
Fix lining spaces
1 parent 4a41f5b commit 24a3126

File tree

1 file changed

+168
-169
lines changed

1 file changed

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

0 commit comments

Comments
 (0)