ReaderInternal: Internal data format implementation
[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*);
66
67 void AddBasePartCut(AliHbtBaseCut*);
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);
88 protected:
89
90 AliHbtBaseCut* FindCut(AliHBTCutProperty);
91
92 AliHbtBaseCut ** fCuts;//! Array with cuts
93 Int_t fNCuts;
94
95 Int_t fPID; //particle PID - if=0 (rootino) all pids are accepted
96
97 private:
98 static const Int_t fkgMaxCuts;
99 public:
100 ClassDef(AliHBTParticleCut,1)
101
102};
103/******************************************************************/
104/******************************************************************/
105/******************************************************************/
106
107class AliHBTEmptyParticleCut: public AliHBTParticleCut
108{
109//Empty - it passes possitively all particles - it means returns always False
110//Class describing cut on pairs of particles
111 public:
112 AliHBTEmptyParticleCut(){};
113 virtual ~AliHBTEmptyParticleCut(){};
114
115 Bool_t Pass(AliHBTParticle*) {return kFALSE;} //accpept everything
116
117 ClassDef(AliHBTEmptyParticleCut,1)
118
119};
120
121/******************************************************************/
122/******************************************************************/
123/******************************************************************/
124
125class AliHbtBaseCut: public TObject
126 {
127 //This class defines the range of some property - pure virtual
128 //Property is coded by AliHBTCutTypes type
129
130 public:
131
132 AliHbtBaseCut(Double_t min = 0.0, Double_t max = 0.0,AliHBTCutProperty prop = kHbtNone):
133 fProperty(prop),fMin(min),fMax(max){}
134
135 virtual ~AliHbtBaseCut(){}
136
137 Bool_t Pass(AliHBTParticle *);
138
139 void SetRange(Double_t min, Double_t max){fMin = min; fMax = max;}
140
141 void SetMinimum(Double_t min){fMin = min;}
142 void SetMaximum(Double_t max){fMax = max;}
143
144 Double_t GetMinimum() const {return fMin;}
145 Double_t GetMaximum() const {return fMax;}
146
147 AliHBTCutProperty GetProperty() const {return fProperty;}
148 void Print(void);
149 protected:
150 virtual Double_t GetValue(AliHBTParticle *) = 0;
151
152 AliHBTCutProperty fProperty;
153 Double_t fMin;
154 Double_t fMax;
155 private:
156 void PrintProperty(void);
157 public:
158 ClassDef(AliHbtBaseCut,1)
159
160 };
161
162inline Bool_t
163AliHbtBaseCut::Pass(AliHBTParticle *p)
164 {
165 if ( (GetValue(p) > fMin) && (GetValue(p) <fMax ) ) return kFALSE; //accepted
166 else return kTRUE; //rejected
167 }
168/******************************************************************/
169/******************************************************************/
170/******************************************************************/
171
172
173class AliHBTMomentumCut: public AliHbtBaseCut
174 {
175 public:
176 AliHBTMomentumCut(Double_t min = 0.0, Double_t max = 0.0):AliHbtBaseCut(min,max,kHbtP){}
177 virtual ~AliHBTMomentumCut(){}
178 protected:
179 Double_t GetValue(AliHBTParticle * p){return p->P();}
180 public:
181 ClassDef(AliHBTMomentumCut,1)
182
183 };
184
185
186class AliHBTPtCut: public AliHbtBaseCut
187 {
188 public:
189 AliHBTPtCut(Double_t min = 0.0, Double_t max = 0.0):AliHbtBaseCut(min,max,kHbtPt){}
190 virtual ~AliHBTPtCut(){}
191 protected:
192 Double_t GetValue(AliHBTParticle * p){return p->Pt();}
193 public:
194 ClassDef(AliHBTPtCut,1)
195
196 };
197
198
199class AliHBTEnergyCut: public AliHbtBaseCut
200 {
201 public:
202 AliHBTEnergyCut(Double_t min = 0.0, Double_t max = 0.0):AliHbtBaseCut(min,max,kHbtE){}
203 virtual ~AliHBTEnergyCut(){}
204 protected:
205 Double_t GetValue(AliHBTParticle * p){return p->Energy();}
206 public:
207 ClassDef(AliHBTEnergyCut,1)
208
209 };
210
211class AliHBTRapidityCut: public AliHbtBaseCut
212 {
213 public:
214 AliHBTRapidityCut(Double_t min = 0.0, Double_t max = 0.0):AliHbtBaseCut(min,max,kHbtRapidity){}
215 virtual ~AliHBTRapidityCut(){}
216 protected:
217 Double_t GetValue(AliHBTParticle * p){return p->Y();}
218 public:
219 ClassDef(AliHBTRapidityCut,1)
220
221 };
222
223class AliHBTPseudoRapidityCut: public AliHbtBaseCut
224 {
225 public:
226 AliHBTPseudoRapidityCut(Double_t min = 0.0, Double_t max = 0.0):AliHbtBaseCut(min,max,kHbtPseudoRapidity){}
227 virtual ~AliHBTPseudoRapidityCut(){}
228 protected:
229 Double_t GetValue(AliHBTParticle * p){return p->Eta();}
230 public:
231 ClassDef(AliHBTPseudoRapidityCut,1)
232
233 };
234
235class AliHBTPxCut: public AliHbtBaseCut
236 {
237 public:
238 AliHBTPxCut(Double_t min = 0.0, Double_t max = 0.0):AliHbtBaseCut(min,max,kHbtPx){}
239 virtual ~AliHBTPxCut(){}
240 protected:
241 Double_t GetValue(AliHBTParticle * p){return p->Px();}
242 public:
243 ClassDef(AliHBTPxCut,1)
244
245 };
246
247class AliHBTPyCut: public AliHbtBaseCut
248 {
249 public:
250 AliHBTPyCut(Double_t min = 0.0, Double_t max = 0.0):AliHbtBaseCut(min,max,kHbtPy){}
251 virtual ~AliHBTPyCut(){}
252 protected:
253 Double_t GetValue(AliHBTParticle * p){return p->Py();}
254 public:
255 ClassDef(AliHBTPyCut,1)
256
257 };
258
259
260class AliHBTPzCut: public AliHbtBaseCut
261 {
262 public:
263 AliHBTPzCut(Double_t min = 0.0, Double_t max = 0.0):AliHbtBaseCut(min,max,kHbtPz){}
264 virtual ~AliHBTPzCut(){}
265 protected:
266 Double_t GetValue(AliHBTParticle * p){return p->Pz();}
267 public:
268 ClassDef(AliHBTPzCut,1)
269
270 };
271
272class AliHBTPhiCut: public AliHbtBaseCut
273 {
274 public:
275 AliHBTPhiCut(Double_t min = 0.0, Double_t max = 0.0):AliHbtBaseCut(min,max,kHbtPhi){}
276 virtual ~AliHBTPhiCut(){}
277 protected:
278 Double_t GetValue(AliHBTParticle * p){return p->Phi();}
279 public:
280 ClassDef(AliHBTPhiCut,1)
281
282 };
283
284class AliHBTThetaCut: public AliHbtBaseCut
285 {
286 public:
287 AliHBTThetaCut(Double_t min = 0.0, Double_t max = 0.0):AliHbtBaseCut(min,max,kHbtTheta){}
288 virtual ~AliHBTThetaCut(){}
289 protected:
290 Double_t GetValue(AliHBTParticle * p){return p->Theta();}
291 public:
292 ClassDef(AliHBTThetaCut,1)
293
294 };
295
296class AliHBTVxCut: public AliHbtBaseCut
297 {
298 //Cut of the X coordinate of the vertex position
299 public:
300 AliHBTVxCut(Double_t min = 0.0, Double_t max = 0.0):AliHbtBaseCut(min,max,kHbtVx){}
301 virtual ~AliHBTVxCut(){}
302 protected:
303 Double_t GetValue(AliHBTParticle * p){return p->Vx();} //retruns value of the vertex
304 public:
305 ClassDef(AliHBTVxCut,1)
306
307 };
308
309
310class AliHBTVyCut: public AliHbtBaseCut
311 {
312 //Cut of the X coordinate of the vertex position
313 public:
314 AliHBTVyCut(Double_t min = 0.0, Double_t max = 0.0):AliHbtBaseCut(min,max,kHbtVy){}
315 virtual ~AliHBTVyCut(){}
316 protected:
317 Double_t GetValue(AliHBTParticle * p){return p->Vy();} //retruns value of the vertex
318 public:
319 ClassDef(AliHBTVyCut,1)
320
321 };
322
323class AliHBTVzCut: public AliHbtBaseCut
324 {
325 //Cut of the X coordinate of the vertex position
326 public:
327 AliHBTVzCut(Double_t min = 0.0, Double_t max = 0.0):AliHbtBaseCut(min,max,kHbtVz){}
328 virtual ~AliHBTVzCut(){}
329 protected:
330 Double_t GetValue(AliHBTParticle * p){return p->Vz();} //retruns value of the vertex
331 public:
332 ClassDef(AliHBTVzCut,1)
333
334 };
335
336
337
338
339
340#endif