]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ANALYSIS/AliAODParticleCut.h
Stand-alone library for ESD. Possibility to use only root and lidESD.so for analysis...
[u/mrichter/AliRoot.git] / ANALYSIS / AliAODParticleCut.h
1 #ifndef ALIAODPARTICLECUT_H
2 #define ALIAODPARTICLECUT_H
3 //__________________________________________________________________________
4 ////////////////////////////////////////////////////////////////////////////
5 //                                                                        //
6 // class AliAODParticleCut                                                //
7 //                                                                        //
8 // Classes for single particle cuts.                                      //
9 // User should use mainly AliAODParticleCut interface methods,            //
10 // eventually EmptyCut which passes all particles.                        //
11 //                                                                        //
12 // There is all interface for setting cuts on all particle properties     //
13 // The main method is Rejected - which returns                            //
14 //         True to reject particle                                        //
15 //         False in case it meets all the criteria of the given cut       //
16 //                                                                        //
17 // This class has the list of base particle  cuts that perform check on   //
18 // single property. Particle  is rejected if any of cuts rejects it.      //
19 // There are implemented logical base cuts that perform logical           //
20 // operations on results of two other base cuts. Using them user can      //
21 // create a tree structure of a base cuts that performs sophisticated     //
22 // cut.                                                                   //
23 //                                                                        //
24 // User can also implement a base cut that performs complicated           //
25 // calculations, if it is only more convenient and/or efficint.           //
26 //                                                                        //
27 // User should delete created cuts  himself                               //
28 // because when setting a cut, other objects (functions,analyses,         //
29 // readers, other cuts) make their own copy of a cut.                     //
30 //                                                                        //
31 // more info: http://aliweb.cern.ch/people/skowron/analyzer/index.html    //
32 // responsible: Piotr Skowronski@cern.ch                                  //
33 //                                                                        //
34 ////////////////////////////////////////////////////////////////////////////
35
36 #include <TObject.h>
37 #include "AliVAODParticle.h"
38 #include "AliAODParticleBaseCut.h"
39
40
41 class AliAODParticleEmptyCut;
42 class AliAODParticleCut;
43 class AliAODParticleBaseCut;
44
45
46 /******************************************************************/
47 /******************************************************************/
48 /******************************************************************/
49
50 /******************************************************************/
51 /******************************************************************/
52 /******************************************************************/
53
54 class AliAODParticleCut: public TObject
55 {
56 //Class describing cut on particle
57   public:
58
59     AliAODParticleCut();
60     AliAODParticleCut(const AliAODParticleCut& in);
61     virtual ~AliAODParticleCut();
62     AliAODParticleCut& operator = (const AliAODParticleCut& in);
63     
64     virtual Bool_t Rejected(AliVAODParticle* p) const;
65     Bool_t IsEmpty() const {return kFALSE;}
66     
67     void AddBasePartCut(AliAODParticleBaseCut* basecut);
68     
69     Int_t GetPID() const { return fPID;}
70     void SetPID(Int_t pid){fPID=pid;}
71     void SetMomentumRange(Double_t min, Double_t max);
72     void SetPRange(Double_t min, Double_t max){SetMomentumRange(min,max);}
73     void SetPtRange(Double_t min, Double_t max);
74     void SetEnergyRange(Double_t min, Double_t max);
75     void SetRapidityRange(Double_t min, Double_t max);
76     void SetYRange(Double_t min, Double_t max){SetRapidityRange(min,max);}
77     void SetPseudoRapidityRange(Double_t min, Double_t max);
78     void SetPxRange(Double_t min, Double_t max);
79     void SetPyRange(Double_t min, Double_t max);
80     void SetPzRange(Double_t min, Double_t max);
81     void SetPhiRange(Double_t min, Double_t max);
82     void SetThetaRange(Double_t min, Double_t max);
83     void SetVxRange(Double_t min, Double_t max);
84     void SetVyRange(Double_t min, Double_t max);
85     void SetVzRange(Double_t min, Double_t max);
86     
87     void Print(void) const;
88   protected:
89      
90     AliAODParticleBaseCut* FindCut(AliAODParticleBaseCut::EAODCutProperty property);
91
92     AliAODParticleBaseCut ** fCuts;//! Array with cuts
93     Int_t fNCuts; //number of base cuts stored in fCuts
94
95     Int_t fPID; //particle PID  - if=0 (rootino) all pids are accepted
96           
97   private:
98     static const Int_t fgkMaxCuts; //Size of the fCuts array
99
100     ClassDef(AliAODParticleCut,1)
101 };
102 /******************************************************************/
103 /******************************************************************/
104 /******************************************************************/
105
106 class AliAODParticleEmptyCut:  public AliAODParticleCut
107 {
108 //Empty - it passes possitively all particles - it means returns always False
109 //Class describing cut on particles
110   public:
111     AliAODParticleEmptyCut(){};
112     virtual ~AliAODParticleEmptyCut(){};
113     
114     Bool_t Rejected(AliVAODParticle*) const {return kFALSE;} //accept everything
115     Bool_t IsEmpty() const {return kTRUE;}
116
117     ClassDef(AliAODParticleEmptyCut,1)
118  
119 };
120
121 /******************************************************************/
122 /******************************************************************/
123 /******************************************************************/
124
125
126 #endif