Skip to content

Commit 4f481d0

Browse files
committed
Add first draft of pidStudies task
1 parent 0ac4c85 commit 4f481d0

File tree

2 files changed

+155
-0
lines changed

2 files changed

+155
-0
lines changed

Common/Tasks/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,9 @@ o2physics_add_dpl_workflow(qvectors-correction
8282
o2physics_add_dpl_workflow(centrality-study
8383
SOURCES centralityStudy.cxx
8484
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
85+
COMPONENT_NAME Analysis)
86+
87+
o2physics_add_dpl_workflow(pid-studies
88+
SOURCES pidStudies.cxx
89+
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
8590
COMPONENT_NAME Analysis)

Common/Tasks/pidStudies.cxx

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
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 pidStudies.cxx
13+
/// \brief task for studies of PID performance
14+
///
15+
/// \author Fabrizio Chinu <fabrizio.chinu@cern.ch>, Università and INFN Torino
16+
/// \author Stefano Politanò <stefano.politano@cern.ch>, INFN Torino
17+
/// \author Marcello Di Costanzo <marcello.di.costanzo@cern.ch>, Politecnico and INFN Torino
18+
19+
#include "Framework/AnalysisTask.h"
20+
#include "Framework/HistogramRegistry.h"
21+
#include "Framework/runDataProcessing.h"
22+
#include "Common/DataModel/PIDResponse.h"
23+
#include "Common/DataModel/Centrality.h"
24+
#include "Common/DataModel/Multiplicity.h"
25+
#include "Common/DataModel/EventSelection.h"
26+
#include "PWGLF/DataModel/LFStrangenessTables.h"
27+
28+
using namespace o2;
29+
using namespace o2::framework;
30+
using namespace o2::framework::expressions;
31+
32+
33+
namespace o2::aod
34+
{
35+
namespace pid_studies
36+
{
37+
DECLARE_SOA_COLUMN(MassK0, massK0, float); //! Candidate mass
38+
DECLARE_SOA_COLUMN(MassLambda, massLambda, float); //! Candidate mass
39+
DECLARE_SOA_COLUMN(PtPos, ptPos, float); //! Transverse momentum of positive track (GeV/c)
40+
DECLARE_SOA_COLUMN(PtNeg, ptNeg, float); //! Transverse momentum of negative track (GeV/c)
41+
DECLARE_SOA_COLUMN(Radius, radius, float); //! Radius
42+
DECLARE_SOA_COLUMN(Cpa, cpa, float); //! Cosine of pointing angle
43+
DECLARE_SOA_COLUMN(NSigmaTpcPosPi, nSigmaTpcPosPi, float); //! nSigmaTPC of positive track with pion hypothesis
44+
DECLARE_SOA_COLUMN(NSigmaTpcNegPi, nSigmaTpcNegPi, float); //! nSigmaTPC of negative track with pion hypothesis
45+
DECLARE_SOA_COLUMN(NSigmaTpcPosKa, nSigmaTpcPosKa, float); //! nSigmaTPC of positive track with kaon hypothesis
46+
DECLARE_SOA_COLUMN(NSigmaTpcNegKa, nSigmaTpcNegKa, float); //! nSigmaTPC of negative track with kaon hypothesis
47+
DECLARE_SOA_COLUMN(NSigmaTpcPosPr, nSigmaTpcPosPr, float); //! nSigmaTPC of positive track with proton hypothesis
48+
DECLARE_SOA_COLUMN(NSigmaTpcNegPr, nSigmaTpcNegPr, float); //! nSigmaTPC of negative track with proton hypothesis
49+
DECLARE_SOA_COLUMN(NSigmaTofPosPi, nSigmaTofPosPi, float); //! nSigmaTOF of positive track with pion hypothesis
50+
DECLARE_SOA_COLUMN(NSigmaTofNegPi, nSigmaTofNegPi, float); //! nSigmaTOF of negative track with pion hypothesis
51+
DECLARE_SOA_COLUMN(NSigmaTofPosKa, nSigmaTofPosKa, float); //! nSigmaTOF of positive track with kaon hypothesis
52+
DECLARE_SOA_COLUMN(NSigmaTofNegKa, nSigmaTofNegKa, float); //! nSigmaTOF of negative track with kaon hypothesis
53+
DECLARE_SOA_COLUMN(NSigmaTofPosPr, nSigmaTofPosPr, float); //! nSigmaTOF of positive track with proton hypothesis
54+
DECLARE_SOA_COLUMN(NSigmaTofNegPr, nSigmaTofNegPr, float); //! nSigmaTOF of negative track with proton hypothesis
55+
DECLARE_SOA_COLUMN(AlphaArm, alphaArm, float); //! Armenteros alpha
56+
DECLARE_SOA_COLUMN(QtArm, qtArm, float); //! Armenteros Qt
57+
DECLARE_SOA_COLUMN(OccupancyFt0c, occupancyFt0c, float); //! Occupancy of FT0C
58+
DECLARE_SOA_COLUMN(OccupancyIts, occupancyIts, float); //! Occupancy of ITS
59+
DECLARE_SOA_COLUMN(CentralityFT0C, centralityFT0C, float); //! Centrality from FT0C
60+
DECLARE_SOA_COLUMN(CentralityFT0M, centralityFT0M, float); //! Centrality from FT0M
61+
} // namespace pid_studies
62+
63+
DECLARE_SOA_TABLE(pidInformation, "AOD", "PIDSTUDIES", //! Table with PID information
64+
pid_studies::MassK0,
65+
pid_studies::MassLambda,
66+
pid_studies::PtPos,
67+
pid_studies::PtNeg,
68+
pid_studies::Radius,
69+
pid_studies::Cpa,
70+
pid_studies::NSigmaTpcPosPi,
71+
pid_studies::NSigmaTpcNegPi,
72+
pid_studies::NSigmaTpcPosKa,
73+
pid_studies::NSigmaTpcNegKa,
74+
pid_studies::NSigmaTpcPosPr,
75+
pid_studies::NSigmaTpcNegPr,
76+
pid_studies::NSigmaTofPosPi,
77+
pid_studies::NSigmaTofNegPi,
78+
pid_studies::NSigmaTofPosKa,
79+
pid_studies::NSigmaTofNegKa,
80+
pid_studies::NSigmaTofPosPr,
81+
pid_studies::NSigmaTofNegPr,
82+
pid_studies::AlphaArm,
83+
pid_studies::QtArm,
84+
pid_studies::OccupancyFt0c,
85+
pid_studies::OccupancyIts,
86+
pid_studies::CentralityFT0C,
87+
pid_studies::CentralityFT0M
88+
);
89+
} // namespace o2::aod
90+
91+
92+
struct pidStudies {
93+
Produces <o2::aod::pidInformation> pidInformation;
94+
HistogramRegistry registry{"registry", {}};
95+
96+
using PIDTracks = soa::Join<aod::Tracks, aod::TracksExtra,
97+
aod::pidTPCFullPi, aod::pidTPCFullKa, aod::pidTPCFullPr,
98+
aod::pidTOFFullPi, aod::pidTOFFullKa, aod::pidTOFFullPr>;
99+
using CollSels = soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Cs, aod::CentFT0Ms>;
100+
101+
void init(InitContext&)
102+
{
103+
}
104+
105+
template <bool isMc, typename Cand>
106+
void fillTree(Cand const& candidate)
107+
{
108+
const auto& posTrack = candidate.template posTrack_as<PIDTracks>();
109+
const auto& negTrack = candidate.template negTrack_as<PIDTracks>();
110+
pidInformation(
111+
candidate.mK0Short(),
112+
candidate.mLambda(),
113+
posTrack.pt(),
114+
negTrack.pt(),
115+
candidate.v0radius(),
116+
candidate.v0cosPA(),
117+
posTrack.tofNSigmaPi(),
118+
negTrack.tofNSigmaPi(),
119+
posTrack.tofNSigmaKa(),
120+
negTrack.tofNSigmaKa(),
121+
posTrack.tofNSigmaPr(),
122+
negTrack.tofNSigmaPr(),
123+
posTrack.tpcNSigmaPi(),
124+
negTrack.tpcNSigmaPi(),
125+
posTrack.tpcNSigmaKa(),
126+
negTrack.tpcNSigmaKa(),
127+
posTrack.tpcNSigmaPr(),
128+
negTrack.tpcNSigmaPr(),
129+
candidate.alpha(),
130+
candidate.qtarm(),
131+
candidate.template collision_as<CollSels>().ft0cOccupancyInTimeRange(),
132+
candidate.template collision_as<CollSels>().trackOccupancyInTimeRange(),
133+
candidate.template collision_as<CollSels>().centFT0C(),
134+
candidate.template collision_as<CollSels>().centFT0M()
135+
);
136+
}
137+
138+
void processData(aod::V0Datas const& V0s, aod::Cascades const& cascades, CollSels const&, PIDTracks const&)
139+
{
140+
for (const auto& v0 : V0s) {
141+
fillTree<false>(v0);
142+
}
143+
}
144+
PROCESS_SWITCH(pidStudies, processData, "process data", true);
145+
};
146+
147+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
148+
{
149+
return WorkflowSpec{adaptAnalysisTask<pidStudies>(cfgc)};
150+
}

0 commit comments

Comments
 (0)