2525using namespace o2 ;
2626using namespace o2 ::framework;
2727
28- using PIDTracks = soa::Join<aod::Tracks, aod::TracksExtra, aod::pidTPCFullPi>;
28+ using PIDTracks = soa::Join<aod::Tracks, aod::TracksExtra, aod::pidTPCFullPi, aod::pidTPCFullPr, aod::pidTOFFullPi>;
29+ using PIDTracksIU = soa::Join<aod::TracksIU, aod::TracksExtra, aod::pidTPCFullPi, aod::pidTPCFullPr, aod::pidTOFFullPi>;
2930using SelectedCollisions = soa::Join<aod::Collisions, aod::EvSels>;
3031
3132struct qaK0sTrackingEfficiency {
33+ ConfigurableAxis nSigmaBins{" nSigmaBins" , {1000 , -100 .f , 100 .f }, " Binning for the nSigma histograms" };
3234
3335 HistogramRegistry registry{" K0sTrackingEfficiency" };
36+ #define fillHistogram (name, ...) registry.fill(HIST (name), __VA_ARGS__)
3437
3538 void init (InitContext const &)
3639 {
3740 const AxisSpec RAxis{500 , 0 .f , 50 .f , " #it{R} (cm)" };
3841 const AxisSpec pTAxis{200 , 0 .f , 10 .f , " #it{p}_{T} (GeV/#it{c})" };
3942 const AxisSpec mAxis {200 , 0 .4f , 0 .6f , " #it{m} (GeV/#it{c}^{2})" };
43+ const AxisSpec etaAxis{200 , -1 .f , 1 .0f , " #it{#eta}" };
44+ const AxisSpec phiAxis{200 , -1 .f , 1 .0f , " #it{#phi}" };
45+ const AxisSpec nsigmaAxis{200 , -1 .f , 1 .0f , " #it{#phi}" };
4046 const AxisSpec statusAxis{2 , -0 .5f , 1 .5f , " " };
4147 const AxisSpec hitMapAxis{128 , -0 .5f , 127 .5f , " " };
4248
@@ -49,10 +55,30 @@ struct qaK0sTrackingEfficiency {
4955 registry.add (" Test/h_R" , " h_R" , {HistType::kTH1D , {RAxis}});
5056 registry.add (" Test/h_pT" , " h_pT" , {HistType::kTH1D , {pTAxis}});
5157 registry.add (" Test/h_mass" , " h_mass" , {HistType::kTH1D , {mAxis }});
58+ registry.add (" Lambda/h_mass" , " h_mass" , {HistType::kTH1D , {mAxisLambda }});
59+ registry.add (" AntiLambda/h_mass" , " h_mass" , {HistType::kTH1D , {mAxisLambda }});
5260 registry.add (" Test/h_negITSStatus" , " h_negITSStatus" , {HistType::kTH1I , {statusAxis}});
5361 registry.add (" Test/h_posITSStatus" , " h_posITSStatus" , {HistType::kTH1I , {statusAxis}});
5462 registry.add (" Test/h_negITSHitMap" , " h_negITSHitMap" , {HistType::kTH1I , {hitMapAxis}});
5563 registry.add (" Test/h_posITSHitMap" , " h_posITSHitMap" , {HistType::kTH1I , {hitMapAxis}});
64+ registry.add (" VsPt/h_mass" , " h_mass" , HistType::kTH2F , {pTAxis, mAxis });
65+ registry.add (" VsPt/h_tofnsigma" , " h_tofnsigma" , HistType::kTH2F , {pTAxis, nSigmaBins});
66+ registry.add (" VsPt/h_tpcnsigma" , " h_tpcnsigma" , HistType::kTH2F , {pTAxis, nSigmaBins});
67+ registry.add (" VsEta/h_mass" , " h_mass" , HistType::kTH2F , {etaAxis, mAxis });
68+ registry.add (" VsPhi/h_mass" , " h_mass" , HistType::kTH2F , {phiAxis, mAxis });
69+ registry.add (" VsRadius/h_mass" , " h_mass" , HistType::kTH2F , {RAxis, mAxis });
70+
71+ if (!doprocessIU) {
72+ return ;
73+ }
74+ // IU info
75+ registry.add (" VsRadiusPosIU/h_mass" , " h_mass" , HistType::kTH2F , {RAxis, mAxis });
76+ registry.add (" VsRadiusPosIU/h_radius" , " IU Radius of the negative track" , HistType::kTH2F , {RAxis, RAxis});
77+ registry.add (" VsRadiusPosIU/h_phi" , " Phi" , HistType::kTH2F , {RAxis, phiAxis});
78+
79+ registry.add (" VsRadiusNegIU/h_mass" , " h_mass" , HistType::kTH2F , {RAxis, mAxis });
80+ registry.add (" VsRadiusNegIU/h_radius" , " IU Radius of the positive track" , HistType::kTH2F , {RAxis, RAxis});
81+ registry.add (" VsRadiusNegIU/h_phi" , " Phi" , HistType::kTH2F , {RAxis, phiAxis});
5682 }
5783
5884 // Selection criteria
@@ -62,7 +88,7 @@ struct qaK0sTrackingEfficiency {
6288 Configurable<bool > eventSelection{" eventSelection" , true , " event selection" };
6389
6490 template <typename T1 , typename T2 , typename C>
65- bool acceptV0 (T1 v0, T2 ntrack, T2 ptrack, C collision)
91+ bool acceptV0 (const T1 & v0, const T2 & ntrack, const T2 & ptrack, const C& collision)
6692 {
6793 // Apply selections on V0
6894 if (v0.v0cosPA (collision.posX (), collision.posY (), collision.posZ ()) < v0cospa)
@@ -89,13 +115,19 @@ struct qaK0sTrackingEfficiency {
89115
90116 for (auto & v0 : fullV0s) {
91117
92- auto reconegtrack = v0.negTrack_as <PIDTracks>();
93- auto recopostrack = v0.posTrack_as <PIDTracks>();
118+ const auto & recopostrack = v0.posTrack_as <PIDTracks>();
119+ const auto & reconegtrack = v0.negTrack_as <PIDTracks>();
94120
95121 if (acceptV0 (v0, reconegtrack, recopostrack, collision)) {
96122 registry.fill (HIST (" Test/h_R" ), v0.v0radius ());
97123 registry.fill (HIST (" Test/h_pT" ), v0.pt ());
98124 registry.fill (HIST (" Test/h_mass" ), v0.mK0Short ());
125+ registry.fill (HIST (" VsPt/h_mass" ), v0.pt (), v0.mK0Short ());
126+ registry.fill (HIST (" VsPt/h_tpcnsigma" ), v0.pt (), recopostrack.tpcNSigmaPi ());
127+ registry.fill (HIST (" VsPt/h_tofnsigma" ), v0.pt (), recopostrack.tofNSigmaPi ());
128+ registry.fill (HIST (" VsEta/h_mass" ), v0.eta (), v0.mK0Short ());
129+ registry.fill (HIST (" VsPhi/h_mass" ), v0.phi (), v0.mK0Short ());
130+ registry.fill (HIST (" VsRadius/h_mass" ), v0.v0radius (), v0.mK0Short ());
99131
100132 registry.fill (HIST (" Test/h_negITSStatus" ), reconegtrack.hasITS ());
101133 registry.fill (HIST (" Test/h_posITSStatus" ), recopostrack.hasITS ());
@@ -108,6 +140,37 @@ struct qaK0sTrackingEfficiency {
108140 }
109141 }
110142 }
143+
144+ void processIU (SelectedCollisions::iterator const & collision,
145+ aod::V0Datas const & fullV0s,
146+ PIDTracksIU const &)
147+ // TODO: add centrality
148+ {
149+ if (eventSelection && !collision.sel8 ()) {
150+ return ;
151+ }
152+
153+ float posRadius = 0 .f ;
154+ float negRadius = 0 .f ;
155+ for (auto & v0 : fullV0s) {
156+ const auto & posTrackIU = v0.posTrack_as <PIDTracksIU>();
157+ const auto & negTrackIU = v0.negTrack_as <PIDTracksIU>();
158+ if (!acceptV0 (v0, negTrackIU, posTrackIU, collision)) {
159+ continue ;
160+ }
161+ posRadius = sqrt (posTrackIU.x () * posTrackIU.x () + posTrackIU.y () * posTrackIU.y ());
162+ negRadius = sqrt (negTrackIU.x () * negTrackIU.x () + negTrackIU.y () * negTrackIU.y ());
163+
164+ fillHistogram (" VsRadiusPosIU/h_mass" , posRadius, v0.mK0Short ());
165+ fillHistogram (" VsRadiusPosIU/h_radius" , posRadius, negRadius);
166+ fillHistogram (" VsRadiusPosIU/h_phi" , posRadius, posTrackIU.phi ());
167+
168+ fillHistogram (" VsRadiusNegIU/h_mass" , negRadius, v0.mK0Short ());
169+ fillHistogram (" VsRadiusNegIU/h_radius" , negRadius, posRadius);
170+ fillHistogram (" VsRadiusNegIU/h_phi" , negRadius, posTrackIU.phi ());
171+ }
172+ }
173+ PROCESS_SWITCH (qaK0sTrackingEfficiency, processIU, " Run also on IU" , true );
111174};
112175
113176WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
0 commit comments