Abs for Q side, long, out
[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
5a9432a9 13
1b446896 14class AliHBTAnalysis;
15
16class AliHBTFunction: public TNamed
17//Abstract base class for HBT functions
5a9432a9 18//
1b446896 19{
20 public:
21 AliHBTFunction();
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(){}
67 virtual ~AliHBTOnePairFctn(){}
1b446896 68
69 virtual void ProcessSameEventParticles(AliHBTPair* pair) = 0;
70 virtual void ProcessDiffEventParticles(AliHBTPair* pair) = 0;
976183fd 71
72
1b446896 73
74 protected:
75 public:
27b3fe5d 76 ClassDef(AliHBTOnePairFctn,1)
1b446896 77
78};
79/******************************************************************/
80/******************************************************************/
81/******************************************************************/
27b3fe5d 82class AliHBTTwoPairFctn: public AliHBTFunction
1b446896 83{
84 public:
27b3fe5d 85 AliHBTTwoPairFctn(){};
86 virtual ~AliHBTTwoPairFctn(){};
1b446896 87
88 virtual void
89 ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair) = 0;
90 virtual void
91 ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair) = 0;
976183fd 92
1b446896 93
94 protected:
95 public:
27b3fe5d 96 ClassDef(AliHBTTwoPairFctn,1)
1b446896 97
98};
99/******************************************************************/
100/******************************************************************/
101/******************************************************************/
102
103
27b3fe5d 104class AliHBTOnePairFctn1D: public AliHBTOnePairFctn
1b446896 105{
106 public:
27b3fe5d 107 AliHBTOnePairFctn1D(Int_t nbins = 100, Double_t maxXval = 0.15, Double_t minXval = 0.0);
108 virtual ~AliHBTOnePairFctn1D();
1b446896 109
110
111 TH1* GetNumerator(){return fNumerator;}
112 TH1* GetDenominator(){return fDenominator;}
113
114 void ProcessSameEventParticles(AliHBTPair* pair);
115 void ProcessDiffEventParticles(AliHBTPair* pair);
976183fd 116 Double_t Scale();
117 void SetNumberOfBinsToScale();
1b446896 118 protected:
119 //retruns velue to be histogrammed
120 virtual Double_t GetValue(AliHBTPair* pair) = 0;
976183fd 121
1b446896 122 TH1D* fNumerator;
123 TH1D* fDenominator;
976183fd 124 Int_t fNBinsToScale;
1b446896 125
126 public:
27b3fe5d 127 ClassDef(AliHBTOnePairFctn1D,2)
1b446896 128};
129
1b446896 130/******************************************************************/
131/******************************************************************/
132/******************************************************************/
133
27b3fe5d 134class AliHBTOnePairFctn2D: public AliHBTOnePairFctn
1b446896 135{
136 public:
27b3fe5d 137 AliHBTOnePairFctn2D(Int_t nXbins = 200, Double_t maxXval = 1.5, Double_t minXval = 0.0,
1b446896 138 Int_t nYbins = 200, Double_t maxYval = .15, Double_t minYval =-0.15);
27b3fe5d 139 ~AliHBTOnePairFctn2D();
1b446896 140
141 TH1* GetNumerator(){return fNumerator;}
142 TH1* GetDenominator(){return fDenominator;}
143
144 void ProcessSameEventParticles(AliHBTPair* pair);
145 void ProcessDiffEventParticles(AliHBTPair* pair);
146
976183fd 147
1b446896 148 protected:
976183fd 149 virtual void GetValues(AliHBTPair* pair, Double_t&, Double_t&) = 0;
150
1b446896 151 TH2D* fNumerator;
152 TH2D* fDenominator;
153
154 public:
27b3fe5d 155 ClassDef(AliHBTOnePairFctn2D,1)
1b446896 156};
157/******************************************************************/
158/******************************************************************/
159/******************************************************************/
160
27b3fe5d 161class AliHBTOnePairFctn3D: public AliHBTOnePairFctn
1b446896 162{
163 public:
27b3fe5d 164 AliHBTOnePairFctn3D(Int_t nXbins = 200, Double_t maxXval = 1.5, Double_t minXval = 0.0,
1b446896 165 Int_t nYbins = 200, Double_t maxYval = .15, Double_t minYval =-0.15,
166 Int_t nZbins = 200, Double_t maxZval = .15, Double_t minZval =-0.15);
167
27b3fe5d 168 virtual ~AliHBTOnePairFctn3D();
1b446896 169
170 TH1* GetNumerator(){return fNumerator;}
171 TH1* GetDenominator(){return fDenominator;}
172
173 protected:
174 TH3D* fNumerator;
175 TH3D* fDenominator;
176 public:
27b3fe5d 177 ClassDef(AliHBTOnePairFctn3D,1)
1b446896 178};
179/******************************************************************/
180/******************************************************************/
181/******************************************************************/
182
183
184
185/******************************************************************/
186/******************************************************************/
187/******************************************************************/
27b3fe5d 188class AliHBTTwoPairFctn2D: public AliHBTTwoPairFctn
1b446896 189{
190 public:
27b3fe5d 191 AliHBTTwoPairFctn2D(Int_t nXbins = 200, Double_t maxXval = 1.5, Double_t minXval = 0.0,
1b446896 192 Int_t nYbins = 200, Double_t maxYval = .15, Double_t minYval =-0.15);
5a9432a9 193 ~AliHBTTwoPairFctn2D();
1b446896 194
195 TH1* GetNumerator(){return fNumerator;}
196 TH1* GetDenominator(){return fDenominator;}
197
198 void ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair);
199 void ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair);
200
1b446896 201
202 protected:
976183fd 203 virtual void GetValues(AliHBTPair*,AliHBTPair*, Double_t&, Double_t&) = 0;
204
1b446896 205 TH2D* fNumerator;
206 TH2D* fDenominator;
207
208 public:
27b3fe5d 209 ClassDef(AliHBTTwoPairFctn2D,1)
1b446896 210};
211
212
213/******************************************************************/
214/******************************************************************/
215/******************************************************************/
216
217/******************************************************************/
218/******************************************************************/
219/******************************************************************/
220
221
222
223#endif