ReaderInternal: Internal data format implementation
[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);
27b3fe5d 145 ~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);
195 ~AliHBTTwoPairFctn1D();
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);
202
203 protected:
204 virtual Double_t GetValue(AliHBTPair* trackpair, AliHBTPair* partpair) = 0;
205
206 TH1D* fNumerator;
207 TH1D* fDenominator;
208
209 public:
210 ClassDef(AliHBTTwoPairFctn1D,1)
211};
1b446896 212
213
214/******************************************************************/
215/******************************************************************/
216/******************************************************************/
27b3fe5d 217class AliHBTTwoPairFctn2D: public AliHBTTwoPairFctn
1b446896 218{
219 public:
27b3fe5d 220 AliHBTTwoPairFctn2D(Int_t nXbins = 200, Double_t maxXval = 1.5, Double_t minXval = 0.0,
1b446896 221 Int_t nYbins = 200, Double_t maxYval = .15, Double_t minYval =-0.15);
ba95ae3f 222 virtual ~AliHBTTwoPairFctn2D();
1b446896 223
224 TH1* GetNumerator(){return fNumerator;}
225 TH1* GetDenominator(){return fDenominator;}
226
227 void ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair);
228 void ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair);
229
1b446896 230
231 protected:
976183fd 232 virtual void GetValues(AliHBTPair*,AliHBTPair*, Double_t&, Double_t&) = 0;
233
1b446896 234 TH2D* fNumerator;
235 TH2D* fDenominator;
236
237 public:
27b3fe5d 238 ClassDef(AliHBTTwoPairFctn2D,1)
1b446896 239};
240
241
242/******************************************************************/
243/******************************************************************/
244/******************************************************************/
ba95ae3f 245class AliHBTTwoPairFctn3D: public AliHBTTwoPairFctn
246{
247 public:
248 AliHBTTwoPairFctn3D(Int_t nXbins = 200, Double_t maxXval = 1.5, Double_t minXval = 0.0,
249 Int_t nYbins = 200, Double_t maxYval = .15, Double_t minYval =-0.15,
250 Int_t nZbins = 200, Double_t maxZval = .15, Double_t minZval =-0.15){}
251 virtual ~AliHBTTwoPairFctn3D(){}
252
253 TH1* GetNumerator(){return fNumerator;}
254 TH1* GetDenominator(){return fDenominator;}
255
256 void ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair);
257 void ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair);
258
259
260 protected:
261 virtual void GetValues(AliHBTPair*,AliHBTPair*, Double_t&, Double_t&,Double_t&) = 0;
262
263 TH3D* fNumerator;
264 TH3D* fDenominator;
265
266 public:
267 ClassDef(AliHBTTwoPairFctn3D,1)
268};
1b446896 269
270/******************************************************************/
271/******************************************************************/
272/******************************************************************/
273
274
275
276#endif