ROOT logo
///////////////////////////////////////////////////////////////////////////
//                                                                       //
// AliFemtoESDTrackCut: A basic track cut that used information from     //
// ALICE ESD to accept or reject the track.                             ////////////////////////////////////////////////
#include "AliESDtrackCuts.h"

#ifndef ALIFEMTOESDTRACKCUT_H
#define ALIFEMTOESDTRACKCUT_H

//#ifndef StMaker_H
//#include "StMaker.h"
//#endif

#include "AliESDtrackCuts.h" //for enum with ITS layers
#include "AliFemtoTrackCut.h"


class AliFemtoESDTrackCut : public AliFemtoTrackCut
{
  public:

  enum PIDMethodType {knSigma=0, kContour=1};
  typedef enum PIDMethodType ReadPIDMethodType;

  AliFemtoESDTrackCut();
  virtual ~AliFemtoESDTrackCut();

  virtual bool Pass(const AliFemtoTrack* aTrack);

  virtual AliFemtoString Report();
  virtual TList *ListSettings();
  virtual AliFemtoParticleType Type(){return hbtTrack;}

  void SetPt(const float& lo, const float& hi);
  void SetRapidity(const float& lo, const float& hi);
  void SetEta(const float& lo, const float& hi);
  void SetCharge(const int& ch);
  void SetPidProbElectron(const float& lo, const float& hi);
  void SetPidProbPion(const float& lo, const float& hi);
  void SetPidProbKaon(const float& lo, const float& hi);
  void SetPidProbProton(const float& lo, const float& hi);
  void SetPidProbMuon(const float& lo, const float& hi);
  void SetLabel(const bool& flag);
  void SetStatus(const long& w);
  void SetminTPCclsF(const short& s);
  void SetminTPCncls(const short& s);
  void SetminITScls(const int& s);
  void SetRemoveKinks(const bool& flag);
  void SetRemoveITSFake(const bool& flag);
  void SetMaxITSChiNdof(const float& maxchi);
  void SetMaxTPCChiNdof(const float& maxchi);
  void SetMaxSigmaToVertex(const float& maxsig);
  void SetMaxImpactXY(const float& maximpxy);
  void SetMinImpactXY(const float& minimpxy);
  void SetMaxImpactZ(const float& maximpz);
  void SetMaxImpactXYPtDep(const float& maxoff, const float& maxnrm, const float& maxpow);
  void SetMostProbablePion();
  void SetMostProbableKaon();
  void SetMostProbableProton();
  void SetLeastProbableProton();
  void SetNoMostProbable();
  void SetMostProbable(const int& num);
  void SetPIDMethod(ReadPIDMethodType newMethod);
  void SetNsigmaTPCTOF(Bool_t);
  void SetNsigmaTPConly(Bool_t);
  void SetNsigma(Double_t);
  void SetClusterRequirementITS(AliESDtrackCuts::Detector det, AliESDtrackCuts::ITSClusterRequirement req = AliESDtrackCuts::kOff);

  void SetMomRangeTOFpidIs(const float& minp, const float& maxp);
  void SetMomRangeTPCpidIs(const float& minp, const float& maxp);
  void SetMomRangeITSpidIs(const float& minp, const float& maxp);
  void SetElectronRejection(Bool_t);

 private:   // here are the quantities I want to cut on...

  int               fCharge;             // particle charge
  float             fPt[2];              // bounds for transverse momentum
  float             fRapidity[2];        // bounds for rapidity
  float             fEta[2];             // bounds for pseudorapidity
  float             fPidProbElectron[2]; // bounds for electron probability
  float             fPidProbPion[2];     // bounds for pion probability
  float             fPidProbKaon[2];     // bounds for kaon probability
  float             fPidProbProton[2];   // bounds for proton probability
  float             fPidProbMuon[2];     // bounds for muon probability

  AliESDtrackCuts::ITSClusterRequirement fCutClusterRequirementITS[3];  // detailed ITS cluster requirements for (SPD, SDD, SSD) - from AliESDtrackcuts!
  bool              fLabel;              // if true label<0 will not pass throught
  long              fStatus;             // staus flag
  ReadPIDMethodType fPIDMethod;          // which PID mehod to use. 0 - nsgima, 1 - contour
  Bool_t            fNsigmaTPCTOF;       // true if squared nsigma from TPC and TOF, false if separately from TPC and TOF
  Bool_t            fNsigmaTPConly;       // true if nsigma from TPC only
  Double_t            fNsigma;       // number of sigmas - 3 by default

  short             fminTPCclsF;         // min number of findable clusters in the TPC
  short             fminTPCncls;         // min number of clusters in the TPC
  int               fminITScls;          // min number of clusters assigned in the ITS
  float             fMaxITSchiNdof;      // maximum allowed chi2/ndof for ITS clusters
  float             fMaxTPCchiNdof;      // maximum allowed chi2/ndof for TPC clusters
  float             fMaxSigmaToVertex;   // maximum allowed sigma to primary vertex
  long              fNTracksPassed;      // passed tracks count
  long              fNTracksFailed;      // failed tracks count
  bool              fRemoveKinks;        // if true particles with any kink label will not pass
  bool              fRemoveITSFake;      // if true particles with ITS fake flag will not pass
  int               fMostProbable;       // this particle type is required to be most probable

  float             fMaxImpactXY;        // Max XY impact parameter
  float             fMinImpactXY;        // Max XY impact parameter
  float             fMaxImpactZ;         // Max Z impact parameter

  float             fMaxImpactXYPtOff;   // Max XY DCA Pt dependent offset
  float             fMaxImpactXYPtNrm;   // Max XY DCA Pt dependent normalization
  float             fMaxImpactXYPtPow;   // Max XY DCA Pt dependent power

  float             fMinPforTOFpid;  // momentum from which TOF PID is requested
  float             fMaxPforTOFpid;  // momentum till which TOF PID is requested
  float             fMinPforTPCpid;  // momentum from which TPC PID is requested
  float             fMaxPforTPCpid;  // momentum till which TPC PID is requested
  float             fMinPforITSpid;  // momentum from which ITS PID is requested
  float             fMaxPforITSpid;  // momentum till which ITS PID is requested
  bool fElectronRejection;

  float PidFractionElectron(float mom) const;
  float PidFractionPion(float mom) const;
  float PidFractionKaon(float mom) const;
  float PidFractionProton(float mom) const;

  bool IsPionTPCdEdx(float mom, float dEdx);
  bool IsKaonTPCdEdx(float mom, float dEdx);
  bool IsProtonTPCdEdx(float mom, float dEdx);

  bool IsPionTOFTime(float mom, float ttof);
  bool IsKaonTOFTime(float mom, float ttof);
  bool IsProtonTOFTime(float mom, float ttof);

  bool IsKaonTPCdEdxNSigma(float mom, float nsigma);
  bool IsKaonTOFNSigma(float mom, float nsigma);
  bool IsKaonNSigma(float mom, float nsigmaTPC, float nsigmaTOF);
  bool IsPionNSigma(float mom, float nsigmaTPC, float nsigmaTOF);
  bool IsProtonNSigma(float mom, float nsigmaTPC, float nsigmaTOF);
  bool IsElectron(float nsigmaTPCE, float nsigmaTPCPi,float nsigmaTPCK, float nsigmaTPCP);

  Bool_t CheckITSClusterRequirement(AliESDtrackCuts::ITSClusterRequirement req, Bool_t clusterL1, Bool_t clusterL2); //the same as in AliESDtrackCuts


#ifdef __ROOT__
  ClassDef(AliFemtoESDTrackCut, 1)
#endif
    };


inline void AliFemtoESDTrackCut::SetPt(const float& lo, const float& hi){fPt[0]=lo; fPt[1]=hi;}
inline void AliFemtoESDTrackCut::SetRapidity(const float& lo,const float& hi){fRapidity[0]=lo; fRapidity[1]=hi;}
inline void AliFemtoESDTrackCut::SetEta(const float& lo,const float& hi){fEta[0]=lo; fEta[1]=hi;}
inline void AliFemtoESDTrackCut::SetCharge(const int& ch){fCharge = ch;}
inline void AliFemtoESDTrackCut::SetPidProbElectron(const float& lo,const float& hi){fPidProbElectron[0]=lo; fPidProbElectron[1]=hi;}
inline void AliFemtoESDTrackCut::SetPidProbPion(const float& lo,const float& hi){fPidProbPion[0]=lo; fPidProbPion[1]=hi;}
inline void AliFemtoESDTrackCut::SetPidProbKaon(const float& lo,const float& hi){fPidProbKaon[0]=lo; fPidProbKaon[1]=hi;}
inline void AliFemtoESDTrackCut::SetPidProbProton
(const float& lo,const float& hi){fPidProbProton[0]=lo; fPidProbProton[1]=hi;}
inline void AliFemtoESDTrackCut::SetPidProbMuon(const float& lo,const float& hi){fPidProbMuon[0]=lo; fPidProbMuon[1]=hi;}
inline void AliFemtoESDTrackCut::SetLabel(const bool& flag){fLabel=flag;}
inline void AliFemtoESDTrackCut::SetStatus(const long& status){fStatus=status;}
inline void AliFemtoESDTrackCut::SetminTPCclsF(const short& minTPCclsF){fminTPCclsF=minTPCclsF;}
inline void AliFemtoESDTrackCut::SetminTPCncls(const short& s){fminTPCncls=s;}
inline void AliFemtoESDTrackCut::SetminITScls(const int& minITScls){fminITScls=minITScls;}
inline void AliFemtoESDTrackCut::SetMostProbablePion() { fMostProbable = 2; }
inline void AliFemtoESDTrackCut::SetMostProbableKaon() { fMostProbable = 3; }
inline void AliFemtoESDTrackCut::SetMostProbableProton() { fMostProbable = 4; }
inline void AliFemtoESDTrackCut::SetLeastProbableProton() { fMostProbable = 5; }
inline void AliFemtoESDTrackCut::SetNoMostProbable() { fMostProbable = 0; }
inline void AliFemtoESDTrackCut::SetMostProbable(const int& num) {  fMostProbable =  num; }
inline void AliFemtoESDTrackCut::SetMaxITSChiNdof(const float& maxchi) { fMaxITSchiNdof = maxchi; }
inline void AliFemtoESDTrackCut::SetMaxTPCChiNdof(const float& maxchi) { fMaxTPCchiNdof = maxchi; }
inline void AliFemtoESDTrackCut::SetMaxSigmaToVertex(const float& maxsig) { fMaxSigmaToVertex = maxsig; }
inline void AliFemtoESDTrackCut::SetMaxImpactXY(const float& maximpxy) { fMaxImpactXY = maximpxy; }
inline void AliFemtoESDTrackCut::SetMinImpactXY(const float& minimpxy) { fMinImpactXY = minimpxy; }
inline void AliFemtoESDTrackCut::SetMaxImpactXYPtDep(const float& maxoff, const float& maxnrm, const float& maxpow) { fMaxImpactXYPtOff = maxoff; fMaxImpactXYPtNrm = maxnrm; fMaxImpactXYPtPow = maxpow; }
inline void AliFemtoESDTrackCut::SetMaxImpactZ(const float& maximpz) { fMaxImpactZ = maximpz; }
inline void AliFemtoESDTrackCut::SetElectronRejection(Bool_t setE) { fElectronRejection = setE; }

#endif
 AliFemtoESDTrackCut.h:1
 AliFemtoESDTrackCut.h:2
 AliFemtoESDTrackCut.h:3
 AliFemtoESDTrackCut.h:4
 AliFemtoESDTrackCut.h:5
 AliFemtoESDTrackCut.h:6
 AliFemtoESDTrackCut.h:7
 AliFemtoESDTrackCut.h:8
 AliFemtoESDTrackCut.h:9
 AliFemtoESDTrackCut.h:10
 AliFemtoESDTrackCut.h:11
 AliFemtoESDTrackCut.h:12
 AliFemtoESDTrackCut.h:13
 AliFemtoESDTrackCut.h:14
 AliFemtoESDTrackCut.h:15
 AliFemtoESDTrackCut.h:16
 AliFemtoESDTrackCut.h:17
 AliFemtoESDTrackCut.h:18
 AliFemtoESDTrackCut.h:19
 AliFemtoESDTrackCut.h:20
 AliFemtoESDTrackCut.h:21
 AliFemtoESDTrackCut.h:22
 AliFemtoESDTrackCut.h:23
 AliFemtoESDTrackCut.h:24
 AliFemtoESDTrackCut.h:25
 AliFemtoESDTrackCut.h:26
 AliFemtoESDTrackCut.h:27
 AliFemtoESDTrackCut.h:28
 AliFemtoESDTrackCut.h:29
 AliFemtoESDTrackCut.h:30
 AliFemtoESDTrackCut.h:31
 AliFemtoESDTrackCut.h:32
 AliFemtoESDTrackCut.h:33
 AliFemtoESDTrackCut.h:34
 AliFemtoESDTrackCut.h:35
 AliFemtoESDTrackCut.h:36
 AliFemtoESDTrackCut.h:37
 AliFemtoESDTrackCut.h:38
 AliFemtoESDTrackCut.h:39
 AliFemtoESDTrackCut.h:40
 AliFemtoESDTrackCut.h:41
 AliFemtoESDTrackCut.h:42
 AliFemtoESDTrackCut.h:43
 AliFemtoESDTrackCut.h:44
 AliFemtoESDTrackCut.h:45
 AliFemtoESDTrackCut.h:46
 AliFemtoESDTrackCut.h:47
 AliFemtoESDTrackCut.h:48
 AliFemtoESDTrackCut.h:49
 AliFemtoESDTrackCut.h:50
 AliFemtoESDTrackCut.h:51
 AliFemtoESDTrackCut.h:52
 AliFemtoESDTrackCut.h:53
 AliFemtoESDTrackCut.h:54
 AliFemtoESDTrackCut.h:55
 AliFemtoESDTrackCut.h:56
 AliFemtoESDTrackCut.h:57
 AliFemtoESDTrackCut.h:58
 AliFemtoESDTrackCut.h:59
 AliFemtoESDTrackCut.h:60
 AliFemtoESDTrackCut.h:61
 AliFemtoESDTrackCut.h:62
 AliFemtoESDTrackCut.h:63
 AliFemtoESDTrackCut.h:64
 AliFemtoESDTrackCut.h:65
 AliFemtoESDTrackCut.h:66
 AliFemtoESDTrackCut.h:67
 AliFemtoESDTrackCut.h:68
 AliFemtoESDTrackCut.h:69
 AliFemtoESDTrackCut.h:70
 AliFemtoESDTrackCut.h:71
 AliFemtoESDTrackCut.h:72
 AliFemtoESDTrackCut.h:73
 AliFemtoESDTrackCut.h:74
 AliFemtoESDTrackCut.h:75
 AliFemtoESDTrackCut.h:76
 AliFemtoESDTrackCut.h:77
 AliFemtoESDTrackCut.h:78
 AliFemtoESDTrackCut.h:79
 AliFemtoESDTrackCut.h:80
 AliFemtoESDTrackCut.h:81
 AliFemtoESDTrackCut.h:82
 AliFemtoESDTrackCut.h:83
 AliFemtoESDTrackCut.h:84
 AliFemtoESDTrackCut.h:85
 AliFemtoESDTrackCut.h:86
 AliFemtoESDTrackCut.h:87
 AliFemtoESDTrackCut.h:88
 AliFemtoESDTrackCut.h:89
 AliFemtoESDTrackCut.h:90
 AliFemtoESDTrackCut.h:91
 AliFemtoESDTrackCut.h:92
 AliFemtoESDTrackCut.h:93
 AliFemtoESDTrackCut.h:94
 AliFemtoESDTrackCut.h:95
 AliFemtoESDTrackCut.h:96
 AliFemtoESDTrackCut.h:97
 AliFemtoESDTrackCut.h:98
 AliFemtoESDTrackCut.h:99
 AliFemtoESDTrackCut.h:100
 AliFemtoESDTrackCut.h:101
 AliFemtoESDTrackCut.h:102
 AliFemtoESDTrackCut.h:103
 AliFemtoESDTrackCut.h:104
 AliFemtoESDTrackCut.h:105
 AliFemtoESDTrackCut.h:106
 AliFemtoESDTrackCut.h:107
 AliFemtoESDTrackCut.h:108
 AliFemtoESDTrackCut.h:109
 AliFemtoESDTrackCut.h:110
 AliFemtoESDTrackCut.h:111
 AliFemtoESDTrackCut.h:112
 AliFemtoESDTrackCut.h:113
 AliFemtoESDTrackCut.h:114
 AliFemtoESDTrackCut.h:115
 AliFemtoESDTrackCut.h:116
 AliFemtoESDTrackCut.h:117
 AliFemtoESDTrackCut.h:118
 AliFemtoESDTrackCut.h:119
 AliFemtoESDTrackCut.h:120
 AliFemtoESDTrackCut.h:121
 AliFemtoESDTrackCut.h:122
 AliFemtoESDTrackCut.h:123
 AliFemtoESDTrackCut.h:124
 AliFemtoESDTrackCut.h:125
 AliFemtoESDTrackCut.h:126
 AliFemtoESDTrackCut.h:127
 AliFemtoESDTrackCut.h:128
 AliFemtoESDTrackCut.h:129
 AliFemtoESDTrackCut.h:130
 AliFemtoESDTrackCut.h:131
 AliFemtoESDTrackCut.h:132
 AliFemtoESDTrackCut.h:133
 AliFemtoESDTrackCut.h:134
 AliFemtoESDTrackCut.h:135
 AliFemtoESDTrackCut.h:136
 AliFemtoESDTrackCut.h:137
 AliFemtoESDTrackCut.h:138
 AliFemtoESDTrackCut.h:139
 AliFemtoESDTrackCut.h:140
 AliFemtoESDTrackCut.h:141
 AliFemtoESDTrackCut.h:142
 AliFemtoESDTrackCut.h:143
 AliFemtoESDTrackCut.h:144
 AliFemtoESDTrackCut.h:145
 AliFemtoESDTrackCut.h:146
 AliFemtoESDTrackCut.h:147
 AliFemtoESDTrackCut.h:148
 AliFemtoESDTrackCut.h:149
 AliFemtoESDTrackCut.h:150
 AliFemtoESDTrackCut.h:151
 AliFemtoESDTrackCut.h:152
 AliFemtoESDTrackCut.h:153
 AliFemtoESDTrackCut.h:154
 AliFemtoESDTrackCut.h:155
 AliFemtoESDTrackCut.h:156
 AliFemtoESDTrackCut.h:157
 AliFemtoESDTrackCut.h:158
 AliFemtoESDTrackCut.h:159
 AliFemtoESDTrackCut.h:160
 AliFemtoESDTrackCut.h:161
 AliFemtoESDTrackCut.h:162
 AliFemtoESDTrackCut.h:163
 AliFemtoESDTrackCut.h:164
 AliFemtoESDTrackCut.h:165
 AliFemtoESDTrackCut.h:166
 AliFemtoESDTrackCut.h:167
 AliFemtoESDTrackCut.h:168
 AliFemtoESDTrackCut.h:169
 AliFemtoESDTrackCut.h:170
 AliFemtoESDTrackCut.h:171
 AliFemtoESDTrackCut.h:172
 AliFemtoESDTrackCut.h:173
 AliFemtoESDTrackCut.h:174
 AliFemtoESDTrackCut.h:175
 AliFemtoESDTrackCut.h:176
 AliFemtoESDTrackCut.h:177
 AliFemtoESDTrackCut.h:178
 AliFemtoESDTrackCut.h:179
 AliFemtoESDTrackCut.h:180
 AliFemtoESDTrackCut.h:181