3232#include < Rtypes.h>
3333
3434#include < algorithm>
35+ #include < array>
3536#include < cmath>
3637#include < cstdint>
3738#include < functional>
@@ -66,14 +67,13 @@ class DielectronCut : public TNamed
6667 kTPCFracSharedClusters ,
6768 kRelDiffPin ,
6869 kTPCChi2NDF ,
69- kDCA3Dsigma ,
70+ kDCAsigma ,
7071 kDCAxy ,
7172 kDCAz ,
7273 kITSNCls ,
7374 kITSChi2NDF ,
7475 kITSClusterSize ,
7576 kTTCA ,
76- kPrefilter ,
7777 kNCuts
7878 };
7979
@@ -144,9 +144,9 @@ class DielectronCut : public TNamed
144144 return false ;
145145 }
146146
147- if (mRequireDiffSides && t1.eta () * t2.eta () > 0.0 ) {
148- return false ;
149- }
147+ // if (mRequireDiffSides && t1.eta() * t2.eta() > 0.0) {
148+ // return false;
149+ // }
150150
151151 if (mApplydEtadPhi && mApplydEtadPhiPosition ) { // applying both cuts is not allowed.
152152 return false ;
@@ -195,7 +195,7 @@ class DielectronCut : public TNamed
195195 if (!IsSelectedTrack (track, DielectronCuts::kTrackPhiPositionRange )) {
196196 return false ;
197197 }
198- if (!IsSelectedTrack (track, DielectronCuts::kDCA3Dsigma )) {
198+ if (!IsSelectedTrack (track, DielectronCuts::kDCAsigma )) {
199199 return false ;
200200 }
201201 if (!IsSelectedTrack (track, DielectronCuts::kDCAxy )) {
@@ -263,9 +263,6 @@ class DielectronCut : public TNamed
263263 return false ;
264264 }
265265 }
266- if (mApplyPF && !IsSelectedTrack (track, DielectronCuts::kPrefilter )) {
267- return false ;
268- }
269266
270267 // PID cuts
271268 if (!PassPID (track)) {
@@ -336,8 +333,6 @@ class DielectronCut : public TNamed
336333 bool is_el_included_TPC = mMinTPCNsigmaEl < track.tpcNSigmaEl () && track.tpcNSigmaEl () < mMaxTPCNsigmaEl ;
337334 bool is_pi_excluded_TPC = (track.tpcInnerParam () > mMinPinForPionRejectionTPC && track.tpcInnerParam () < mMaxPinForPionRejectionTPC ) ? (track.tpcNSigmaPi () < mMinTPCNsigmaPi || mMaxTPCNsigmaPi < track.tpcNSigmaPi ()) : true ;
338335 bool is_el_included_TOF = (mMinTOFNsigmaEl < track.tofNSigmaEl () && track.tofNSigmaEl () < mMaxTOFNsigmaEl ) && (track.hasTOF () && track.tofChi2 () < mMaxChi2TOF );
339- // bool is_ka_excluded_ITS = (mMinP_ITSNsigmaKa < track.p() && track.p() < mMaxP_ITSNsigmaKa) ? (track.itsNSigmaKa() < mMinITSNsigmaKa || mMaxITSNsigmaKa < track.itsNSigmaKa()) : true;
340- // bool is_pr_excluded_ITS = (mMinP_ITSNsigmaPr < track.p() && track.p() < mMaxP_ITSNsigmaPr) ? (track.itsNSigmaPr() < mMinITSNsigmaPr || mMaxITSNsigmaPr < track.itsNSigmaPr()) : true;
341336 return is_el_included_TPC && is_pi_excluded_TPC && is_el_included_TOF;
342337 }
343338
@@ -347,8 +342,6 @@ class DielectronCut : public TNamed
347342 bool is_el_included_TPC = mMinTPCNsigmaEl < track.tpcNSigmaEl () && track.tpcNSigmaEl () < mMaxTPCNsigmaEl ;
348343 bool is_pi_excluded_TPC = track.tpcInnerParam () < mMaxPinForPionRejectionTPC ? (track.tpcNSigmaPi () < mMinTPCNsigmaPi || mMaxTPCNsigmaPi < track.tpcNSigmaPi ()) : true ;
349344 bool is_el_included_TOF = (mMinTOFNsigmaEl < track.tofNSigmaEl () && track.tofNSigmaEl () < mMaxTOFNsigmaEl ) && (track.hasTOF () && track.tofChi2 () < mMaxChi2TOF );
350- // bool is_ka_excluded_ITS = (mMinP_ITSNsigmaKa < track.p() && track.p() < mMaxP_ITSNsigmaKa) ? (track.itsNSigmaKa() < mMinITSNsigmaKa || mMaxITSNsigmaKa < track.itsNSigmaKa()) : true;
351- // bool is_pr_excluded_ITS = (mMinP_ITSNsigmaPr < track.p() && track.p() < mMaxP_ITSNsigmaPr) ? (track.itsNSigmaPr() < mMinITSNsigmaPr || mMaxITSNsigmaPr < track.itsNSigmaPr()) : true;
352345 return is_el_included_TPC && is_pi_excluded_TPC && is_el_included_TOF;
353346 }
354347
@@ -361,17 +354,13 @@ class DielectronCut : public TNamed
361354 bool is_ka_excluded_TPC = track.tpcNSigmaKa () < mMinTPCNsigmaKa || mMaxTPCNsigmaKa < track.tpcNSigmaKa ();
362355 bool is_pr_excluded_TPC = track.tpcNSigmaPr () < mMinTPCNsigmaPr || mMaxTPCNsigmaPr < track.tpcNSigmaPr ();
363356 bool is_el_included_TOF = track.hasTOF () ? (mMinTOFNsigmaEl < track.tofNSigmaEl () && track.tofNSigmaEl () < mMaxTOFNsigmaEl ) : true ;
364- // bool is_ka_excluded_ITS = (mMinP_ITSNsigmaKa < track.p() && track.p() < mMaxP_ITSNsigmaKa) ? (track.itsNSigmaKa() < mMinITSNsigmaKa || mMaxITSNsigmaKa < track.itsNSigmaKa()) : true;
365- // bool is_pr_excluded_ITS = (mMinP_ITSNsigmaPr < track.p() && track.p() < mMaxP_ITSNsigmaPr) ? (track.itsNSigmaPr() < mMinITSNsigmaPr || mMaxITSNsigmaPr < track.itsNSigmaPr()) : true;
366357 return is_el_included_TPC && is_pi_excluded_TPC && is_ka_excluded_TPC && is_pr_excluded_TPC && is_el_included_TOF;
367358 }
368359
369360 template <typename T>
370361 bool PassTPConly (T const & track) const
371362 {
372363 bool is_el_included_TPC = mMinTPCNsigmaEl < track.tpcNSigmaEl () && track.tpcNSigmaEl () < mMaxTPCNsigmaEl ;
373- // bool is_ka_excluded_ITS = (mMinP_ITSNsigmaKa < track.p() && track.p() < mMaxP_ITSNsigmaKa) ? (track.itsNSigmaKa() < mMinITSNsigmaKa || mMaxITSNsigmaKa < track.itsNSigmaKa()) : true;
374- // bool is_pr_excluded_ITS = (mMinP_ITSNsigmaPr < track.p() && track.p() < mMaxP_ITSNsigmaPr) ? (track.itsNSigmaPr() < mMinITSNsigmaPr || mMaxITSNsigmaPr < track.itsNSigmaPr()) : true;
375364 return is_el_included_TPC;
376365 }
377366
@@ -383,8 +372,6 @@ class DielectronCut : public TNamed
383372 bool is_pi_excluded_TPC = track.tpcInnerParam () < mMaxPinForPionRejectionTPC ? (track.tpcNSigmaPi () < mMinTPCNsigmaPi || mMaxTPCNsigmaPi < track.tpcNSigmaPi ()) : true ;
384373 bool is_ka_excluded_TPC = track.tpcNSigmaKa () < mMinTPCNsigmaKa || mMaxTPCNsigmaKa < track.tpcNSigmaKa ();
385374 bool is_pr_excluded_TPC = track.tpcNSigmaPr () < mMinTPCNsigmaPr || mMaxTPCNsigmaPr < track.tpcNSigmaPr ();
386- // bool is_ka_excluded_ITS = (mMinP_ITSNsigmaKa < track.p() && track.p() < mMaxP_ITSNsigmaKa) ? (track.itsNSigmaKa() < mMinITSNsigmaKa || mMaxITSNsigmaKa < track.itsNSigmaKa()) : true;
387- // bool is_pr_excluded_ITS = (mMinP_ITSNsigmaPr < track.p() && track.p() < mMaxP_ITSNsigmaPr) ? (track.itsNSigmaPr() < mMinITSNsigmaPr || mMaxITSNsigmaPr < track.itsNSigmaPr()) : true;
388375 return is_el_included_TPC && is_pi_excluded_TPC && is_ka_excluded_TPC && is_pr_excluded_TPC;
389376 }
390377
@@ -394,8 +381,6 @@ class DielectronCut : public TNamed
394381 bool is_el_included_TPC = mMinTPCNsigmaEl < track.tpcNSigmaEl () && track.tpcNSigmaEl () < mMaxTPCNsigmaEl ;
395382 bool is_pi_excluded_TPC = track.tpcInnerParam () < mMaxPinForPionRejectionTPC ? (track.tpcNSigmaPi () < mMinTPCNsigmaPi || mMaxTPCNsigmaPi < track.tpcNSigmaPi ()) : true ;
396383 bool is_el_included_TOF = track.hasTOF () ? (mMinTOFNsigmaEl < track.tofNSigmaEl () && track.tofNSigmaEl () < mMaxTOFNsigmaEl ) : true ;
397- // bool is_ka_excluded_ITS = (mMinP_ITSNsigmaKa < track.p() && track.p() < mMaxP_ITSNsigmaKa) ? (track.itsNSigmaKa() < mMinITSNsigmaKa || mMaxITSNsigmaKa < track.itsNSigmaKa()) : true;
398- // bool is_pr_excluded_ITS = (mMinP_ITSNsigmaPr < track.p() && track.p() < mMaxP_ITSNsigmaPr) ? (track.itsNSigmaPr() < mMinITSNsigmaPr || mMaxITSNsigmaPr < track.itsNSigmaPr()) : true;
399384 return is_el_included_TPC && is_pi_excluded_TPC && is_el_included_TOF;
400385 }
401386
@@ -462,8 +447,8 @@ class DielectronCut : public TNamed
462447 case DielectronCuts::kTPCChi2NDF :
463448 return mMinChi2PerClusterTPC < track.tpcChi2NCl () && track.tpcChi2NCl () < mMaxChi2PerClusterTPC ;
464449
465- case DielectronCuts::kDCA3Dsigma :
466- return mMinDca3D < o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma (track) && o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma (track) < mMaxDca3D ; // in sigma for single leg
450+ case DielectronCuts::kDCAsigma :
451+ return std::array< float , 3 >{ std::fabs ( o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma (track)), std::fabs ( o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma (track)), std::fabs ( o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma (track))}[ mDCAType ] < mMaxDcaSigma ;
467452
468453 case DielectronCuts::kDCAxy :
469454 return std::fabs (track.dcaXY ()) < ((mMaxDcaXYPtDep ) ? mMaxDcaXYPtDep (track.pt ()) : mMaxDcaXY );
@@ -483,9 +468,6 @@ class DielectronCut : public TNamed
483468 case DielectronCuts::kTTCA :
484469 return mEnableTTCA ? true : track.isAssociatedToMPC ();
485470
486- case DielectronCuts::kPrefilter :
487- return track.pfb () <= 0 ;
488-
489471 default :
490472 return false ;
491473 }
@@ -500,7 +482,7 @@ class DielectronCut : public TNamed
500482 void SetMaxMeePhiVDep (std::function<float (float )> phivDepCut, float min_phiv, float max_phiv);
501483 void SelectPhotonConversion (bool flag);
502484 void SetMindEtadPhi (bool applydEtadPhi, bool applydEtadPhiPosition, float min_deta, float min_dphi);
503- void SetRequireDifferentSides (bool flag);
485+ // void SetRequireDifferentSides(bool flag);
504486
505487 void SetTrackPtRange (float minPt = 0 .f, float maxPt = 1e10f);
506488 void SetTrackEtaRange (float minEta = -1e10f, float maxEta = 1e10f);
@@ -537,18 +519,14 @@ class DielectronCut : public TNamed
537519 // void SetITSNsigmaKaRange(float min, float max);
538520 // void SetITSNsigmaPrRange(float min, float max);
539521
540- // void SetPRangeForITSNsigmaKa(float min, float max);
541- // void SetPRangeForITSNsigmaPr(float min, float max);
542-
543522 void SetPinRangeForPionRejectionTPC (float min, float max);
544523 void RequireITSibAny (bool flag);
545524 void RequireITSib1st (bool flag);
546525
547- void SetTrackDca3DRange (float min, float max ); // in sigma
548- void SetTrackMaxDcaXY (float maxDcaXY); // in cm
549- void SetTrackMaxDcaZ (float maxDcaZ); // in cm
526+ void SetTrackMaxDcaSigma (float max, uint dcaType ); // in sigma
527+ void SetTrackMaxDcaXY (float maxDcaXY); // in cm
528+ void SetTrackMaxDcaZ (float maxDcaZ); // in cm
550529 void SetTrackMaxDcaXYPtDep (std::function<float (float )> ptDepCut);
551- void ApplyPrefilter (bool flag);
552530 void ApplyPhiV (bool flag);
553531 void IncludeITSsa (bool flag, float maxpt);
554532 void EnableTTCA (bool flag);
@@ -589,7 +567,7 @@ class DielectronCut : public TNamed
589567 float mMinDeltaEta {0 .f };
590568 float mMinDeltaPhi {0 .f };
591569 float mMinOpAng {0 .f }, mMaxOpAng {1e10f};
592- bool mRequireDiffSides {false }; // flag to require 2 tracks to be from different sides. (A-C combination). If one wants 2 tracks to be in the same side (A-A or C-C), one can simply use track eta cut.
570+ // bool mRequireDiffSides{false}; // flag to require 2 tracks to be from different sides. (A-C combination). If one wants 2 tracks to be in the same side (A-A or C-C), one can simply use track eta cut.
593571
594572 // kinematic cuts
595573 float mMinTrackPt {0 .f }, mMaxTrackPt {1e10f}; // range in pT
@@ -614,15 +592,13 @@ class DielectronCut : public TNamed
614592 bool mRequireITSib1st {false };
615593 float mMinChi2TOF {-1e10f}, mMaxChi2TOF {1e10f}; // max tof chi2 per
616594
617- float mMinDca3D { 0 . 0f }; // min dca in 3D in units of sigma
618- float mMaxDca3D {1e+10 }; // max dca in 3D in units of sigma
595+ uint mDCAType { 0 }; // 0:3D, 1:XY, 2:Z, else:3D
596+ float mMaxDcaSigma {1e+10 }; // max dca in units of sigma
619597 float mMaxDcaXY {1 .0f }; // max dca in xy plane
620598 float mMaxDcaZ {1 .0f }; // max dca in z direction
621599 std::function<float (float )> mMaxDcaXYPtDep {}; // max dca in xy plane as function of pT
622600 bool mApplyPhiV {true };
623- bool mApplyPF {false };
624601 float mMinMeanClusterSizeITS {0.0 }, mMaxMeanClusterSizeITS {1e10f}; // <its cluster size> x cos(lmabda)
625- // float mMinP_ITSClusterSize{0.0}, mMaxP_ITSClusterSize{0.0};
626602 bool mIncludeITSsa {false };
627603 float mMaxPtITSsa {1e+10 };
628604
@@ -649,8 +625,6 @@ class DielectronCut : public TNamed
649625 // float mMinITSNsigmaPi{-1e+10}, mMaxITSNsigmaPi{+1e+10};
650626 // float mMinITSNsigmaKa{-1e+10}, mMaxITSNsigmaKa{+1e+10};
651627 // float mMinITSNsigmaPr{-1e+10}, mMaxITSNsigmaPr{+1e+10};
652- // float mMinP_ITSNsigmaKa{0.0}, mMaxP_ITSNsigmaKa{0.0};
653- // float mMinP_ITSNsigmaPr{0.0}, mMaxP_ITSNsigmaPr{0.0};
654628
655629 // o2::analysis::MlResponseDielectronSingleTrack<float>* mPIDMlResponse{nullptr};
656630 std::vector<float > mMLBins {}; // binning for a feature variable. e.g. tpcInnerParam
0 commit comments