Skip to content

Commit 3c4912d

Browse files
[PWGLF] Create task for pt spectrum of 3He from hypertriton (#8602)
1 parent 927ab79 commit 3c4912d

File tree

2 files changed

+126
-0
lines changed

2 files changed

+126
-0
lines changed

PWGLF/Tasks/Nuspex/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,11 @@ o2physics_add_dpl_workflow(ebye-mult
144144
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
145145
COMPONENT_NAME Analysis)
146146

147+
o2physics_add_dpl_workflow(he3-from-hypertriton-map
148+
SOURCES he3FromHypertritonMap.cxx
149+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
150+
COMPONENT_NAME Analysis)
151+
147152
if(FastJet_FOUND)
148153
o2physics_add_dpl_workflow(angular-correlations-in-jets
149154
SOURCES AngularCorrelationsInJets.cxx
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
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 Roberta Ferioli (roberta.ferioli@cern.ch)
13+
/// \since November, 2024
14+
15+
#include <vector>
16+
#include <TMath.h>
17+
#include <TPDGCode.h>
18+
#include <TRandom.h>
19+
#include <TVector2.h>
20+
#include <TVector3.h>
21+
#include <TDatabasePDG.h>
22+
#include "Framework/runDataProcessing.h"
23+
#include "Framework/AnalysisTask.h"
24+
#include "Framework/AnalysisDataModel.h"
25+
#include "Framework/ASoA.h"
26+
#include "Framework/ASoAHelpers.h"
27+
#include "Framework/HistogramRegistry.h"
28+
#include "Framework/RunningWorkflowInfo.h"
29+
#include "Framework/DataTypes.h"
30+
#include "ReconstructionDataFormats/Track.h"
31+
#include "ReconstructionDataFormats/PID.h"
32+
#include "ReconstructionDataFormats/DCA.h"
33+
#include "Common/Core/trackUtilities.h"
34+
#include "Common/Core/TrackSelection.h"
35+
#include "Common/DataModel/TrackSelectionTables.h"
36+
#include "Common/DataModel/EventSelection.h"
37+
#include "Common/DataModel/Centrality.h"
38+
#include "Common/DataModel/PIDResponse.h"
39+
40+
using namespace std;
41+
using namespace o2;
42+
using namespace o2::framework;
43+
using namespace o2::framework::expressions;
44+
using namespace o2::constants::physics;
45+
using std::array;
46+
47+
using MCTracks = soa::Join<aod::Tracks, aod::TracksExtra, aod::TrackSelection, aod::TrackSelectionExtension, aod::TracksDCA, aod::McTrackLabels>;
48+
49+
struct he3FromHypertritonMap {
50+
HistogramRegistry registryMC{
51+
"registryMC",
52+
{},
53+
OutputObjHandlingPolicy::AnalysisObject,
54+
true,
55+
true};
56+
57+
Configurable<int> particle_of_interest{"particle_of_interest", 0, "0=antihelium3, 1=antihypertriton"};
58+
59+
// Track Parameters
60+
Configurable<int> min_ITS_nClusters{"min_ITS_nClusters", 7, "minimum number of found ITS clusters"};
61+
Configurable<int> min_TPC_nClusters{"min_TPC_nClusters", 100, "minimum number of found TPC clusters"};
62+
Configurable<int> min_TPC_nCrossedRows{"min_TPC_nCrossedRows", 70, "minimum number of TPC crossed pad rows"};
63+
Configurable<float> max_chi2_TPC{"max_chi2_TPC", 4.0f, "maximum TPC chi^2/Ncls"};
64+
Configurable<float> min_chi2_TPC{"min_chi2_ITS", 0.5f, "minimum TPC chi^2/Ncls"};
65+
Configurable<float> min_eta{"min_eta", -0.8f, "minimum_eta"};
66+
Configurable<float> max_eta{"max_eta", +0.8f, "maximum_eta"};
67+
Configurable<float> max_dcaxy{"max_dcaxy", 0.05f, "Maximum DCAxy"};
68+
Configurable<float> max_dcaz{"max_dcaz", 0.05f, "Maximum DCAz"};
69+
Configurable<float> min_nsigmaTPC{"min_nsigmaTPC", -2.0f, "Minimum nsigma TPC"};
70+
Configurable<float> max_nsigmaTPC{"max_nsigmaTPC", +2.0f, "Maximum nsigma TPC"};
71+
Configurable<float> min_pt{"min_pt", 0.0f, "minimum pt of the tracks"};
72+
Configurable<float> max_pt{"max_pt", 10.0f, "maximum pt of the tracks"};
73+
Configurable<int> nbin_pt{"nbin_pt", 50, "number of pt bins"};
74+
75+
int AntihePDG = -1000020030;
76+
int AntiHypertritonPDG = -1010010030;
77+
78+
void init(InitContext const&)
79+
{
80+
registryMC.add("he3SecPtRec", "he3SecPtRec", HistType::kTH1F, {{nbin_pt, min_pt, max_pt, "p_{T} (GeV/c)"}});
81+
registryMC.add("hypertritonPtgen", "hypertritonPtGen", HistType::kTH1F, {{nbin_pt, min_pt, max_pt, "p_{T} (GeV/c)"}});
82+
}
83+
84+
void processMC(aod::McParticles const& mcParticles, const MCTracks& tracks)
85+
{
86+
for (const auto& track : tracks) {
87+
if (!track.has_mcParticle()) {
88+
continue;
89+
}
90+
auto mcparticle = track.mcParticle();
91+
if (mcparticle.pdgCode() != AntihePDG || mcparticle.isPhysicalPrimary()) {
92+
continue;
93+
}
94+
95+
for (auto& motherparticle : mcparticle.mothers_as<aod::McParticles>()) {
96+
if (motherparticle.pdgCode() == AntiHypertritonPDG) {
97+
if (track.itsNCls() < min_ITS_nClusters ||
98+
track.tpcNClsFound() < min_TPC_nClusters ||
99+
track.tpcNClsCrossedRows() < min_TPC_nCrossedRows ||
100+
track.tpcNClsCrossedRows() < 0.8 * track.tpcNClsFindable() ||
101+
track.tpcChi2NCl() > 4.f ||
102+
track.tpcChi2NCl() < min_chi2_TPC ||
103+
track.eta() < min_eta || track.eta() > max_eta ||
104+
track.dcaXY() > max_dcaxy || track.dcaXY() < -max_dcaxy ||
105+
track.dcaZ() > max_dcaz || track.dcaZ() < -max_dcaz ||
106+
track.itsChi2NCl() > 36.f) {
107+
continue;
108+
}
109+
registryMC.fill(HIST("he3SecPtRec"), track.pt());
110+
registryMC.fill(HIST("hypertritonPtgen"), motherparticle.pt());
111+
}
112+
}
113+
}
114+
}
115+
PROCESS_SWITCH(he3FromHypertritonMap, processMC, "Process MC", false);
116+
};
117+
118+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
119+
{
120+
return WorkflowSpec{adaptAnalysisTask<he3FromHypertritonMap>(cfgc)};
121+
}

0 commit comments

Comments
 (0)