]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/RESONANCES/AliRsnCutProton2010PP.h
Added AliRsnAction, fix for AliRsnPIDRange, lego_train macros updated
[u/mrichter/AliRoot.git] / PWGLF / RESONANCES / AliRsnCutProton2010PP.h
1 #ifndef ALIRSNCUTPROTON2010PP_H
2 #define ALIRSNCUTPROTON2010PP_H
3
4 //
5 // All cuts for single Protons in phi analysis 2010,
6 // based on quality and PID using the TPC and TOF
7 // detectors, using default definitions for both
8 // kinds of cuts, for ESD and AOD
9 // Author: Serguey Kiselev
10 //
11
12 #include "AliVTrack.h"
13 #include "AliRsnCut.h"
14 #include "AliRsnCutTrackQuality.h"
15
16 class AliRsnCutProton2010PP : public AliRsnCut {
17
18 public:
19
20    AliRsnCutProton2010PP(const char *name = "");
21    virtual ~AliRsnCutProton2010PP() { }
22
23    virtual Bool_t IsSelected(TObject *obj);
24
25    AliRsnCutTrackQuality *CutQuality() {return &fCutQuality;}
26
27 private:
28
29    Bool_t MatchTOF(const AliVTrack *vtrack);
30
31    AliRsnCutTrackQuality fCutQuality;  // track quality cut
32
33    ClassDef(AliRsnCutProton2010PP,1)
34
35 };
36
37 //__________________________________________________________________________________________________
38 inline Bool_t AliRsnCutProton2010PP::MatchTOF(const AliVTrack *vtrack)
39 {
40 //
41 // Checks if the track has matched the TOF detector
42 //
43
44    if (!vtrack) {
45       AliWarning("NULL argument: impossible to check status");
46       return kFALSE;
47    }
48
49    Bool_t isTOFout = ((vtrack->GetStatus() & AliESDtrack::kTOFout) != 0);
50    Bool_t isTIME   = ((vtrack->GetStatus() & AliESDtrack::kTIME) != 0);
51
52    return (isTOFout && isTIME);
53 }
54
55 #endif