New cuts added on pair open angles
[u/mrichter/AliRoot.git] / HBTAN / AliHBTPairCut.h
CommitLineData
1b446896 1#ifndef ALIHBTPAIRCUT_H
2#define ALIHBTPAIRCUT_H
3
ea197c3e 4/* $Id$ */
1b446896 5
ea197c3e 6//Piotr Skowronski@cern.ch
7//Class implements cut on the pair of particles
8//
9//more info: http://alisoft.cern.ch/people/skowron/analyzer/index.html
10
1b446896 11#include "AliHBTPair.h"
12
ea197c3e 13class AliHBTParticleCut;
1b446896 14class AliHbtBasePairCut;
15
16enum AliHBTPairCutProperty
ea197c3e 17{
1b446896 18 kHbtPairCutPropQInv, //Q invariant
bce80f3b 19 kHbtPairCutPropKt,
e3131968 20 kHbtPairCutPropKStar,
2d5d4d7d 21 kHbtPairCutPropQSideCMSLC,
22 kHbtPairCutPropQOutCMSLC,
23 kHbtPairCutPropQLongCMSLC,
879e0c18 24 kHbtPairCutPropDeltaPhi,
25 kHbtPairCutPropDeltaTheta,
26 kHbtPairCutPropDeltaP,
27 kHbtPairCutPropDeltaPt,
9616170a 28 kHbtPairCutPropAvSepar,
66d1d1a4 29 kHbtPairCutPropClOverlap,
1b446896 30 kHbtPairCutPropNone
ea197c3e 31};
49d1e071 32/******************************************************************/
1b446896 33
80482463 34class AliHBTPairCut: public TNamed
1b446896 35{
ea197c3e 36 public:
37 AliHBTPairCut();
38 AliHBTPairCut(const AliHBTPairCut& in);
39 AliHBTPairCut& operator = (const AliHBTPairCut& in);
40
41 virtual ~AliHBTPairCut();
42 virtual Bool_t Pass(AliHBTPair* pair) const;
43 virtual Bool_t PassPairProp(AliHBTPair* pair) const;
48704f50 44
ea197c3e 45 virtual Bool_t IsEmpty() const {return kFALSE;}
46 void SetFirstPartCut(AliHBTParticleCut* cut); //sets the cut on the first particle
47 void SetSecondPartCut(AliHBTParticleCut* cut); //sets the cut on the second particle
48
49 void SetPartCut(AliHBTParticleCut* cut);//sets the the same cut on both particles
50
28cf76fa 51 virtual void AddBasePairCut(AliHbtBasePairCut* cut);
ea197c3e 52
53 void SetQInvRange(Double_t min, Double_t max);
54 void SetKtRange(Double_t min, Double_t max);
55 void SetKStarRange(Double_t min, Double_t max);
56 void SetQOutCMSLRange(Double_t min, Double_t max);
57 void SetQSideCMSLRange(Double_t min, Double_t max);
58 void SetQLongCMSLRange(Double_t min, Double_t max);
66d1d1a4 59 void SetAvSeparationRange(Double_t min,Double_t max = 10e5);//Anti-Merging Cut
60 void SetClusterOverlapRange(Double_t min,Double_t max);//Anti-Splitting Max range -0.5 1.0
9616170a 61
ea197c3e 62 AliHBTParticleCut* GetFirstPartCut() const {return fFirstPartCut;}
63 AliHBTParticleCut* GetSecondPartCut() const {return fSecondPartCut;}
64
65 protected:
66 AliHBTParticleCut* fFirstPartCut;//cut on first particle in pair
67 AliHBTParticleCut* fSecondPartCut;//cut on second particle in pair
68
69 AliHbtBasePairCut** fCuts; //! array of poiters to base cuts
70 Int_t fNCuts;//Number of cuts in fCuts array
71
72
73 AliHbtBasePairCut* FindCut(AliHBTPairCutProperty cut);
74 private:
75 static const Int_t fgkMaxCuts; // Max number of cuts
ea197c3e 76 ClassDef(AliHBTPairCut,2)
1b446896 77};
78/******************************************************************/
79/******************************************************************/
80/******************************************************************/
81
82class AliHBTEmptyPairCut: public AliHBTPairCut
83{
ea197c3e 84 //Empty - it passes possitively all particles - it means returns always False
85 //Class describing cut on pairs of particles
86 public:
87 AliHBTEmptyPairCut(){};
28cf76fa 88 AliHBTEmptyPairCut(const AliHBTEmptyPairCut& in):AliHBTPairCut(in){};
ea197c3e 89 virtual ~AliHBTEmptyPairCut(){};
90
91 Bool_t Pass(AliHBTPair*) const {return kFALSE;} //accpept everything
92 Bool_t IsEmpty() const {return kTRUE;}
93
94 ClassDef(AliHBTEmptyPairCut,1)
1b446896 95};
96
97
98
99/******************************************************************/
100/******************************************************************/
101/******************************************************************/
102
103class AliHbtBasePairCut: public TObject
ea197c3e 104{
105 //This class defines the range of some property - pure virtual
106 //Property is coded by AliHBTCutTypes type
1b446896 107
ea197c3e 108 public:
1b446896 109
ea197c3e 110 AliHbtBasePairCut(Double_t min = 0.0, Double_t max = 0.0, AliHBTPairCutProperty prop= kHbtPairCutPropNone):
111 fMin(min),fMax(max),fProperty(prop){}
112
113 virtual ~AliHbtBasePairCut(){}
1b446896 114
49d1e071 115 virtual Bool_t Pass(AliHBTPair* pair) const;
ea197c3e 116
117 void SetRange(Double_t min, Double_t max){fMin = min; fMax = max;}
118
119 void SetMinimum(Double_t min){fMin = min;}
120 void SetMaximum(Double_t max){fMax = max;}
121
122 Double_t GetMinimum() const {return fMin;}
123 Double_t GetMaximum() const {return fMax;}
124
125 AliHBTPairCutProperty GetProperty() const {return fProperty;}
126
127 protected:
128 virtual Double_t GetValue(AliHBTPair* pair) const = 0;
129
130 Double_t fMin; // Lower boundary of the range
131 Double_t fMax; // Upper boundary of the range
132
133 AliHBTPairCutProperty fProperty; // The property itself
134
135 ClassDef(AliHbtBasePairCut,1)
136
1b446896 137 };
49d1e071 138/******************************************************************/
1b446896 139
ea197c3e 140inline Bool_t AliHbtBasePairCut::Pass(AliHBTPair* pair) const
141{
9616170a 142 //checks if pair proprty is in range
143 //null pointer check is made by AliHBTPairCut, so here is unnecesary
144
ea197c3e 145 Double_t value = GetValue(pair);
146 if ( (value > fMin) && (value <fMax ) ) return kFALSE; //accepted
147 else return kTRUE; //rejected
148}
1b446896 149/******************************************************************/
150/******************************************************************/
151/******************************************************************/
49d1e071 152
1b446896 153class AliHBTQInvCut: public AliHbtBasePairCut
ea197c3e 154{
155 public:
156 AliHBTQInvCut(Double_t min = 0.0, Double_t max = 0.0):AliHbtBasePairCut(min,max,kHbtPairCutPropQInv){}
157 virtual ~AliHBTQInvCut(){}
158 protected:
159 virtual Double_t GetValue(AliHBTPair* pair) const {return pair->GetQInv();}
160
161 ClassDef(AliHBTQInvCut,1)
1b446896 162 };
49d1e071 163/******************************************************************/
bce80f3b 164
ea197c3e 165class AliHBTKtCut: public AliHbtBasePairCut {
166 public:
167 AliHBTKtCut(Double_t min = 0.0, Double_t max = 0.0):AliHbtBasePairCut(min,max,kHbtPairCutPropKt){}
168 virtual ~AliHBTKtCut(){}
169 protected:
170 virtual Double_t GetValue(AliHBTPair* pair) const {return pair->GetKt();}
171
172 ClassDef(AliHBTKtCut,1)
bce80f3b 173 };
49d1e071 174/******************************************************************/
bce80f3b 175
e3131968 176class AliHBTKStarCut: public AliHbtBasePairCut
ea197c3e 177{
178 public:
179 AliHBTKStarCut(Double_t min = 0.0, Double_t max = 0.0):AliHbtBasePairCut(min,max,kHbtPairCutPropKStar){}
180 virtual ~AliHBTKStarCut(){}
181 protected:
182 virtual Double_t GetValue(AliHBTPair* pair) const {return pair->GetKStar();}
183
184 ClassDef(AliHBTKStarCut,1)
185};
49d1e071 186/******************************************************************/
2d5d4d7d 187
188class AliHBTQSideCMSLCCut: public AliHbtBasePairCut
ea197c3e 189{
190 public:
191 AliHBTQSideCMSLCCut(Double_t min = 0.0, Double_t max = 0.0):
192 AliHbtBasePairCut(min,max,kHbtPairCutPropQSideCMSLC){}
193 virtual ~AliHBTQSideCMSLCCut(){}
194 protected:
195 virtual Double_t GetValue(AliHBTPair* pair) const
196 {return pair->GetQSideCMSLC();}
197
198 ClassDef(AliHBTQSideCMSLCCut,1)
199};
49d1e071 200/******************************************************************/
2d5d4d7d 201
202
203class AliHBTQOutCMSLCCut: public AliHbtBasePairCut
ea197c3e 204{
205 public:
206 AliHBTQOutCMSLCCut(Double_t min = 0.0, Double_t max = 0.0):
207 AliHbtBasePairCut(min,max,kHbtPairCutPropQOutCMSLC){}
208 virtual ~AliHBTQOutCMSLCCut(){}
209 protected:
210 virtual Double_t GetValue(AliHBTPair* pair) const
211 {return pair->GetQOutCMSLC();}
212
213 ClassDef(AliHBTQOutCMSLCCut,1)
214};
49d1e071 215/******************************************************************/
2d5d4d7d 216
217class AliHBTQLongCMSLCCut: public AliHbtBasePairCut
ea197c3e 218{
219 public:
220 AliHBTQLongCMSLCCut(Double_t min = 0.0, Double_t max = 0.0):
221 AliHbtBasePairCut(min,max,kHbtPairCutPropQLongCMSLC){}
222 virtual ~AliHBTQLongCMSLCCut(){}
223 protected:
224 virtual Double_t GetValue(AliHBTPair* pair) const
225 {return pair->GetQLongCMSLC();}
226
227 ClassDef(AliHBTQLongCMSLCCut,1)
228};
49d1e071 229/******************************************************************/
879e0c18 230
231class AliHBTDeltaPhiCut: public AliHbtBasePairCut
232{
233 public:
234 AliHBTDeltaPhiCut(Double_t min = 0.0, Double_t max = 0.0):
235 AliHbtBasePairCut(min,max,kHbtPairCutPropDeltaPhi){}
236 virtual ~AliHBTDeltaPhiCut(){}
237 protected:
238 virtual Double_t GetValue(AliHBTPair* pair) const
239 {return TMath::Abs(pair->GetDeltaPhi());}
240
241 ClassDef(AliHBTDeltaPhiCut,1)
242};
243/******************************************************************/
244
245class AliHBTDeltaThetaCut: public AliHbtBasePairCut
246{
247 public:
248 AliHBTDeltaThetaCut(Double_t min = 0.0, Double_t max = 0.0):
249 AliHbtBasePairCut(min,max,kHbtPairCutPropDeltaTheta){}
250 virtual ~AliHBTDeltaThetaCut(){}
251 protected:
252 virtual Double_t GetValue(AliHBTPair* pair) const
253 {return TMath::Abs(pair->GetDeltaTheta());}
254
255 ClassDef(AliHBTDeltaThetaCut,1)
256};
257/******************************************************************/
ed20b0ba 258
259class AliHBTCluterOverlapCut: public AliHbtBasePairCut
260{
261 public:
262 AliHBTCluterOverlapCut(Double_t min = 0.0, Double_t max = 1e5):
263 AliHbtBasePairCut(min,max,kHbtPairCutPropClOverlap){}
264 virtual ~AliHBTCluterOverlapCut(){}
265
266 protected:
267 virtual Double_t GetValue(AliHBTPair* pair) const;
268 ClassDef(AliHBTCluterOverlapCut,1)
269};
270/******************************************************************/
9616170a 271
272class AliHBTAvSeparationCut: public AliHbtBasePairCut
273{
274 public:
275 AliHBTAvSeparationCut(Double_t min = 0.0, Double_t max = 1e5):
276 AliHbtBasePairCut(min,max,kHbtPairCutPropAvSepar){}
277 virtual ~AliHBTAvSeparationCut(){}
278
279 protected:
280 virtual Double_t GetValue(AliHBTPair* pair) const;
281 ClassDef(AliHBTAvSeparationCut,1)
282};
49d1e071 283/******************************************************************/
66d1d1a4 284
ed20b0ba 285class AliHBTOutSideSameSignCut: public AliHbtBasePairCut
66d1d1a4 286{
287 public:
ed20b0ba 288 AliHBTOutSideSameSignCut(){}
289 virtual ~AliHBTOutSideSameSignCut(){}
290 virtual Bool_t Pass(AliHBTPair *p) const;
66d1d1a4 291 protected:
f9bf3968 292 virtual Double_t GetValue(AliHBTPair* /*pair*/) const {return 0.0;}
ed20b0ba 293 ClassDef(AliHBTOutSideSameSignCut,1)
294};
295/******************************************************************/
296
297class AliHBTOutSideDiffSignCut: public AliHbtBasePairCut
298{
299 public:
300 AliHBTOutSideDiffSignCut(){}
301 virtual ~AliHBTOutSideDiffSignCut(){}
302 virtual Bool_t Pass(AliHBTPair *p) const;
303 protected:
f9bf3968 304 virtual Double_t GetValue(AliHBTPair* /*pair*/) const {return 0.0;}
ed20b0ba 305 ClassDef(AliHBTOutSideDiffSignCut,1)
66d1d1a4 306};
49d1e071 307/******************************************************************/
308
309class AliHBTLogicalOperPairCut: public AliHbtBasePairCut
310 {
311 public:
312 AliHBTLogicalOperPairCut();
313 AliHBTLogicalOperPairCut(AliHbtBasePairCut* first, AliHbtBasePairCut* second);
314 virtual ~AliHBTLogicalOperPairCut();
315 protected:
316 Double_t GetValue(AliHBTPair * /*pair*/) const {MayNotUse("GetValue");return 0.0;}
317
318 AliHbtBasePairCut* fFirst; //second cut
319 AliHbtBasePairCut* fSecond; //first cut
320 private:
321 class AliHBTDummyBasePairCut: public AliHbtBasePairCut
322 {
323 Double_t GetValue(AliHBTPair* /*pair*/) const {return 0.0;}
324 Bool_t Pass(AliHBTPair* /*pair*/) const;
325 };
326
327 ClassDef(AliHBTLogicalOperPairCut,1)
328 };
329/******************************************************************/
330
331class AliHBTOrPairCut: public AliHBTLogicalOperPairCut
332{
333 public:
334 AliHBTOrPairCut(){}
335 AliHBTOrPairCut(AliHbtBasePairCut* first, AliHbtBasePairCut* second):AliHBTLogicalOperPairCut(first,second){}
336 virtual ~AliHBTOrPairCut(){}
337 Bool_t Pass(AliHBTPair *p) const;
338 ClassDef(AliHBTOrPairCut,1)
339};
340/******************************************************************/
341
342class AliHBTAndPairCut: public AliHBTLogicalOperPairCut
343{
344 public:
345 AliHBTAndPairCut(){}
346 AliHBTAndPairCut(AliHbtBasePairCut* first, AliHbtBasePairCut* second):AliHBTLogicalOperPairCut(first,second){}
347 virtual ~AliHBTAndPairCut(){}
348 Bool_t Pass(AliHBTPair *p) const;
349 ClassDef(AliHBTAndPairCut,1)
350};
351
1b446896 352#endif