Repristinating a working loadlibs.C
[u/mrichter/AliRoot.git] / HBTAN / AliHBTFunction.h
CommitLineData
1b446896 1//Piotr Skowronski@cern.ch
2
3#ifndef ALIHBTFUNCTION_H
4#define ALIHBTFUNCTION_H
5
6#include "AliHBTParticleCut.h"
7#include "AliHBTPairCut.h"
8#include "AliHBTPair.h"
9
10#include <TH2.h>
11#include <TH3.h>
12
ba95ae3f 13
1b446896 14class AliHBTAnalysis;
15
16class AliHBTFunction: public TNamed
17//Abstract base class for HBT functions
18{
19 public:
20 AliHBTFunction();
ba95ae3f 21 AliHBTFunction(const char* name,const char* title);
856180e9 22 virtual ~AliHBTFunction();
1b446896 23
24 virtual TH1* GetNumerator() =0;
25 virtual TH1* GetDenominator() =0;
26 virtual TH1* GetResult() = 0;
976183fd 27
1b446896 28 virtual void Write();
29
30 TH1* GetRatio(Double_t normfactor = 1.0);
31 void Rename(const Char_t * name); //renames the function and histograms ==title is the same that name
32 void Rename(const Char_t * name, const Char_t * title); //renames and retitle the function and histograms
33
34 void SetPairCut(AliHBTPairCut*);
35
36 virtual AliHBTPair* CheckPair(AliHBTPair* pair);
37
38 protected:
39
40 AliHBTPairCut* fPairCut;
41
42 public:
43 ClassDef(AliHBTFunction,1)
44};
976183fd 45/******************************************************************/
1b446896 46inline AliHBTPair* AliHBTFunction::CheckPair(AliHBTPair* pair)
47{
48 //check if pair and both particles meets the cut criteria
49 if(fPairCut->Pass(pair)) //if the pair is BAD
50 {//it is BAD
51 pair = pair->GetSwapedPair();
89bacf42 52 if(pair)
53 if(fPairCut->Pass(pair)) //so try reverse combination
54 {
55 return 0x0;//it is BAD as well - so return
56 }
1b446896 57 }
58 return pair;
59}
60
1b446896 61/******************************************************************/
62/******************************************************************/
63/******************************************************************/
27b3fe5d 64class AliHBTOnePairFctn: public AliHBTFunction
1b446896 65{
66 public:
27b3fe5d 67 AliHBTOnePairFctn(){}
ba95ae3f 68 AliHBTOnePairFctn(const Char_t *name, const Char_t *title):AliHBTFunction(name,title){}
27b3fe5d 69 virtual ~AliHBTOnePairFctn(){}
1b446896 70
71 virtual void ProcessSameEventParticles(AliHBTPair* pair) = 0;
72 virtual void ProcessDiffEventParticles(AliHBTPair* pair) = 0;
976183fd 73
74
1b446896 75
76 protected:
77 public:
27b3fe5d 78 ClassDef(AliHBTOnePairFctn,1)
1b446896 79
80};
81/******************************************************************/
82/******************************************************************/
83/******************************************************************/
27b3fe5d 84class AliHBTTwoPairFctn: public AliHBTFunction
1b446896 85{
86 public:
27b3fe5d 87 AliHBTTwoPairFctn(){};
ba95ae3f 88 AliHBTTwoPairFctn(const Char_t *name, const Char_t *title):AliHBTFunction(name,title){}
27b3fe5d 89 virtual ~AliHBTTwoPairFctn(){};
1b446896 90
91 virtual void
92 ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair) = 0;
93 virtual void
94 ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair) = 0;
976183fd 95
1b446896 96
97 protected:
98 public:
27b3fe5d 99 ClassDef(AliHBTTwoPairFctn,1)
1b446896 100
101};
102/******************************************************************/
103/******************************************************************/
104/******************************************************************/
105
106
27b3fe5d 107class AliHBTOnePairFctn1D: public AliHBTOnePairFctn
1b446896 108{
109 public:
ba95ae3f 110 AliHBTOnePairFctn1D();
111 AliHBTOnePairFctn1D(Int_t nbins, Double_t maxXval, Double_t minXval);
112 AliHBTOnePairFctn1D(const Char_t *name, const Char_t *title,
113 Int_t nbins = 100, Double_t maxXval = 0.15, Double_t minXval = 0.0);
27b3fe5d 114 virtual ~AliHBTOnePairFctn1D();
1b446896 115
116
117 TH1* GetNumerator(){return fNumerator;}
118 TH1* GetDenominator(){return fDenominator;}
119
120 void ProcessSameEventParticles(AliHBTPair* pair);
121 void ProcessDiffEventParticles(AliHBTPair* pair);
976183fd 122 Double_t Scale();
04cf16af 123 void SetNumberOfBinsToScale(Int_t n = 30){fNBinsToScale = n;}
1b446896 124 protected:
125 //retruns velue to be histogrammed
126 virtual Double_t GetValue(AliHBTPair* pair) = 0;
976183fd 127
1b446896 128 TH1D* fNumerator;
129 TH1D* fDenominator;
976183fd 130 Int_t fNBinsToScale;
1b446896 131
132 public:
27b3fe5d 133 ClassDef(AliHBTOnePairFctn1D,2)
1b446896 134};
135
1b446896 136/******************************************************************/
137/******************************************************************/
138/******************************************************************/
ba95ae3f 139
27b3fe5d 140class AliHBTOnePairFctn2D: public AliHBTOnePairFctn
1b446896 141{
142 public:
27b3fe5d 143 AliHBTOnePairFctn2D(Int_t nXbins = 200, Double_t maxXval = 1.5, Double_t minXval = 0.0,
1b446896 144 Int_t nYbins = 200, Double_t maxYval = .15, Double_t minYval =-0.15);
4ca0f301 145 virtual ~AliHBTOnePairFctn2D();
1b446896 146
147 TH1* GetNumerator(){return fNumerator;}
148 TH1* GetDenominator(){return fDenominator;}
149
150 void ProcessSameEventParticles(AliHBTPair* pair);
151 void ProcessDiffEventParticles(AliHBTPair* pair);
152
976183fd 153
1b446896 154 protected:
976183fd 155 virtual void GetValues(AliHBTPair* pair, Double_t&, Double_t&) = 0;
156
1b446896 157 TH2D* fNumerator;
158 TH2D* fDenominator;
159
160 public:
27b3fe5d 161 ClassDef(AliHBTOnePairFctn2D,1)
1b446896 162};
163/******************************************************************/
164/******************************************************************/
165/******************************************************************/
166
27b3fe5d 167class AliHBTOnePairFctn3D: public AliHBTOnePairFctn
1b446896 168{
169 public:
27b3fe5d 170 AliHBTOnePairFctn3D(Int_t nXbins = 200, Double_t maxXval = 1.5, Double_t minXval = 0.0,
1b446896 171 Int_t nYbins = 200, Double_t maxYval = .15, Double_t minYval =-0.15,
172 Int_t nZbins = 200, Double_t maxZval = .15, Double_t minZval =-0.15);
173
27b3fe5d 174 virtual ~AliHBTOnePairFctn3D();
1b446896 175
176 TH1* GetNumerator(){return fNumerator;}
177 TH1* GetDenominator(){return fDenominator;}
178
179 protected:
180 TH3D* fNumerator;
181 TH3D* fDenominator;
182 public:
27b3fe5d 183 ClassDef(AliHBTOnePairFctn3D,1)
1b446896 184};
185/******************************************************************/
186/******************************************************************/
187/******************************************************************/
188
ba95ae3f 189class AliHBTTwoPairFctn1D: public AliHBTTwoPairFctn
190{
191 public:
192 AliHBTTwoPairFctn1D(Int_t nbins = 200, Double_t maxval = 1.5, Double_t minval = 0.0);
193 AliHBTTwoPairFctn1D(const char*,const char*,
194 Int_t nbins = 200, Double_t maxval = 1.5, Double_t minval = 0.0);
4ca0f301 195 virtual ~AliHBTTwoPairFctn1D();
ba95ae3f 196
197 TH1* GetNumerator(){return fNumerator;}
198 TH1* GetDenominator(){return fDenominator;}
199
200 void ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair);
201 void ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair);
4e871a8a 202
203 Double_t Scale();
204 void SetNumberOfBinsToScale(Int_t n = 30){fNBinsToScale = n;}
ba95ae3f 205
206 protected:
207 virtual Double_t GetValue(AliHBTPair* trackpair, AliHBTPair* partpair) = 0;
208
209 TH1D* fNumerator;
210 TH1D* fDenominator;
4e871a8a 211
212 Int_t fNBinsToScale;
213
ba95ae3f 214 public:
215 ClassDef(AliHBTTwoPairFctn1D,1)
216};
1b446896 217
218
219/******************************************************************/
220/******************************************************************/
221/******************************************************************/
27b3fe5d 222class AliHBTTwoPairFctn2D: public AliHBTTwoPairFctn
1b446896 223{
224 public:
27b3fe5d 225 AliHBTTwoPairFctn2D(Int_t nXbins = 200, Double_t maxXval = 1.5, Double_t minXval = 0.0,
1b446896 226 Int_t nYbins = 200, Double_t maxYval = .15, Double_t minYval =-0.15);
ba95ae3f 227 virtual ~AliHBTTwoPairFctn2D();
1b446896 228
229 TH1* GetNumerator(){return fNumerator;}
230 TH1* GetDenominator(){return fDenominator;}
231
232 void ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair);
233 void ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair);
234
1b446896 235
236 protected:
976183fd 237 virtual void GetValues(AliHBTPair*,AliHBTPair*, Double_t&, Double_t&) = 0;
238
1b446896 239 TH2D* fNumerator;
240 TH2D* fDenominator;
241
242 public:
27b3fe5d 243 ClassDef(AliHBTTwoPairFctn2D,1)
1b446896 244};
245
246
247/******************************************************************/
248/******************************************************************/
249/******************************************************************/
ba95ae3f 250class AliHBTTwoPairFctn3D: public AliHBTTwoPairFctn
251{
252 public:
253 AliHBTTwoPairFctn3D(Int_t nXbins = 200, Double_t maxXval = 1.5, Double_t minXval = 0.0,
254 Int_t nYbins = 200, Double_t maxYval = .15, Double_t minYval =-0.15,
255 Int_t nZbins = 200, Double_t maxZval = .15, Double_t minZval =-0.15){}
256 virtual ~AliHBTTwoPairFctn3D(){}
257
258 TH1* GetNumerator(){return fNumerator;}
259 TH1* GetDenominator(){return fDenominator;}
260
261 void ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair);
262 void ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair);
263
264
265 protected:
266 virtual void GetValues(AliHBTPair*,AliHBTPair*, Double_t&, Double_t&,Double_t&) = 0;
267
268 TH3D* fNumerator;
269 TH3D* fDenominator;
270
271 public:
272 ClassDef(AliHBTTwoPairFctn3D,1)
273};
1b446896 274
275/******************************************************************/
276/******************************************************************/
277/******************************************************************/
278
279
280
281#endif