]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/RESONANCES/AliRsnCutDaughterD0.h
Added new class for D0 daughter cuts (Massimo)
[u/mrichter/AliRoot.git] / PWGLF / RESONANCES / AliRsnCutDaughterD0.h
1 #ifndef ALIRSNCUTDAUGHTERD0_H
2 #define ALIRSNCUTDAUGHTERD0_H
3
4 //
5 // Cuts for selecting good pion candidates for D0 analysis
6 // with the data samples from pp/PbPb/pPb runs in 2010/2011/2012/2013.
7 // Applies track quality selection plus PID selection,
8 // with different tolerance ranges depending on the momentum.
9 //
10
11 #include "AliVTrack.h"
12 #include "AliRsnCut.h"
13 #include "AliRsnCutTrackQuality.h"
14
15 class AliRsnCutDaughterD0 : public AliRsnCut {
16
17  public:
18
19   AliRsnCutDaughterD0(const char *name = "", AliPID::EParticleType pid = AliPID::kPion);
20   AliRsnCutDaughterD0(const AliRsnCutDaughterD0 &copy);
21   AliRsnCutDaughterD0 &operator=(const AliRsnCutDaughterD0 &copy);
22   virtual ~AliRsnCutDaughterD0() { }
23
24   void           SetNoPID(Bool_t yn = kTRUE)                  {fNoPID = yn;}
25
26   void           SetPID(AliPID::EParticleType type)           {fPID = type;}
27    
28   void           SetTPCPionPIDCut(Double_t value)             {fPionTPCPIDCut = value;}
29   void           SetTPCKaonPIDCut(Double_t value)             {fKaonTPCPIDCut = value;}
30    
31   void           SetTOFPionPIDCut(Double_t value)             {fPionTOFPIDCut = value;}
32   void           SetTOFKaonPIDCut(Double_t value)             {fKaonTOFPIDCut = value;}
33    
34   AliRsnCutTrackQuality *CutQuality()                       {return &fCutQuality;}
35   Bool_t                 MatchTOF(const AliVTrack *vtrack);
36   virtual Bool_t         IsSelected(TObject *obj);
37    
38  private:
39   Bool_t                fNoPID;            // flag to switch off PID check
40   AliPID::EParticleType fPID;              // PID for track
41   AliRsnCutTrackQuality fCutQuality;       // track quality cut 
42
43  protected:
44   Double_t         fPionTPCPIDCut;                // TPC nsigmas for pions
45   Double_t         fKaonTPCPIDCut;                // TPC nsigmas for kaons
46   Double_t         fPionTOFPIDCut;                // TOF nsigmas for pions
47   Double_t         fKaonTOFPIDCut;                // TOF nsigmas for kaons
48
49   ClassDef(AliRsnCutDaughterD0,1)          // cut definitions for D0
50     };
51
52 //__________________________________________________________________________________________________
53 inline Bool_t AliRsnCutDaughterD0::MatchTOF(const AliVTrack *vtrack)
54 {
55   //
56   // Checks if the track has matched the TOF detector
57   //
58
59   if (!vtrack) {
60     AliWarning("NULL argument: impossible to check status");
61     return kFALSE;
62   }
63
64   if (!(vtrack->GetStatus() & AliESDtrack::kTOFout)) return kFALSE;
65   if (!(vtrack->GetStatus() & AliESDtrack::kTIME  )) return kFALSE;
66
67   return kTRUE;
68 }
69
70 #endif