Replaces possible "/" by "_" in the headerFile name to make the folders properly...
[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();
52 if(fPairCut->Pass(pair)) //so try reverse combination
53 {
54 return 0x0;//it is BAD as well - so return
55 }
56 }
57 return pair;
58}
59
1b446896 60/******************************************************************/
61/******************************************************************/
62/******************************************************************/
27b3fe5d 63class AliHBTOnePairFctn: public AliHBTFunction
1b446896 64{
65 public:
27b3fe5d 66 AliHBTOnePairFctn(){}
ba95ae3f 67 AliHBTOnePairFctn(const Char_t *name, const Char_t *title):AliHBTFunction(name,title){}
27b3fe5d 68 virtual ~AliHBTOnePairFctn(){}
1b446896 69
70 virtual void ProcessSameEventParticles(AliHBTPair* pair) = 0;
71 virtual void ProcessDiffEventParticles(AliHBTPair* pair) = 0;
976183fd 72
73
1b446896 74
75 protected:
76 public:
27b3fe5d 77 ClassDef(AliHBTOnePairFctn,1)
1b446896 78
79};
80/******************************************************************/
81/******************************************************************/
82/******************************************************************/
27b3fe5d 83class AliHBTTwoPairFctn: public AliHBTFunction
1b446896 84{
85 public:
27b3fe5d 86 AliHBTTwoPairFctn(){};
ba95ae3f 87 AliHBTTwoPairFctn(const Char_t *name, const Char_t *title):AliHBTFunction(name,title){}
27b3fe5d 88 virtual ~AliHBTTwoPairFctn(){};
1b446896 89
90 virtual void
91 ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair) = 0;
92 virtual void
93 ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair) = 0;
976183fd 94
1b446896 95
96 protected:
97 public:
27b3fe5d 98 ClassDef(AliHBTTwoPairFctn,1)
1b446896 99
100};
101/******************************************************************/
102/******************************************************************/
103/******************************************************************/
104
105
27b3fe5d 106class AliHBTOnePairFctn1D: public AliHBTOnePairFctn
1b446896 107{
108 public:
ba95ae3f 109 AliHBTOnePairFctn1D();
110 AliHBTOnePairFctn1D(Int_t nbins, Double_t maxXval, Double_t minXval);
111 AliHBTOnePairFctn1D(const Char_t *name, const Char_t *title,
112 Int_t nbins = 100, Double_t maxXval = 0.15, Double_t minXval = 0.0);
27b3fe5d 113 virtual ~AliHBTOnePairFctn1D();
1b446896 114
115
116 TH1* GetNumerator(){return fNumerator;}
117 TH1* GetDenominator(){return fDenominator;}
118
119 void ProcessSameEventParticles(AliHBTPair* pair);
120 void ProcessDiffEventParticles(AliHBTPair* pair);
976183fd 121 Double_t Scale();
122 void SetNumberOfBinsToScale();
1b446896 123 protected:
124 //retruns velue to be histogrammed
125 virtual Double_t GetValue(AliHBTPair* pair) = 0;
976183fd 126
1b446896 127 TH1D* fNumerator;
128 TH1D* fDenominator;
976183fd 129 Int_t fNBinsToScale;
1b446896 130
131 public:
27b3fe5d 132 ClassDef(AliHBTOnePairFctn1D,2)
1b446896 133};
134
1b446896 135/******************************************************************/
136/******************************************************************/
137/******************************************************************/
ba95ae3f 138
27b3fe5d 139class AliHBTOnePairFctn2D: public AliHBTOnePairFctn
1b446896 140{
141 public:
27b3fe5d 142 AliHBTOnePairFctn2D(Int_t nXbins = 200, Double_t maxXval = 1.5, Double_t minXval = 0.0,
1b446896 143 Int_t nYbins = 200, Double_t maxYval = .15, Double_t minYval =-0.15);
27b3fe5d 144 ~AliHBTOnePairFctn2D();
1b446896 145
146 TH1* GetNumerator(){return fNumerator;}
147 TH1* GetDenominator(){return fDenominator;}
148
149 void ProcessSameEventParticles(AliHBTPair* pair);
150 void ProcessDiffEventParticles(AliHBTPair* pair);
151
976183fd 152
1b446896 153 protected:
976183fd 154 virtual void GetValues(AliHBTPair* pair, Double_t&, Double_t&) = 0;
155
1b446896 156 TH2D* fNumerator;
157 TH2D* fDenominator;
158
159 public:
27b3fe5d 160 ClassDef(AliHBTOnePairFctn2D,1)
1b446896 161};
162/******************************************************************/
163/******************************************************************/
164/******************************************************************/
165
27b3fe5d 166class AliHBTOnePairFctn3D: public AliHBTOnePairFctn
1b446896 167{
168 public:
27b3fe5d 169 AliHBTOnePairFctn3D(Int_t nXbins = 200, Double_t maxXval = 1.5, Double_t minXval = 0.0,
1b446896 170 Int_t nYbins = 200, Double_t maxYval = .15, Double_t minYval =-0.15,
171 Int_t nZbins = 200, Double_t maxZval = .15, Double_t minZval =-0.15);
172
27b3fe5d 173 virtual ~AliHBTOnePairFctn3D();
1b446896 174
175 TH1* GetNumerator(){return fNumerator;}
176 TH1* GetDenominator(){return fDenominator;}
177
178 protected:
179 TH3D* fNumerator;
180 TH3D* fDenominator;
181 public:
27b3fe5d 182 ClassDef(AliHBTOnePairFctn3D,1)
1b446896 183};
184/******************************************************************/
185/******************************************************************/
186/******************************************************************/
187
ba95ae3f 188class AliHBTTwoPairFctn1D: public AliHBTTwoPairFctn
189{
190 public:
191 AliHBTTwoPairFctn1D(Int_t nbins = 200, Double_t maxval = 1.5, Double_t minval = 0.0);
192 AliHBTTwoPairFctn1D(const char*,const char*,
193 Int_t nbins = 200, Double_t maxval = 1.5, Double_t minval = 0.0);
194 ~AliHBTTwoPairFctn1D();
195
196 TH1* GetNumerator(){return fNumerator;}
197 TH1* GetDenominator(){return fDenominator;}
198
199 void ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair);
200 void ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair);
201
202 protected:
203 virtual Double_t GetValue(AliHBTPair* trackpair, AliHBTPair* partpair) = 0;
204
205 TH1D* fNumerator;
206 TH1D* fDenominator;
207
208 public:
209 ClassDef(AliHBTTwoPairFctn1D,1)
210};
1b446896 211
212
213/******************************************************************/
214/******************************************************************/
215/******************************************************************/
27b3fe5d 216class AliHBTTwoPairFctn2D: public AliHBTTwoPairFctn
1b446896 217{
218 public:
27b3fe5d 219 AliHBTTwoPairFctn2D(Int_t nXbins = 200, Double_t maxXval = 1.5, Double_t minXval = 0.0,
1b446896 220 Int_t nYbins = 200, Double_t maxYval = .15, Double_t minYval =-0.15);
ba95ae3f 221 virtual ~AliHBTTwoPairFctn2D();
1b446896 222
223 TH1* GetNumerator(){return fNumerator;}
224 TH1* GetDenominator(){return fDenominator;}
225
226 void ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair);
227 void ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair);
228
1b446896 229
230 protected:
976183fd 231 virtual void GetValues(AliHBTPair*,AliHBTPair*, Double_t&, Double_t&) = 0;
232
1b446896 233 TH2D* fNumerator;
234 TH2D* fDenominator;
235
236 public:
27b3fe5d 237 ClassDef(AliHBTTwoPairFctn2D,1)
1b446896 238};
239
240
241/******************************************************************/
242/******************************************************************/
243/******************************************************************/
ba95ae3f 244class AliHBTTwoPairFctn3D: public AliHBTTwoPairFctn
245{
246 public:
247 AliHBTTwoPairFctn3D(Int_t nXbins = 200, Double_t maxXval = 1.5, Double_t minXval = 0.0,
248 Int_t nYbins = 200, Double_t maxYval = .15, Double_t minYval =-0.15,
249 Int_t nZbins = 200, Double_t maxZval = .15, Double_t minZval =-0.15){}
250 virtual ~AliHBTTwoPairFctn3D(){}
251
252 TH1* GetNumerator(){return fNumerator;}
253 TH1* GetDenominator(){return fDenominator;}
254
255 void ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair);
256 void ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair);
257
258
259 protected:
260 virtual void GetValues(AliHBTPair*,AliHBTPair*, Double_t&, Double_t&,Double_t&) = 0;
261
262 TH3D* fNumerator;
263 TH3D* fDenominator;
264
265 public:
266 ClassDef(AliHBTTwoPairFctn3D,1)
267};
1b446896 268
269/******************************************************************/
270/******************************************************************/
271/******************************************************************/
272
273
274
275#endif