ReaderInternal: Internal data format implementation
[u/mrichter/AliRoot.git] / HBTAN / AliHBTPairCut.h
CommitLineData
1b446896 1//Piotr Skowronski@cern.ch
2//Class implemnts cut on the pair of particles
3//
4//more info: http://alisoft.cern.ch/people/skowron/analyzer/index.html
5
6#ifndef ALIHBTPAIRCUT_H
7#define ALIHBTPAIRCUT_H
8
9
10#include "AliHBTParticleCut.h"
11#include "AliHBTPair.h"
12
13class AliHbtBasePairCut;
14
15enum AliHBTPairCutProperty
16 {
17 kHbtPairCutPropQInv, //Q invariant
bce80f3b 18 kHbtPairCutPropKt,
2d5d4d7d 19 kHbtPairCutPropQSideCMSLC,
20 kHbtPairCutPropQOutCMSLC,
21 kHbtPairCutPropQLongCMSLC,
1b446896 22 kHbtPairCutPropNone
23 };
24
25class AliHBTPairCut: public TObject
26{
27 public:
28 AliHBTPairCut();
29 AliHBTPairCut(const AliHBTPairCut&);
30
31 virtual ~AliHBTPairCut();
32 virtual Bool_t Pass(AliHBTPair*);
33
34 void SetFirstPartCut(AliHBTParticleCut*); //sets the cut on the first particle
35 void SetSecondPartCut(AliHBTParticleCut*); //sets the cut on the first particle
36
37 void SetPartCut(AliHBTParticleCut*);//sets the the same cut on both particles
38
39 void AddBasePairCut(AliHbtBasePairCut*);
40
41 void SetQInvRange(Double_t min, Double_t max);
bce80f3b 42 void SetKtRange(Double_t min, Double_t max);
a37908e0 43 void SetQOutCMSLRange(Double_t min, Double_t max);
44 void SetQSideCMSLRange(Double_t min, Double_t max);
45 void SetQLongCMSLRange(Double_t min, Double_t max);
46
71dbe253 47 const AliHBTParticleCut* GetFirstPartCut() const {return fFirstPartCut;}
48 const AliHBTParticleCut* GetSecondPartCut() const {return fSecondPartCut;}
49
1b446896 50 protected:
51 AliHBTParticleCut* fFirstPartCut;
52 AliHBTParticleCut* fSecondPartCut;
53
54 AliHbtBasePairCut** fCuts; //!
55 Int_t fNCuts;
56
57
58 AliHbtBasePairCut* FindCut(AliHBTPairCutProperty);
59 private:
60 static const Int_t fkgMaxCuts;
61 public:
62 ClassDef(AliHBTPairCut,1)
63
64};
65/******************************************************************/
66/******************************************************************/
67/******************************************************************/
68
69class AliHBTEmptyPairCut: public AliHBTPairCut
70{
71//Empty - it passes possitively all particles - it means returns always False
72//Class describing cut on pairs of particles
73 public:
74 AliHBTEmptyPairCut(){};
75 AliHBTEmptyPairCut(const AliHBTEmptyPairCut&){};
76 virtual ~AliHBTEmptyPairCut(){};
77
78 Bool_t Pass(AliHBTPair*) {return kFALSE;} //accpept everything
79
80 ClassDef(AliHBTEmptyPairCut,1)
81
82};
83
84
85
86/******************************************************************/
87/******************************************************************/
88/******************************************************************/
89
90class AliHbtBasePairCut: public TObject
91 {
92 //This class defines the range of some property - pure virtual
93 //Property is coded by AliHBTCutTypes type
94
95 public:
96
97 AliHbtBasePairCut(Double_t min = 0.0, Double_t max = 0.0, AliHBTPairCutProperty prop= kHbtPairCutPropNone):
98 fMin(min),fMax(max),fProperty(prop){}
99
100 virtual ~AliHbtBasePairCut(){}
101
102 Bool_t Pass(AliHBTPair*);
103
104 void SetRange(Double_t min, Double_t max){fMin = min; fMax = max;}
105
106 void SetMinimum(Double_t min){fMin = min;}
107 void SetMaximum(Double_t max){fMax = max;}
108
109 Double_t GetMinimum() const {return fMin;}
110 Double_t GetMaximum() const {return fMax;}
111
112 AliHBTPairCutProperty GetProperty() const {return fProperty;}
113
114 protected:
115 virtual Double_t GetValue(AliHBTPair*) = 0;
116
117 Double_t fMin;
118 Double_t fMax;
119
120 AliHBTPairCutProperty fProperty;
121
122 private:
123 public:
124 ClassDef(AliHbtBasePairCut,1)
125
126 };
127
128inline Bool_t
129AliHbtBasePairCut::Pass(AliHBTPair* pair)
130 {
131 Double_t value = GetValue(pair);
132 if ( (value > fMin) && (value <fMax ) ) return kFALSE; //accepted
133 else return kTRUE; //rejected
134 }
135/******************************************************************/
136/******************************************************************/
137/******************************************************************/
138class AliHBTQInvCut: public AliHbtBasePairCut
139 {
140 public:
141 AliHBTQInvCut(Double_t min = 0.0, Double_t max = 0.0):AliHbtBasePairCut(min,max,kHbtPairCutPropQInv){}
142 virtual ~AliHBTQInvCut(){}
143 protected:
144 virtual Double_t GetValue(AliHBTPair* pair){return pair->GetQInv();}
145 private:
146 public:
147 ClassDef(AliHBTQInvCut,1)
148 };
149
bce80f3b 150
151class AliHBTKtCut: public AliHbtBasePairCut
152 {
153 public:
154 AliHBTKtCut(Double_t min = 0.0, Double_t max = 0.0):AliHbtBasePairCut(min,max,kHbtPairCutPropKt){}
155 virtual ~AliHBTKtCut(){}
156 protected:
157 virtual Double_t GetValue(AliHBTPair* pair){return pair->GetKt();}
158 private:
159 public:
160 ClassDef(AliHBTKtCut,1)
161 };
162
2d5d4d7d 163
164class AliHBTQSideCMSLCCut: public AliHbtBasePairCut
165 {
166 public:
167 AliHBTQSideCMSLCCut(Double_t min = 0.0, Double_t max = 0.0):
168 AliHbtBasePairCut(min,max,kHbtPairCutPropQSideCMSLC){}
169 virtual ~AliHBTQSideCMSLCCut(){}
170 protected:
171 virtual Double_t GetValue(AliHBTPair* pair){return pair->GetQSideCMSLC();}
172 private:
173 public:
174 ClassDef(AliHBTQSideCMSLCCut,1)
175 };
176
177
178class AliHBTQOutCMSLCCut: public AliHbtBasePairCut
179 {
180 public:
181 AliHBTQOutCMSLCCut(Double_t min = 0.0, Double_t max = 0.0):
182 AliHbtBasePairCut(min,max,kHbtPairCutPropQOutCMSLC){}
183 virtual ~AliHBTQOutCMSLCCut(){}
184 protected:
185 virtual Double_t GetValue(AliHBTPair* pair){return pair->GetQOutCMSLC();}
186 private:
187 public:
188 ClassDef(AliHBTQOutCMSLCCut,1)
189 };
190
191class AliHBTQLongCMSLCCut: public AliHbtBasePairCut
192 {
193 public:
194 AliHBTQLongCMSLCCut(Double_t min = 0.0, Double_t max = 0.0):
195 AliHbtBasePairCut(min,max,kHbtPairCutPropQLongCMSLC){}
196 virtual ~AliHBTQLongCMSLCCut(){}
197 protected:
198 virtual Double_t GetValue(AliHBTPair* pair){return pair->GetQLongCMSLC();}
199 private:
200 public:
201 ClassDef(AliHBTQLongCMSLCCut,1)
202 };
203
1b446896 204#endif