1515
1616#include < CommonConstants/MathConstants.h>
1717#include < Framework/Configurable.h>
18- # include < cmath >
18+
1919#include < array>
20- #include < cstdlib>
2120#include < chrono>
21+ #include < cmath>
22+ #include < cstdlib>
2223// #include <iostream>
2324#include < string>
2425
2526// #include "TLorentzVector.h"
26- #include " TRandom3.h"
27- #include " TF1.h"
28- #include " TVector2.h"
29- #include " Math/Vector3D.h"
30- #include " Math/Vector4D.h"
31- #include " Math/GenVector/Boost.h"
32- #include < TMath.h>
33-
34- #include " Framework/runDataProcessing.h"
35- #include " Framework/AnalysisTask.h"
36- #include " Framework/AnalysisDataModel.h"
37- #include " Framework/HistogramRegistry.h"
38- #include " Framework/StepTHn.h"
39- #include " Framework/O2DatabasePDGPlugin.h"
40- #include " Framework/ASoAHelpers.h"
41- #include " Framework/StaticFor.h"
42-
43- #include " Common/DataModel/PIDResponse.h"
44- #include " Common/DataModel/Multiplicity.h"
27+ #include " Common/Core/TrackSelection.h"
28+ #include " Common/Core/trackUtilities.h"
4529#include " Common/DataModel/Centrality.h"
46- #include " Common/DataModel/TrackSelectionTables.h"
4730#include " Common/DataModel/EventSelection.h"
31+ #include " Common/DataModel/Multiplicity.h"
32+ #include " Common/DataModel/PIDResponse.h"
4833#include " Common/DataModel/Qvectors.h"
34+ #include " Common/DataModel/TrackSelectionTables.h"
4935
50- #include " Common/Core/trackUtilities.h"
51- #include " Common/Core/TrackSelection.h"
52-
36+ #include " CCDB/BasicCCDBManager.h"
37+ #include " CCDB/CcdbApi.h"
5338#include " CommonConstants/PhysicsConstants.h"
54-
55- #include " ReconstructionDataFormats/Track.h"
56-
57- #include " DataFormatsParameters/GRPObject.h"
5839#include " DataFormatsParameters/GRPMagField.h"
40+ #include " DataFormatsParameters/GRPObject.h"
41+ #include " Framework/ASoAHelpers.h"
42+ #include " Framework/AnalysisDataModel.h"
43+ #include " Framework/AnalysisTask.h"
44+ #include " Framework/HistogramRegistry.h"
45+ #include " Framework/O2DatabasePDGPlugin.h"
46+ #include " Framework/StaticFor.h"
47+ #include " Framework/StepTHn.h"
48+ #include " Framework/runDataProcessing.h"
49+ #include " ReconstructionDataFormats/Track.h"
5950
60- #include " CCDB/CcdbApi.h"
61- #include " CCDB/BasicCCDBManager.h"
51+ #include " Math/GenVector/Boost.h"
52+ #include " Math/Vector3D.h"
53+ #include " Math/Vector4D.h"
54+ #include " TF1.h"
55+ #include " TRandom3.h"
56+ #include " TVector2.h"
57+ #include < TMath.h>
6258
6359// from phi
6460#include " Common/DataModel/PIDResponseITS.h"
@@ -132,7 +128,8 @@ struct F0980pbpbanalysis {
132128 Configurable<float > cfgTOFBetaCut{" cfgTOFBetaCut" , 0.0 , " cut TOF beta" };
133129 Configurable<bool > cfgDeepAngleSel{" cfgDeepAngleSel" , true , " Deep Angle cut" };
134130 Configurable<double > cfgDeepAngle{" cfgDeepAngle" , 0.04 , " Deep Angle cut value" };
135- Configurable<bool > cfgTrackIndexSel{" cfgTrackIndexSel" , false , " Index selection flag" };
131+ Configurable<int > cfgTrackIndexSelType{" cfgTrackIndexSelType" , 1 , " Index selection type" };
132+ Configurable<double > cMaxTiednSigmaPion{" cMaxTiednSigmaPion" , 3.0 , " Combined nSigma cut for Pion" };
136133
137134 ConfigurableAxis massAxis{" massAxis" , {400 , 0.2 , 2.2 }, " Invariant mass axis" };
138135 ConfigurableAxis ptAxis{" ptAxis" , {VARIABLE_WIDTH, 0.0 , 0.1 , 0.2 , 0.3 , 0.4 , 0.5 , 0.6 , 0.8 , 1.0 , 1.5 , 2.0 , 2.5 , 3.0 , 3.5 , 4.0 , 4.5 , 5.0 , 6.0 , 7.0 , 8.0 , 10.0 , 13.0 , 20.0 }, " Transverse momentum Binning" };
@@ -174,6 +171,12 @@ struct F0980pbpbanalysis {
174171 PtlKaon = 1 ,
175172 };
176173
174+ enum IndexSelList {
175+ None = 0 ,
176+ woSame = 1 ,
177+ leq = 2
178+ };
179+
177180 TRandom* rn = new TRandom();
178181 // float theta2;
179182
@@ -212,6 +215,7 @@ struct F0980pbpbanalysis {
212215 template <typename TCollision>
213216 bool eventSelected (TCollision collision)
214217 {
218+ constexpr double QvecAmpMin = 1e-4 ;
215219 if (!collision.sel8 ()) {
216220 return 0 ;
217221 }
@@ -234,7 +238,7 @@ struct F0980pbpbanalysis {
234238 if (!collision.selection_bit (aod::evsel::kNoSameBunchPileup )) {
235239 return 0 ;
236240 }
237- if (cfgQvecSel && (collision.qvecAmp ()[detId] < 1e-4 || collision.qvecAmp ()[refAId] < 1e-4 || collision.qvecAmp ()[refBId] < 1e-4 )) {
241+ if (cfgQvecSel && (collision.qvecAmp ()[detId] < QvecAmpMin || collision.qvecAmp ()[refAId] < QvecAmpMin || collision.qvecAmp ()[refBId] < QvecAmpMin )) {
238242 return 0 ;
239243 }
240244 if (cfgOccupancySel && (collision.trackOccupancyInTimeRange () > cfgOccupancyMax || collision.trackOccupancyInTimeRange () < cfgOccupancyMin)) {
@@ -320,12 +324,15 @@ struct F0980pbpbanalysis {
320324 }
321325 }
322326 } else if (cfgSelectPID == PIDList::PIDTest) {
323- if (track.hasTOF ()) {
324- if (std::fabs (getTofNSigma (track)) > cMaxTOFnSigmaPion) {
325- return 0 ;
326- }
327- if (std::fabs (getTpcNSigma (track)) > cMaxTPCnSigmaPion) {
328- return 0 ;
327+ if (cfgUSETOF) {
328+ if (track.hasTOF ()) {
329+ if ((getTpcNSigma (track) * getTpcNSigma (track) + getTofNSigma (track) * getTofNSigma (track)) > (cMaxTiednSigmaPion * cMaxTiednSigmaPion)) {
330+ return 0 ;
331+ }
332+ } else {
333+ if (std::fabs (getTpcNSigma (track)) > cMaxTPCnSigmaPionS) {
334+ return 0 ;
335+ }
329336 }
330337 } else {
331338 if (std::fabs (getTpcNSigma (track)) > cMaxTPCnSigmaPionS) {
@@ -336,6 +343,21 @@ struct F0980pbpbanalysis {
336343 return 1 ;
337344 }
338345
346+ template <typename TrackType1, typename TrackType2>
347+ bool indexSelection (const TrackType1 track1, const TrackType2 track2)
348+ {
349+ if (cfgTrackIndexSelType == IndexSelList::woSame) {
350+ if (track2.globalIndex () == track1.globalIndex ()) {
351+ return 0 ;
352+ }
353+ } else if (cfgTrackIndexSelType == IndexSelList::leq) {
354+ if (track2.globalIndex () <= track1.globalIndex ()) {
355+ return 0 ;
356+ }
357+ }
358+ return 1 ;
359+ }
360+
339361 template <typename TrackType1, typename TrackType2>
340362 bool selectionPair (const TrackType1 track1, const TrackType2 track2)
341363 {
@@ -420,11 +442,11 @@ struct F0980pbpbanalysis {
420442 histos.fill (HIST (" QA/TPC_TOF_selected" ), getTpcNSigma (trk2), getTofNSigma (trk2));
421443 }
422444
423- if (cfgTrackIndexSel && cfgSelectPID == PIDList::PIDTest && trk2. globalIndex () <= trk1. globalIndex ( )) {
445+ if (! indexSelection ( trk1, trk2 )) {
424446 continue ;
425447 }
426448
427- if (cfgSelectPID == PIDList::PIDTest && !selectionPair (trk1, trk2)) {
449+ if (!selectionPair (trk1, trk2)) {
428450 continue ;
429451 }
430452
0 commit comments