Standarized naming schema for cuts
[u/mrichter/AliRoot.git] / ANALYSIS / AliAODPairCut.h
CommitLineData
78d7c6d3 1#ifndef AliAODPairCUT_H
2#define AliAODPairCUT_H
3
4/* $Id$ */
5
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
7b6503d6 10#include <TNamed.h>
11
78d7c6d3 12#include "AliAODPair.h"
13
14class AliAODParticleCut;
b4fb427e 15class AliAODPairBaseCut;
78d7c6d3 16
17enum AliAODPairCutProperty
18{
19 kHbtPairCutPropQInv, //Q invariant
20 kHbtPairCutPropKt,
21 kHbtPairCutPropKStar,
22 kHbtPairCutPropQSideLCMS,
23 kHbtPairCutPropQOutLCMS,
24 kHbtPairCutPropQLongLCMS,
25 kHbtPairCutPropDeltaPhi,
26 kHbtPairCutPropDeltaTheta,
27 kHbtPairCutPropDeltaP,
28 kHbtPairCutPropDeltaPt,
29 kHbtPairCutPropAvSepar,
30 kHbtPairCutPropSepar,
31 kHbtPairCutPropClOverlap,
32 kHbtPairCutPropPixelSepar,
33 kHbtPairCutPropNone
34};
35/******************************************************************/
36
37class AliAODPairCut: public TNamed
38{
39 public:
40 AliAODPairCut();
41 AliAODPairCut(const AliAODPairCut& in);
42 AliAODPairCut& operator = (const AliAODPairCut& in);
43
44 virtual ~AliAODPairCut();
45 virtual Bool_t Pass(AliAODPair* pair) const;
46 virtual Bool_t PassPairProp(AliAODPair* pair) const;
47
48 virtual Bool_t IsEmpty() const {return kFALSE;}
49 void SetFirstPartCut(AliAODParticleCut* cut); //sets the cut on the first particle
50 void SetSecondPartCut(AliAODParticleCut* cut); //sets the cut on the second particle
51
52 void SetPartCut(AliAODParticleCut* cut);//sets the the same cut on both particles
53
b4fb427e 54 virtual void AddBasePairCut(AliAODPairBaseCut* cut);
78d7c6d3 55
56 virtual void Print();
57
58 void SetQInvRange(Double_t min, Double_t max);
59 void SetKtRange(Double_t min, Double_t max);
60 void SetKStarRange(Double_t min, Double_t max);
61 void SetQOutCMSLRange(Double_t min, Double_t max);
62 void SetQSideCMSLRange(Double_t min, Double_t max);
63 void SetQLongCMSLRange(Double_t min, Double_t max);
64 void SetAvSeparationRange(Double_t min,Double_t max = 10e5);//Anti-Merging Cut
65 void SetITSSeparation(Int_t layer, Double_t drphi=0.01,Double_t dz = 0.08);//Anti-Merging Cut for first pixel layer
66 void SetClusterOverlapRange(Double_t min,Double_t max);//Anti-Splitting Max range -0.5 1.0
67
68 AliAODParticleCut* GetFirstPartCut() const {return fFirstPartCut;}
69 AliAODParticleCut* GetSecondPartCut() const {return fSecondPartCut;}
70
71 protected:
72 AliAODParticleCut* fFirstPartCut;//cut on first particle in pair
73 AliAODParticleCut* fSecondPartCut;//cut on second particle in pair
74
b4fb427e 75 AliAODPairBaseCut** fCuts; //! array of poiters to base cuts
78d7c6d3 76 Int_t fNCuts;//Number of cuts in fCuts array
77
78
b4fb427e 79 AliAODPairBaseCut* FindCut(AliAODPairCutProperty cut);
78d7c6d3 80 private:
81 static const Int_t fgkMaxCuts; // Max number of cuts
82 ClassDef(AliAODPairCut,2)
83};
84/******************************************************************/
85/******************************************************************/
86/******************************************************************/
87
b4fb427e 88class AliAODPairEmptyCut: public AliAODPairCut
78d7c6d3 89{
90 //Empty - it passes possitively all particles - it means returns always False
91 //Class describing cut on pairs of particles
92 public:
b4fb427e 93 AliAODPairEmptyCut(){};
94 AliAODPairEmptyCut(const AliAODPairEmptyCut& in):AliAODPairCut(in){};
95 virtual ~AliAODPairEmptyCut(){};
78d7c6d3 96
97 Bool_t Pass(AliAODPair*) const {return kFALSE;} //accpept everything
98 Bool_t IsEmpty() const {return kTRUE;}
99
b4fb427e 100 ClassDef(AliAODPairEmptyCut,1)
78d7c6d3 101};
102
103
104
105/******************************************************************/
106/******************************************************************/
107/******************************************************************/
108
b4fb427e 109class AliAODPairBaseCut: public TObject
78d7c6d3 110{
111 //This class defines the range of some property - pure virtual
112 //Property is coded by AliAODCutTypes type
113
114 public:
115
b4fb427e 116 AliAODPairBaseCut(Double_t min = 0.0, Double_t max = 0.0, AliAODPairCutProperty prop= kHbtPairCutPropNone):
78d7c6d3 117 fMin(min),fMax(max),fProperty(prop){}
118
b4fb427e 119 virtual ~AliAODPairBaseCut(){}
78d7c6d3 120
121 virtual Bool_t Pass(AliAODPair* pair) const;
122
123 void SetRange(Double_t min, Double_t max){fMin = min; fMax = max;}
124
125 void SetMinimum(Double_t min){fMin = min;}
126 void SetMaximum(Double_t max){fMax = max;}
127
128 Double_t GetMinimum() const {return fMin;}
129 Double_t GetMaximum() const {return fMax;}
130
131 AliAODPairCutProperty GetProperty() const {return fProperty;}
132
133 protected:
134 virtual Double_t GetValue(AliAODPair* pair) const = 0;
135
136 Double_t fMin; // Lower boundary of the range
137 Double_t fMax; // Upper boundary of the range
138
139 AliAODPairCutProperty fProperty; // The property itself
140
b4fb427e 141 ClassDef(AliAODPairBaseCut,1)
78d7c6d3 142
143 };
144/******************************************************************/
145
b4fb427e 146inline Bool_t AliAODPairBaseCut::Pass(AliAODPair* pair) const
78d7c6d3 147{
148 //checks if pair proprty is in range
149 //null pointer check is made by AliAODPairCut, so here is unnecesary
150
151 Double_t value = GetValue(pair);
152 if ( (value > fMin) && (value <fMax ) ) return kFALSE; //accepted
153 else return kTRUE; //rejected
154}
155/******************************************************************/
156/******************************************************************/
157/******************************************************************/
158
b4fb427e 159class AliAODQInvCut: public AliAODPairBaseCut
78d7c6d3 160{
161 public:
b4fb427e 162 AliAODQInvCut(Double_t min = 0.0, Double_t max = 0.0):AliAODPairBaseCut(min,max,kHbtPairCutPropQInv){}
78d7c6d3 163 virtual ~AliAODQInvCut(){}
164 protected:
165 virtual Double_t GetValue(AliAODPair* pair) const {return pair->GetQInv();}
166
167 ClassDef(AliAODQInvCut,1)
168 };
169/******************************************************************/
170
b4fb427e 171class AliAODKtCut: public AliAODPairBaseCut {
78d7c6d3 172 public:
b4fb427e 173 AliAODKtCut(Double_t min = 0.0, Double_t max = 0.0):AliAODPairBaseCut(min,max,kHbtPairCutPropKt){}
78d7c6d3 174 virtual ~AliAODKtCut(){}
175 protected:
176 virtual Double_t GetValue(AliAODPair* pair) const {return pair->GetKt();}
177
178 ClassDef(AliAODKtCut,1)
179 };
180/******************************************************************/
181
b4fb427e 182class AliAODKStarCut: public AliAODPairBaseCut
78d7c6d3 183{
184 public:
b4fb427e 185 AliAODKStarCut(Double_t min = 0.0, Double_t max = 0.0):AliAODPairBaseCut(min,max,kHbtPairCutPropKStar){}
78d7c6d3 186 virtual ~AliAODKStarCut(){}
187 protected:
188 virtual Double_t GetValue(AliAODPair* pair) const {return pair->GetKStar();}
189
190 ClassDef(AliAODKStarCut,1)
191};
192/******************************************************************/
193
b4fb427e 194class AliAODQSideLCMSCut: public AliAODPairBaseCut
78d7c6d3 195{
196 public:
197 AliAODQSideLCMSCut(Double_t min = 0.0, Double_t max = 0.0):
b4fb427e 198 AliAODPairBaseCut(min,max,kHbtPairCutPropQSideLCMS){}
78d7c6d3 199 virtual ~AliAODQSideLCMSCut(){}
200 protected:
201 virtual Double_t GetValue(AliAODPair* pair) const
202 {return pair->GetQSideLCMS();}
203
204 ClassDef(AliAODQSideLCMSCut,1)
205};
206/******************************************************************/
207
208
b4fb427e 209class AliAODQOutLCMSCut: public AliAODPairBaseCut
78d7c6d3 210{
211 public:
212 AliAODQOutLCMSCut(Double_t min = 0.0, Double_t max = 0.0):
b4fb427e 213 AliAODPairBaseCut(min,max,kHbtPairCutPropQOutLCMS){}
78d7c6d3 214 virtual ~AliAODQOutLCMSCut(){}
215 protected:
216 virtual Double_t GetValue(AliAODPair* pair) const
217 {return pair->GetQOutLCMS();}
218
219 ClassDef(AliAODQOutLCMSCut,1)
220};
221/******************************************************************/
222
b4fb427e 223class AliAODQLongLCMSCut: public AliAODPairBaseCut
78d7c6d3 224{
225 public:
226 AliAODQLongLCMSCut(Double_t min = 0.0, Double_t max = 0.0):
b4fb427e 227 AliAODPairBaseCut(min,max,kHbtPairCutPropQLongLCMS){}
78d7c6d3 228 virtual ~AliAODQLongLCMSCut(){}
229 protected:
230 virtual Double_t GetValue(AliAODPair* pair) const
231 {return pair->GetQLongLCMS();}
232
233 ClassDef(AliAODQLongLCMSCut,1)
234};
235/******************************************************************/
236
b4fb427e 237class AliAODDeltaPhiCut: public AliAODPairBaseCut
78d7c6d3 238{
239 public:
240 AliAODDeltaPhiCut(Double_t min = 0.0, Double_t max = 0.0):
b4fb427e 241 AliAODPairBaseCut(min,max,kHbtPairCutPropDeltaPhi){}
78d7c6d3 242 virtual ~AliAODDeltaPhiCut(){}
243 protected:
244 virtual Double_t GetValue(AliAODPair* pair) const
245 {return TMath::Abs(pair->GetDeltaPhi());}
246
247 ClassDef(AliAODDeltaPhiCut,1)
248};
249/******************************************************************/
250
b4fb427e 251class AliAODDeltaThetaCut: public AliAODPairBaseCut
78d7c6d3 252{
253 public:
254 AliAODDeltaThetaCut(Double_t min = 0.0, Double_t max = 0.0):
b4fb427e 255 AliAODPairBaseCut(min,max,kHbtPairCutPropDeltaTheta){}
78d7c6d3 256 virtual ~AliAODDeltaThetaCut(){}
257 protected:
258 virtual Double_t GetValue(AliAODPair* pair) const
259 {return TMath::Abs(pair->GetDeltaTheta());}
260
261 ClassDef(AliAODDeltaThetaCut,1)
262};
263/******************************************************************/
264
b4fb427e 265class AliAODCluterOverlapCut: public AliAODPairBaseCut
78d7c6d3 266{
267 public:
268 AliAODCluterOverlapCut(Double_t min = 0.0, Double_t max = 1e5):
b4fb427e 269 AliAODPairBaseCut(min,max,kHbtPairCutPropClOverlap){}
78d7c6d3 270 virtual ~AliAODCluterOverlapCut(){}
271
272 protected:
273 virtual Double_t GetValue(AliAODPair* pair) const;
274 ClassDef(AliAODCluterOverlapCut,1)
275};
276/******************************************************************/
277
b4fb427e 278class AliAODAvSeparationCut: public AliAODPairBaseCut
78d7c6d3 279{
280 public:
281 AliAODAvSeparationCut(Double_t min = 0.0, Double_t max = 1e5):
b4fb427e 282 AliAODPairBaseCut(min,max,kHbtPairCutPropAvSepar){}
78d7c6d3 283 virtual ~AliAODAvSeparationCut(){}
284
285 protected:
286 virtual Double_t GetValue(AliAODPair* pair) const;
287 ClassDef(AliAODAvSeparationCut,1)
288};
289/******************************************************************/
290
b4fb427e 291class AliAODSeparationCut: public AliAODPairBaseCut
78d7c6d3 292{
293 public:
294 AliAODSeparationCut(Double_t min = 0.0, Double_t max = 1e5, Int_t point = 0):
b4fb427e 295 AliAODPairBaseCut(min,max,kHbtPairCutPropSepar),fPoint(point){}
78d7c6d3 296 virtual ~AliAODSeparationCut(){}
297
298 protected:
299 Int_t fPoint;//index of the point that distance should be measured
300 virtual Double_t GetValue(AliAODPair* pair) const;
301 ClassDef(AliAODSeparationCut,1)
302};
303/******************************************************************/
304
b4fb427e 305class AliAODITSSeparationCut: public AliAODPairBaseCut
78d7c6d3 306{
307//Anti merging cut for the first layer of pixels
308 public:
309 AliAODITSSeparationCut(Int_t layer = 0, Double_t deltarphi = 0.01, Double_t deltaz = 0.08):
b4fb427e 310 AliAODPairBaseCut(deltarphi,deltaz,kHbtPairCutPropPixelSepar),fLayer(layer){}
78d7c6d3 311 virtual ~AliAODITSSeparationCut(){}
312 Bool_t Pass(AliAODPair* pair) const;
313 Int_t GetLayer() const {return fLayer;}
314 protected:
315 Int_t fLayer;//index of the layer that distance should be measured 0: 1st pixels
316 virtual Double_t GetValue(AliAODPair* /*pair*/) const {return 0.0;}//not used
317 ClassDef(AliAODITSSeparationCut,1)
318};
319/******************************************************************/
320
b4fb427e 321class AliAODOutSideSameSignCut: public AliAODPairBaseCut
78d7c6d3 322{
323 public:
324 AliAODOutSideSameSignCut(){}
325 virtual ~AliAODOutSideSameSignCut(){}
326 virtual Bool_t Pass(AliAODPair *p) const;
327 protected:
328 virtual Double_t GetValue(AliAODPair* /*pair*/) const {return 0.0;}
329 ClassDef(AliAODOutSideSameSignCut,1)
330};
331/******************************************************************/
332
b4fb427e 333class AliAODOutSideDiffSignCut: public AliAODPairBaseCut
78d7c6d3 334{
335 public:
336 AliAODOutSideDiffSignCut(){}
337 virtual ~AliAODOutSideDiffSignCut(){}
338 virtual Bool_t Pass(AliAODPair *p) const;
339 protected:
340 virtual Double_t GetValue(AliAODPair* /*pair*/) const {return 0.0;}
341 ClassDef(AliAODOutSideDiffSignCut,1)
342};
343/******************************************************************/
344
b4fb427e 345class AliAODLogicalOperPairCut: public AliAODPairBaseCut
78d7c6d3 346 {
347 public:
348 AliAODLogicalOperPairCut();
b4fb427e 349 AliAODLogicalOperPairCut(AliAODPairBaseCut* first, AliAODPairBaseCut* second);
78d7c6d3 350 virtual ~AliAODLogicalOperPairCut();
351 protected:
352 Double_t GetValue(AliAODPair * /*pair*/) const {MayNotUse("GetValue");return 0.0;}
353
b4fb427e 354 AliAODPairBaseCut* fFirst; //second cut
355 AliAODPairBaseCut* fSecond; //first cut
78d7c6d3 356 private:
b4fb427e 357 class AliAODDummyBasePairCut: public AliAODPairBaseCut
78d7c6d3 358 {
359 Double_t GetValue(AliAODPair* /*pair*/) const {return 0.0;}
360 Bool_t Pass(AliAODPair* /*pair*/) const;
361 };
362
363 ClassDef(AliAODLogicalOperPairCut,1)
364 };
365/******************************************************************/
366
367class AliAODOrPairCut: public AliAODLogicalOperPairCut
368{
369 public:
370 AliAODOrPairCut(){}
b4fb427e 371 AliAODOrPairCut(AliAODPairBaseCut* first, AliAODPairBaseCut* second):AliAODLogicalOperPairCut(first,second){}
78d7c6d3 372 virtual ~AliAODOrPairCut(){}
373 Bool_t Pass(AliAODPair *p) const;
374 ClassDef(AliAODOrPairCut,1)
375};
376/******************************************************************/
377
378class AliAODAndPairCut: public AliAODLogicalOperPairCut
379{
380 public:
381 AliAODAndPairCut(){}
b4fb427e 382 AliAODAndPairCut(AliAODPairBaseCut* first, AliAODPairBaseCut* second):AliAODLogicalOperPairCut(first,second){}
78d7c6d3 383 virtual ~AliAODAndPairCut(){}
384 Bool_t Pass(AliAODPair *p) const;
385 ClassDef(AliAODAndPairCut,1)
386};
387
388#endif