9ba71a4b3774425183662263ee9625bc00d85d2d
[u/mrichter/AliRoot.git] / ANALYSIS / AliEventBaseCut.h
1 #ifndef ALIEVENTBASECUT_H
2 #define ALIEVENTBASECUT_H
3 //________________________________
4 ///////////////////////////////////////////////////////////
5 //
6 // class AliEventBaseCut
7 //
8 // Base class for cauts that checks only one event property
9 //
10 // Piotr.Skowronski@cern.ch
11 //
12 ///////////////////////////////////////////////////////////
13
14 #include "TObject.h"
15
16 class AliAOD;
17
18 enum EEventCutProperty
19  {
20    kPrimVertexXCut,
21    kPrimVertexYCut,
22    kPrimVertexZCut,
23    kNChargedCut,
24    kNone
25  };
26
27 class AliEventBaseCut: public TObject
28 {
29   public: 
30     AliEventBaseCut();
31     AliEventBaseCut(Double_t min,Double_t max, EEventCutProperty prop = kNone);
32     virtual ~AliEventBaseCut(){}
33     virtual Bool_t Rejected(AliAOD* aod) const;//returns kTRUE if rejected
34     virtual void   SetRange(Double_t min, Double_t max){fMin = min; fMax = max;}
35
36     virtual EEventCutProperty GetProperty()const{return fProperty;}
37
38   protected:
39     virtual Double_t GetValue(AliAOD* aod) const = 0;
40     
41     Double_t fMin;//Minimum value
42     Double_t fMax;//Maximum value
43     EEventCutProperty fProperty;//Defines the type of the cut - used by the setters cut
44     
45   private:
46     ClassDef(AliEventBaseCut,1)
47 };
48
49 /************************************************************/
50
51 class AliPrimVertexXCut: public AliEventBaseCut
52 {
53  public: 
54    AliPrimVertexXCut():AliEventBaseCut(0,0,kPrimVertexXCut){}
55    AliPrimVertexXCut(Double_t min,Double_t max):AliEventBaseCut(min,max,kPrimVertexXCut){}
56    virtual ~AliPrimVertexXCut(){}
57  protected:
58    Double_t GetValue(AliAOD* aod) const;
59    
60  private:
61    ClassDef(AliPrimVertexXCut,1)
62 };
63 /************************************************************/
64
65 class AliPrimVertexYCut: public AliEventBaseCut
66 {
67  public: 
68    AliPrimVertexYCut():AliEventBaseCut(0,0,kPrimVertexYCut){}
69    AliPrimVertexYCut(Double_t min,Double_t max):AliEventBaseCut(min,max,kPrimVertexYCut){}
70    virtual ~AliPrimVertexYCut(){}
71    
72  protected:
73    Double_t GetValue(AliAOD* aod) const;
74    
75  private:
76    ClassDef(AliPrimVertexYCut,1)
77 };
78 /************************************************************/
79
80 class AliPrimVertexZCut: public AliEventBaseCut
81 {
82  public: 
83    AliPrimVertexZCut():AliEventBaseCut(0,0,kPrimVertexZCut){}
84    AliPrimVertexZCut(Double_t min,Double_t max):AliEventBaseCut(min,max,kPrimVertexZCut){}
85    virtual ~AliPrimVertexZCut(){}
86  protected:
87    Double_t GetValue(AliAOD* aod) const;
88    
89  private:
90    ClassDef(AliPrimVertexZCut,1)
91 };
92
93
94 /************************************************************/
95
96 class AliNChargedCut: public AliEventBaseCut
97 {
98  public: 
99    AliNChargedCut():AliEventBaseCut(0,0,kNChargedCut){}
100    AliNChargedCut(Double_t min, Double_t max, Double_t etamin = -10.0, Double_t etamax = 10.0):
101        AliEventBaseCut(min,max,kNChargedCut),fEtaMin(etamin),fEtaMax(etamax){}
102    virtual ~AliNChargedCut(){}
103    
104    void     SetEtaRange(Double_t min,Double_t max){fEtaMin = min;fEtaMax = max;}
105  protected:
106    Double_t GetValue(AliAOD* aod) const;
107    Double_t fEtaMin;//Defines max of eta range where mult is caclulated
108    Double_t fEtaMax;//Defines min of eta range where mult is caclulated
109    
110  private:
111    ClassDef(AliNChargedCut,1)
112 };
113
114
115 #endif