1818#include " PWGUD/Core/UDHelpers.h"
1919#include " PWGUD/DataModel/UDTables.h"
2020
21+ #include " Common/DataModel/PIDResponse.h"
22+
2123#include " CommonConstants/PhysicsConstants.h"
2224#include " Framework/ASoA.h"
2325#include " Framework/ASoAHelpers.h"
@@ -98,6 +100,7 @@ struct ExclusiveRhoTo4Pi {
98100 Configurable<float > tpcChi2NClsCut{" tpcChi2NClsCut" , 4.0 , " TPC Chi2NCls" };
99101 Configurable<int > tpcNClsCrossedRowsCut{" tpcNClsCrossedRowsCut" , 70 , " Min TPC Findable Clusters" };
100102 // Configurable PID parameters
103+ Configurable<bool > ifCircularNSigmaCut{" ifCircularNSigmaCut" , true , " Use circular nsigma cut for PID" };
101104 Configurable<bool > useTOF{" useTOF" , true , " if track has TOF use TOF" };
102105 Configurable<float > nSigmaTPCcut{" nSigmaTPCcut" , 5 , " TPC cut" };
103106 Configurable<float > nSigmaTOFcut{" nSigmaTOFcut" , 5 , " TOF cut" };
@@ -153,27 +156,31 @@ struct ExclusiveRhoTo4Pi {
153156 histosQA.add (" Events/4pion/vertexZ" , " Vertex Z; Vertex Z [cm]; Counts" , kTH1F , {{2000 , -15 , 15 }});
154157 histosQA.add (" Events/4pion/occupancy" , " Occupancy; Occupancy; Counts" , kTH1F , {{20000 , 0 , 20000 }});
155158 // QA plots: All tracks in selected events
159+ histosQA.add (" Tracks/all/isPVcontributor" , " dcaXY; dcaXY [cm]; Counts" , kTH1F , {{3 , 0 , 3 }});
156160 histosQA.add (" Tracks/all/dcaXY" , " dcaXY; dcaXY [cm]; Counts" , kTH1F , {{2000 , -0.1 , 0.1 }});
157161 histosQA.add (" Tracks/all/dcaZ" , " dcaZ; dcaZ [cm]; Counts" , kTH1F , {{2000 , -0.1 , 0.1 }});
158162 histosQA.add (" Tracks/all/itsChi2NCl" , " ITS Chi2/NCl; Chi2/NCl; Counts" , kTH1F , {{250 , 0 , 50 }});
159163 histosQA.add (" Tracks/all/itsChi2" , " ITS Chi2; ITS Chi2; Counts" , kTH1F , {{500 , 0 , 50 }});
160164 histosQA.add (" Tracks/all/tpcChi2NCl" , " TPC Chi2/NCl; Chi2/NCl; Counts" , kTH1F , {{250 , 0 , 10 }});
161165 histosQA.add (" Tracks/all/tpcNClsCrossedRows" , " TPC N Cls Findable; N Cls Findable; Counts" , kTH1F , {{200 , 0 , 200 }});
162166 // QA plots: Selected tracks in selected events
167+ histosQA.add (" Tracks/selected/isPVcontributor" , " dcaXY; dcaXY [cm]; Counts" , kTH1F , {{3 , 0 , 3 }});
163168 histosQA.add (" Tracks/selected/dcaXY" , " dcaXY; dcaXY [cm]; Counts" , kTH1F , {{2000 , -0.1 , 0.1 }});
164169 histosQA.add (" Tracks/selected/dcaZ" , " dcaZ; dcaZ [cm]; Counts" , kTH1F , {{2000 , -0.1 , 0.1 }});
165170 histosQA.add (" Tracks/selected/itsChi2NCl" , " ITS Chi2/NCl; Chi2/NCl; Counts" , kTH1F , {{250 , 0 , 50 }});
166171 histosQA.add (" Tracks/selected/itsChi2" , " ITS Chi2; ITS Chi2; Counts" , kTH1F , {{500 , 0 , 50 }});
167172 histosQA.add (" Tracks/selected/tpcChi2NCl" , " TPC Chi2/NCl; Chi2/NCl; Counts" , kTH1F , {{250 , 0 , 50 }});
168173 histosQA.add (" Tracks/selected/tpcNClsCrossedRows" , " TPC N Cls Findable; N Cls Findable; Counts" , kTH1F , {{200 , 0 , 200 }});
169174 // QA plots: Pion tracks in selected events
175+ histosQA.add (" Tracks/pions/isPVcontributor" , " dcaXY; dcaXY [cm]; Counts" , kTH1F , {{3 , 0 , 3 }});
170176 histosQA.add (" Tracks/pions/dcaXY" , " dcaXY; dcaXY [cm]; Counts" , kTH1F , {{2000 , -0.1 , 0.1 }});
171177 histosQA.add (" Tracks/pions/dcaZ" , " dcaZ; dcaZ [cm]; Counts" , kTH1F , {{2000 , -0.1 , 0.1 }});
172178 histosQA.add (" Tracks/pions/itsChi2NCl" , " ITS Chi2/NCl; Chi2/NCl; Counts" , kTH1F , {{250 , 0 , 50 }});
173179 histosQA.add (" Tracks/pions/itsChi2" , " ITS Chi2; ITS Chi2; Counts" , kTH1F , {{500 , 0 , 50 }});
174180 histosQA.add (" Tracks/pions/tpcChi2NCl" , " TPC Chi2/NCl; Chi2/NCl; Counts" , kTH1F , {{250 , 0 , 50 }});
175181 histosQA.add (" Tracks/pions/tpcNClsCrossedRows" , " TPC N Cls Findable; N Cls Findable; Counts" , kTH1F , {{200 , 0 , 200 }});
176182 // QA plots: Pion tracks from 4pi in selected events
183+ histosQA.add (" Tracks/pions-from-4pi/isPVcontributor" , " dcaXY; dcaXY [cm]; Counts" , kTH1F , {{3 , 0 , 3 }});
177184 histosQA.add (" Tracks/pions-from-4pi/dcaXY" , " dcaXY; dcaXY [cm]; Counts" , kTH1F , {{2000 , -0.1 , 0.1 }});
178185 histosQA.add (" Tracks/pions-from-4pi/dcaZ" , " dcaZ; dcaZ [cm]; Counts" , kTH1F , {{2000 , -0.1 , 0.1 }});
179186 histosQA.add (" Tracks/pions-from-4pi/itsChi2NCl" , " ITS Chi2/NCl; Chi2/NCl; Counts" , kTH1F , {{250 , 0 , 50 }});
@@ -266,10 +273,8 @@ struct ExclusiveRhoTo4Pi {
266273 Filter zdcCuts = (o2::aod::udzdc::energyCommonZNA <= zdcCut) && (o2::aod::udzdc::energyCommonZNC <= zdcCut);
267274 Filter bcSelectionCuts = (o2::aod::udcollision::sbp == sbpCut) && (o2::aod::udcollision::itsROFb == itsROFbCut) && (o2::aod::udcollision::vtxITSTPC == vtxITSTPCcut) && (o2::aod::udcollision::tfb == tfbCut);
268275 // Track Cuts
269- Filter onlyPVtracks = o2::aod::udtrack::isPVContributor == useOnlyPVtracks;
270276 Filter tpcchi2nclsFilter = o2::aod::track::tpcChi2NCl <= tpcChi2NClsCut;
271277 Filter itschi2nclsFilter = o2::aod::track::itsChi2NCl <= itsChi2NClsCut;
272- Filter tpcCuts = (nabs(o2::aod::pidtpc::tpcNSigmaPi) <= nSigmaTPCcut);
273278 // ---------------------------------------------------------------------------------------------------------------------------------------------
274279
275280 using UDtracks = soa::Join<aod::UDTracks, aod::UDTracksPID, aod::UDTracksExtra, aod::UDTracksFlags, aod::UDTracksDCA>;
@@ -313,6 +318,7 @@ struct ExclusiveRhoTo4Pi {
313318 PxPyPzMVector tVector (t0.px (), t0.py (), t0.pz (), o2::constants::physics::MassPionCharged);
314319
315320 // QA-Tracks before selection
321+ histosQA.fill (HIST (" Tracks/all/isPVcontributor" ), t0.isPVContributor ());
316322 histosQA.fill (HIST (" Tracks/all/dcaXY" ), t0.dcaXY ());
317323 histosQA.fill (HIST (" Tracks/all/dcaZ" ), t0.dcaZ ());
318324 histosQA.fill (HIST (" Tracks/all/itsChi2NCl" ), t0.itsChi2NCl ());
@@ -343,6 +349,7 @@ struct ExclusiveRhoTo4Pi {
343349 }
344350
345351 // QA-Tracks after selection
352+ histosQA.fill (HIST (" Tracks/selected/isPVcontributor" ), t0.isPVContributor ());
346353 histosQA.fill (HIST (" Tracks/selected/dcaXY" ), t0.dcaXY ());
347354 histosQA.fill (HIST (" Tracks/selected/dcaZ" ), t0.dcaZ ());
348355 histosQA.fill (HIST (" Tracks/selected/itsChi2NCl" ), t0.itsChi2NCl ());
@@ -367,11 +374,12 @@ struct ExclusiveRhoTo4Pi {
367374 // Kinematics for all particles after track selection before selecting pions
368375 histosKin.fill (HIST (" selected" ), tVector.Pt (), tVector.Eta (), tVector.Phi ());
369376
370- if (ifPion (t0, useTOF, nSigmaTPCcut, nSigmaTOFcut)) {
377+ if (ifPion (t0, useTOF, nSigmaTPCcut, nSigmaTOFcut, ifCircularNSigmaCut )) {
371378
372379 selectedPionTracks.push_back (t0);
373380
374381 // QA-Tracks after selecting pions
382+ histosQA.fill (HIST (" Tracks/pions/isPVcontributor" ), t0.isPVContributor ());
375383 histosQA.fill (HIST (" Tracks/pions/dcaXY" ), t0.dcaXY ());
376384 histosQA.fill (HIST (" Tracks/pions/dcaZ" ), t0.dcaZ ());
377385 histosQA.fill (HIST (" Tracks/pions/itsChi2NCl" ), t0.itsChi2NCl ());
@@ -440,6 +448,7 @@ struct ExclusiveRhoTo4Pi {
440448 for (int i = 0 ; i < four; i++) {
441449 PxPyPzMVector tVector (selectedPionTracks[i].px (), selectedPionTracks[i].py (), selectedPionTracks[i].pz (), o2::constants::physics::MassPionCharged);
442450 // Tracks QA for all four pions
451+ histosQA.fill (HIST (" Tracks/pions-from-4pi/isPVcontributor" ), selectedPionTracks[i].isPVContributor ());
443452 histosQA.fill (HIST (" Tracks/pions-from-4pi/dcaXY" ), selectedPionTracks[i].dcaXY ());
444453 histosQA.fill (HIST (" Tracks/pions-from-4pi/dcaZ" ), selectedPionTracks[i].dcaZ ());
445454 histosQA.fill (HIST (" Tracks/pions-from-4pi/itsChi2NCl" ), selectedPionTracks[i].itsChi2NCl ());
@@ -667,7 +676,7 @@ struct ExclusiveRhoTo4Pi {
667676 histosDataCounter.fill (HIST (" TracksCounts_vs_runNo" ), runIndex, 9 );
668677
669678 // Selection PID Pion
670- if (ifPion (track, useTOF, nSigmaTPCcut, nSigmaTOFcut)) {
679+ if (ifPion (track, useTOF, nSigmaTPCcut, nSigmaTOFcut, ifCircularNSigmaCut )) {
671680 continue ;
672681 }
673682 histosDataCounter.fill (HIST (" TracksCounts_vs_runNo" ), runIndex, 10 );
@@ -751,6 +760,7 @@ struct ExclusiveRhoTo4Pi {
751760 PxPyPzMVector tVector (t0.px (), t0.py (), t0.pz (), o2::constants::physics::MassPionCharged);
752761
753762 // QA-Tracks before selection
763+ histosQA.fill (HIST (" Tracks/all/isPVcontributor" ), t0.isPVContributor ());
754764 histosQA.fill (HIST (" Tracks/all/dcaXY" ), t0.tpcChi2NCl ());
755765 histosQA.fill (HIST (" Tracks/all/dcaZ" ), t0.tpcChi2NCl ());
756766 histosQA.fill (HIST (" Tracks/all/itsChi2NCl" ), t0.itsChi2NCl ());
@@ -784,6 +794,7 @@ struct ExclusiveRhoTo4Pi {
784794 }
785795
786796 // QA-Tracks after selection
797+ histosQA.fill (HIST (" Tracks/selected/isPVcontributor" ), t0.isPVContributor ());
787798 histosQA.fill (HIST (" Tracks/selected/dcaXY" ), t0.dcaXY ());
788799 histosQA.fill (HIST (" Tracks/selected/dcaZ" ), t0.dcaZ ());
789800 histosQA.fill (HIST (" Tracks/selected/itsChi2NCl" ), t0.itsChi2NCl ());
@@ -808,11 +819,12 @@ struct ExclusiveRhoTo4Pi {
808819 // Kinematics for all particles after track selection before selecting pions
809820 histosKin.fill (HIST (" selected" ), tVector.Pt (), tVector.Eta (), tVector.Phi ());
810821
811- if (ifPion (t0, useTOF, nSigmaTPCcut, nSigmaTOFcut)) {
822+ if (ifPion (t0, useTOF, nSigmaTPCcut, nSigmaTOFcut, ifCircularNSigmaCut )) {
812823
813824 selectedPionTracks.push_back (t0);
814825
815826 // QA-Tracks after selecting pions
827+ histosQA.fill (HIST (" Tracks/pions/isPVcontributor" ), t0.isPVContributor ());
816828 histosQA.fill (HIST (" Tracks/pions/dcaXY" ), t0.dcaXY ());
817829 histosQA.fill (HIST (" Tracks/pions/dcaZ" ), t0.dcaZ ());
818830 histosQA.fill (HIST (" Tracks/pions/itsChi2NCl" ), t0.itsChi2NCl ());
@@ -881,6 +893,7 @@ struct ExclusiveRhoTo4Pi {
881893 for (int i = 0 ; i < four; i++) {
882894 PxPyPzMVector tVector (selectedPionTracks[i].px (), selectedPionTracks[i].py (), selectedPionTracks[i].pz (), o2::constants::physics::MassPionCharged);
883895 // Tracks QA for all four pions
896+ histosQA.fill (HIST (" Tracks/pions-from-4pi/isPVcontributor" ), selectedPionTracks[i].isPVContributor ());
884897 histosQA.fill (HIST (" Tracks/pions-from-4pi/dcaXY" ), selectedPionTracks[i].dcaXY ());
885898 histosQA.fill (HIST (" Tracks/pions-from-4pi/dcaZ" ), selectedPionTracks[i].dcaZ ());
886899 histosQA.fill (HIST (" Tracks/pions-from-4pi/itsChi2NCl" ), selectedPionTracks[i].itsChi2NCl ());
@@ -1119,7 +1132,7 @@ struct ExclusiveRhoTo4Pi {
11191132 histosDataCounter.fill (HIST (" TracksCounts_vs_runNo" ), runIndex, 9 );
11201133
11211134 // Selection PID Pion
1122- if (ifPion (track, useTOF, nSigmaTPCcut, nSigmaTOFcut)) {
1135+ if (ifPion (track, useTOF, nSigmaTPCcut, nSigmaTOFcut, ifCircularNSigmaCut )) {
11231136 continue ;
11241137 }
11251138 histosDataCounter.fill (HIST (" TracksCounts_vs_runNo" ), runIndex, 10 );
@@ -1213,7 +1226,7 @@ struct ExclusiveRhoTo4Pi {
12131226 if (ifTPC && !track.hasTPC ()) {
12141227 return false ;
12151228 }
1216- // ITS Chi2 N Clusters cut
1229+ // ITS Chi2 per N Clusters cut
12171230 if (track.hasITS () && track.itsChi2NCl () > itschi2nclscut) {
12181231 return false ;
12191232 }
@@ -1225,26 +1238,43 @@ struct ExclusiveRhoTo4Pi {
12251238 if (track.hasTPC () && track.tpcNClsCrossedRows () < tpcNClsCrossedRowscut) {
12261239 return false ;
12271240 }
1241+ if (useOnlyPVtracks && !track.isPVContributor ()) {
1242+ return false ;
1243+ }
12281244 // All cuts passed
12291245 return true ;
12301246 } // End of Track Selection function
12311247
12321248 template <typename T>
1233- bool ifPion (const T& candidate, bool use_tof, float nsigmatpc_cut, float nsigmatof_cut)
1249+ bool ifPion (const T& candidate, bool use_tof, float nsigmatpc_cut, float nsigmatof_cut, bool ifCircularNSigmaCut )
12341250 {
1251+ if (ifCircularNSigmaCut) {
1252+ if (use_tof && candidate.hasTOF () && (candidate.tofNSigmaPi () * candidate.tofNSigmaPi () + candidate.tpcNSigmaPi () * candidate.tpcNSigmaPi ()) < (nsigmatof_cut * nsigmatof_cut)) {
1253+ return true ;
1254+ }
12351255
1236- if (use_tof && candidate.hasTOF () && (candidate.tofNSigmaPi () * candidate. tofNSigmaPi () + candidate. tpcNSigmaPi () * candidate. tpcNSigmaPi ()) < (nsigmatof_cut * nsigmatof_cut) ) {
1237- return true ;
1238- }
1256+ if (use_tof && ! candidate.hasTOF () && std::abs (candidate.tpcNSigmaPi ()) < nsigmatpc_cut ) {
1257+ return true ;
1258+ }
12391259
1240- if (use_tof && !candidate.hasTOF () && std::abs (candidate.tpcNSigmaPi ()) < nsigmatpc_cut) {
1241- return true ;
1242- }
1260+ if (!use_tof && std::abs (candidate.tpcNSigmaPi ()) < nsigmatpc_cut) {
1261+ return true ;
1262+ }
1263+ return false ;
1264+ } else {
1265+ if (use_tof && candidate.hasTOF () && (std::abs (candidate.tofNSigmaPi ()) < nsigmatpc_cut) && (std::abs (candidate.tpcNSigmaPi ()) < nsigmatpc_cut)) {
1266+ return true ;
1267+ }
12431268
1244- if (!use_tof && std::abs (candidate.tpcNSigmaPi ()) < nsigmatpc_cut) {
1245- return true ;
1269+ if (use_tof && !candidate.hasTOF () && std::abs (candidate.tpcNSigmaPi ()) < nsigmatpc_cut) {
1270+ return true ;
1271+ }
1272+
1273+ if (!use_tof && std::abs (candidate.tpcNSigmaPi ()) < nsigmatpc_cut) {
1274+ return true ;
1275+ }
1276+ return false ;
12461277 }
1247- return false ;
12481278 }
12491279
12501280 int getRunNumberIndex (int runNumber)
0 commit comments