Skip to content

Commit 9406129

Browse files
committed
refactoring
1 parent a5842e7 commit 9406129

File tree

1 file changed

+9
-18
lines changed

1 file changed

+9
-18
lines changed

PWGLF/Tasks/Nuspex/antinucleiInJets.cxx

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@ struct AntinucleiInJets {
139139
Configurable<double> nSigmaItsMin{"nSigmaItsMin", -3.0, "nSigmaITS min"};
140140
Configurable<double> nSigmaItsMax{"nSigmaItsMax", +3.0, "nSigmaITS max"};
141141

142+
// Initialize ITS PID Response object
143+
o2::aod::ITSResponse itsResponse;
144+
142145
// CCDB manager service for accessing condition data
143146
Service<o2::ccdb::BasicCCDBManager> ccdb;
144147

@@ -252,6 +255,9 @@ struct AntinucleiInJets {
252255
// Reconstructed antiproton spectra in jets and UE (MC-matched) with TPC/TOF PID
253256
if (doprocessJetsMCrec) {
254257

258+
// Configure ITS PID response with default parameters for Monte Carlo analysis
259+
itsResponse.setMCDefaultParameters();
260+
255261
// Event counter
256262
registryMC.add("recEvents", "number of reconstructed events in mc", HistType::kTH1F, {{20, 0, 20, "counter"}});
257263

@@ -333,6 +339,9 @@ struct AntinucleiInJets {
333339
// Systematic uncertainties (MC)
334340
if (doprocessSystEff) {
335341

342+
// Configure ITS PID response with default parameters for Monte Carlo analysis
343+
itsResponse.setMCDefaultParameters();
344+
336345
// Histograms for generated antiparticles
337346
registryMC.add("antiproton_gen_syst", "antiproton_gen_syst", HistType::kTH1F, {{nbins, min, max, "#it{p}_{T} (GeV/#it{c})"}});
338347
registryMC.add("antideuteron_gen_syst", "antideuteron_gen_syst", HistType::kTH1F, {{nbins, 2 * min, 2 * max, "#it{p}_{T} (GeV/#it{c})"}});
@@ -803,9 +812,6 @@ struct AntinucleiInJets {
803812
// Get jet constituents
804813
std::vector<fastjet::PseudoJet> jetConstituents = jet.constituents();
805814

806-
// Initialize ITS PID Response object
807-
o2::aod::ITSResponse itsResponse;
808-
809815
// Loop over jet constituents
810816
for (const auto& particle : jetConstituents) {
811817

@@ -1261,9 +1267,6 @@ struct AntinucleiInJets {
12611267
}
12621268
}
12631269

1264-
// ITS PID response utility
1265-
o2::aod::ITSResponse itsResponse;
1266-
12671270
// Loop over all reconstructed MC tracks
12681271
for (auto const& track : mcTracks) {
12691272

@@ -1496,9 +1499,6 @@ struct AntinucleiInJets {
14961499
// Reconstructed events
14971500
void processJetsMCrec(RecCollisionsMc const& collisions, AntiNucleiTracksMc const& mcTracks, McParticles const&)
14981501
{
1499-
// Initialize ITS PID Response object
1500-
o2::aod::ITSResponse itsResponse;
1501-
15021502
// Loop over all reconstructed collisions
15031503
for (const auto& collision : collisions) {
15041504

@@ -1837,9 +1837,6 @@ struct AntinucleiInJets {
18371837
3.41, 2.75, 3.26, 2.61, 3.09, 2.54, 3.36, 2.95, 3.20, 2.58,
18381838
3.44, 2.83, 3.11, 2.62, 3.28, 2.69, 3.23, 2.73, 3.39, 2.90};
18391839

1840-
// Initialize ITS PID Response object
1841-
o2::aod::ITSResponse itsResponse;
1842-
18431840
// Loop over reconstructed tracks
18441841
for (auto const& track : tracks) {
18451842

@@ -2020,9 +2017,6 @@ struct AntinucleiInJets {
20202017
if (requireIsVertexTOFmatched && !collision.selection_bit(o2::aod::evsel::kIsVertexTOFmatched))
20212018
continue;
20222019

2023-
// Initialize ITS PID Response object
2024-
o2::aod::ITSResponse itsResponse;
2025-
20262020
// Loop over reconstructed tracks
20272021
for (auto const& track : mcTracks) {
20282022

@@ -2150,9 +2144,6 @@ struct AntinucleiInJets {
21502144
// Multiplicity percentile
21512145
const float multiplicity = collision.centFT0M();
21522146

2153-
// Initialize ITS PID Response object
2154-
o2::aod::ITSResponse itsResponse;
2155-
21562147
// pt/A bins
21572148
std::vector<double> ptOverAbins = {0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0};
21582149
const int nBins = ptOverAbins.size() - 1;

0 commit comments

Comments
 (0)