Catching up to NewIO -> Particle stores all passible PID and their probabilities
[u/mrichter/AliRoot.git] / HBTAN / AliHBTParticleCut.h
CommitLineData
1b446896 1//Piotr Skowronski@cern.ch
2//Classes for single particle cuts
3//User should use only AliHBTParticleCut, eventually EmptyCut which passes all particles
4//There is all interface for setting cuts on all particle properties
5//The main method is Pass - which returns
6// True in order to reject particle
7// False in case it meets all the criteria of the given cut
8//
9//User should create (and also destroy) cuts himself
10//and then pass them to the Analysis or Function by a proper method
11//
12//more info: http://alisoft.cern.ch/people/skowron/analyzer/index.html
13
14
15#ifndef ALIHBTPARTICLECUT_H
16#define ALIHBTPARTICLECUT_H
17
18#include <TObject.h>
19#include "AliHBTParticle.h"
20
21
22class AliHBTEmptyParticleCut;
23class AliHBTParticleCut;
24class AliHBTPairCut;
25class AliHBTPair;
26class AliHbtBaseCut;
27
28
29/******************************************************************/
30/******************************************************************/
31/******************************************************************/
32
33enum AliHBTCutProperty
34 {
35//codes particle property
36 kHbtP, //Momentum
37 kHbtPt, //Transverse momentum
38 kHbtE, //Energy
39 kHbtRapidity, //
40 kHbtPseudoRapidity,
41 kHbtPx, //X coordinate of the momentum
42 kHbtPy, //Y coordinate of the momentum
43 kHbtPz, //Z coordinate of the momentum
44 kHbtPhi,//angle
45 kHbtTheta,//angle
46 kHbtVx, // vertex X coordinate
47 kHbtVy, // vertex Y coordinate
48 kHbtVz, // vertex Z coordinate
49//_____________________________
50 kHbtNone
51 };
52
53/******************************************************************/
54/******************************************************************/
55/******************************************************************/
56
57class AliHBTParticleCut: public TObject
58{
59//Class describing cut on pairs of particles
60 public:
61 AliHBTParticleCut();
62 AliHBTParticleCut(const AliHBTParticleCut&);
63 virtual ~AliHBTParticleCut();
64
65 virtual Bool_t Pass(AliHBTParticle*);
a925ebdf 66 Bool_t IsEmpty() {return kFALSE;}
1b446896 67
68 void AddBasePartCut(AliHbtBaseCut*);
69
70 Int_t GetPID() const { return fPID;}
71 void SetPID(Int_t pid){fPID=pid;}
72 void SetMomentumRange(Double_t min, Double_t max);
73 void SetPRange(Double_t min, Double_t max){SetMomentumRange(min,max);}
74 void SetPtRange(Double_t min, Double_t max);
75 void SetEnergyRange(Double_t min, Double_t max);
76 void SetRapidityRange(Double_t min, Double_t max);
77 void SetYRange(Double_t min, Double_t max){SetRapidityRange(min,max);}
78 void SetPseudoRapidityRange(Double_t min, Double_t max);
79 void SetPxRange(Double_t min, Double_t max);
80 void SetPyRange(Double_t min, Double_t max);
81 void SetPzRange(Double_t min, Double_t max);
82 void SetPhiRange(Double_t min, Double_t max);
83 void SetThetaRange(Double_t min, Double_t max);
84 void SetVxRange(Double_t min, Double_t max);
85 void SetVyRange(Double_t min, Double_t max);
86 void SetVzRange(Double_t min, Double_t max);
87
88 void Print(void);
89 protected:
90
91 AliHbtBaseCut* FindCut(AliHBTCutProperty);
92
93 AliHbtBaseCut ** fCuts;//! Array with cuts
94 Int_t fNCuts;
95
96 Int_t fPID; //particle PID - if=0 (rootino) all pids are accepted
97
98 private:
99 static const Int_t fkgMaxCuts;
100 public:
101 ClassDef(AliHBTParticleCut,1)
102
103};
104/******************************************************************/
105/******************************************************************/
106/******************************************************************/
107
108class AliHBTEmptyParticleCut: public AliHBTParticleCut
109{
110//Empty - it passes possitively all particles - it means returns always False
111//Class describing cut on pairs of particles
112 public:
113 AliHBTEmptyParticleCut(){};
114 virtual ~AliHBTEmptyParticleCut(){};
115
a925ebdf 116 Bool_t Pass(AliHBTParticle*){return kFALSE;} //accpept everything
117 Bool_t IsEmpty() {return kTRUE;}
1b446896 118
119 ClassDef(AliHBTEmptyParticleCut,1)
120
121};
122
123/******************************************************************/
124/******************************************************************/
125/******************************************************************/
126
127class AliHbtBaseCut: public TObject
128 {
129 //This class defines the range of some property - pure virtual
130 //Property is coded by AliHBTCutTypes type
131
132 public:
133
134 AliHbtBaseCut(Double_t min = 0.0, Double_t max = 0.0,AliHBTCutProperty prop = kHbtNone):
135 fProperty(prop),fMin(min),fMax(max){}
136
137 virtual ~AliHbtBaseCut(){}
138
139 Bool_t Pass(AliHBTParticle *);
140
141 void SetRange(Double_t min, Double_t max){fMin = min; fMax = max;}
142
143 void SetMinimum(Double_t min){fMin = min;}
144 void SetMaximum(Double_t max){fMax = max;}
145
146 Double_t GetMinimum() const {return fMin;}
147 Double_t GetMaximum() const {return fMax;}
148
149 AliHBTCutProperty GetProperty() const {return fProperty;}
150 void Print(void);
151 protected:
152 virtual Double_t GetValue(AliHBTParticle *) = 0;
153
154 AliHBTCutProperty fProperty;
155 Double_t fMin;
156 Double_t fMax;
157 private:
158 void PrintProperty(void);
159 public:
160 ClassDef(AliHbtBaseCut,1)
161
162 };
163
164inline Bool_t
165AliHbtBaseCut::Pass(AliHBTParticle *p)
166 {
6374caa2 167 if ( (GetValue(p) < fMin) || (GetValue(p) > fMax ) ) return kTRUE; //rejected
168 else return kFALSE; //accepted
1b446896 169 }
170/******************************************************************/
171/******************************************************************/
172/******************************************************************/
173
174
175class AliHBTMomentumCut: public AliHbtBaseCut
176 {
177 public:
178 AliHBTMomentumCut(Double_t min = 0.0, Double_t max = 0.0):AliHbtBaseCut(min,max,kHbtP){}
179 virtual ~AliHBTMomentumCut(){}
180 protected:
181 Double_t GetValue(AliHBTParticle * p){return p->P();}
182 public:
183 ClassDef(AliHBTMomentumCut,1)
184
185 };
186
187
188class AliHBTPtCut: public AliHbtBaseCut
189 {
190 public:
191 AliHBTPtCut(Double_t min = 0.0, Double_t max = 0.0):AliHbtBaseCut(min,max,kHbtPt){}
192 virtual ~AliHBTPtCut(){}
193 protected:
194 Double_t GetValue(AliHBTParticle * p){return p->Pt();}
195 public:
196 ClassDef(AliHBTPtCut,1)
197
198 };
199
200
201class AliHBTEnergyCut: public AliHbtBaseCut
202 {
203 public:
204 AliHBTEnergyCut(Double_t min = 0.0, Double_t max = 0.0):AliHbtBaseCut(min,max,kHbtE){}
205 virtual ~AliHBTEnergyCut(){}
206 protected:
207 Double_t GetValue(AliHBTParticle * p){return p->Energy();}
208 public:
209 ClassDef(AliHBTEnergyCut,1)
210
211 };
212
213class AliHBTRapidityCut: public AliHbtBaseCut
214 {
215 public:
216 AliHBTRapidityCut(Double_t min = 0.0, Double_t max = 0.0):AliHbtBaseCut(min,max,kHbtRapidity){}
217 virtual ~AliHBTRapidityCut(){}
218 protected:
219 Double_t GetValue(AliHBTParticle * p){return p->Y();}
220 public:
221 ClassDef(AliHBTRapidityCut,1)
222
223 };
224
225class AliHBTPseudoRapidityCut: public AliHbtBaseCut
226 {
227 public:
228 AliHBTPseudoRapidityCut(Double_t min = 0.0, Double_t max = 0.0):AliHbtBaseCut(min,max,kHbtPseudoRapidity){}
229 virtual ~AliHBTPseudoRapidityCut(){}
230 protected:
231 Double_t GetValue(AliHBTParticle * p){return p->Eta();}
232 public:
233 ClassDef(AliHBTPseudoRapidityCut,1)
234
235 };
236
237class AliHBTPxCut: public AliHbtBaseCut
238 {
239 public:
240 AliHBTPxCut(Double_t min = 0.0, Double_t max = 0.0):AliHbtBaseCut(min,max,kHbtPx){}
241 virtual ~AliHBTPxCut(){}
242 protected:
243 Double_t GetValue(AliHBTParticle * p){return p->Px();}
244 public:
245 ClassDef(AliHBTPxCut,1)
246
247 };
248
249class AliHBTPyCut: public AliHbtBaseCut
250 {
251 public:
252 AliHBTPyCut(Double_t min = 0.0, Double_t max = 0.0):AliHbtBaseCut(min,max,kHbtPy){}
253 virtual ~AliHBTPyCut(){}
254 protected:
255 Double_t GetValue(AliHBTParticle * p){return p->Py();}
256 public:
257 ClassDef(AliHBTPyCut,1)
258
259 };
260
261
262class AliHBTPzCut: public AliHbtBaseCut
263 {
264 public:
265 AliHBTPzCut(Double_t min = 0.0, Double_t max = 0.0):AliHbtBaseCut(min,max,kHbtPz){}
266 virtual ~AliHBTPzCut(){}
267 protected:
268 Double_t GetValue(AliHBTParticle * p){return p->Pz();}
269 public:
270 ClassDef(AliHBTPzCut,1)
271
272 };
273
274class AliHBTPhiCut: public AliHbtBaseCut
275 {
276 public:
277 AliHBTPhiCut(Double_t min = 0.0, Double_t max = 0.0):AliHbtBaseCut(min,max,kHbtPhi){}
278 virtual ~AliHBTPhiCut(){}
279 protected:
280 Double_t GetValue(AliHBTParticle * p){return p->Phi();}
281 public:
282 ClassDef(AliHBTPhiCut,1)
283
284 };
285
286class AliHBTThetaCut: public AliHbtBaseCut
287 {
288 public:
289 AliHBTThetaCut(Double_t min = 0.0, Double_t max = 0.0):AliHbtBaseCut(min,max,kHbtTheta){}
290 virtual ~AliHBTThetaCut(){}
291 protected:
292 Double_t GetValue(AliHBTParticle * p){return p->Theta();}
293 public:
294 ClassDef(AliHBTThetaCut,1)
295
296 };
297
298class AliHBTVxCut: public AliHbtBaseCut
299 {
300 //Cut of the X coordinate of the vertex position
301 public:
302 AliHBTVxCut(Double_t min = 0.0, Double_t max = 0.0):AliHbtBaseCut(min,max,kHbtVx){}
303 virtual ~AliHBTVxCut(){}
304 protected:
305 Double_t GetValue(AliHBTParticle * p){return p->Vx();} //retruns value of the vertex
306 public:
307 ClassDef(AliHBTVxCut,1)
308
309 };
310
311
312class AliHBTVyCut: public AliHbtBaseCut
313 {
314 //Cut of the X coordinate of the vertex position
315 public:
316 AliHBTVyCut(Double_t min = 0.0, Double_t max = 0.0):AliHbtBaseCut(min,max,kHbtVy){}
317 virtual ~AliHBTVyCut(){}
318 protected:
319 Double_t GetValue(AliHBTParticle * p){return p->Vy();} //retruns value of the vertex
320 public:
321 ClassDef(AliHBTVyCut,1)
322
323 };
324
325class AliHBTVzCut: public AliHbtBaseCut
326 {
327 //Cut of the X coordinate of the vertex position
328 public:
329 AliHBTVzCut(Double_t min = 0.0, Double_t max = 0.0):AliHbtBaseCut(min,max,kHbtVz){}
330 virtual ~AliHBTVzCut(){}
331 protected:
332 Double_t GetValue(AliHBTParticle * p){return p->Vz();} //retruns value of the vertex
333 public:
334 ClassDef(AliHBTVzCut,1)
335
336 };
337
338
339
340
341
342#endif