Two Particle Function -> One Pair; FourPart -> TwoPair
[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
13
14class AliHBTAnalysis;
15
16class AliHBTFunction: public TNamed
17//Abstract base class for HBT functions
18{
19 public:
20 AliHBTFunction();
856180e9 21 virtual ~AliHBTFunction();
1b446896 22
23 virtual TH1* GetNumerator() =0;
24 virtual TH1* GetDenominator() =0;
25 virtual TH1* GetResult() = 0;
976183fd 26
1b446896 27 virtual void Write();
28
29 TH1* GetRatio(Double_t normfactor = 1.0);
30 void Rename(const Char_t * name); //renames the function and histograms ==title is the same that name
31 void Rename(const Char_t * name, const Char_t * title); //renames and retitle the function and histograms
32
33 void SetPairCut(AliHBTPairCut*);
34
35 virtual AliHBTPair* CheckPair(AliHBTPair* pair);
36
37 protected:
38
39 AliHBTPairCut* fPairCut;
40
41 public:
42 ClassDef(AliHBTFunction,1)
43};
976183fd 44/******************************************************************/
1b446896 45inline AliHBTPair* AliHBTFunction::CheckPair(AliHBTPair* pair)
46{
47 //check if pair and both particles meets the cut criteria
48 if(fPairCut->Pass(pair)) //if the pair is BAD
49 {//it is BAD
50 pair = pair->GetSwapedPair();
51 if(fPairCut->Pass(pair)) //so try reverse combination
52 {
53 return 0x0;//it is BAD as well - so return
54 }
55 }
56 return pair;
57}
58
1b446896 59/******************************************************************/
60/******************************************************************/
61/******************************************************************/
27b3fe5d 62class AliHBTOnePairFctn: public AliHBTFunction
1b446896 63{
64 public:
27b3fe5d 65 AliHBTOnePairFctn(){}
66 virtual ~AliHBTOnePairFctn(){}
1b446896 67
68 virtual void ProcessSameEventParticles(AliHBTPair* pair) = 0;
69 virtual void ProcessDiffEventParticles(AliHBTPair* pair) = 0;
976183fd 70
71
1b446896 72
73 protected:
74 public:
27b3fe5d 75 ClassDef(AliHBTOnePairFctn,1)
1b446896 76
77};
78/******************************************************************/
79/******************************************************************/
80/******************************************************************/
27b3fe5d 81class AliHBTTwoPairFctn: public AliHBTFunction
1b446896 82{
83 public:
27b3fe5d 84 AliHBTTwoPairFctn(){};
85 virtual ~AliHBTTwoPairFctn(){};
1b446896 86
87 virtual void
88 ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair) = 0;
89 virtual void
90 ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair) = 0;
976183fd 91
1b446896 92
93 protected:
94 public:
27b3fe5d 95 ClassDef(AliHBTTwoPairFctn,1)
1b446896 96
97};
98/******************************************************************/
99/******************************************************************/
100/******************************************************************/
101
102
27b3fe5d 103class AliHBTOnePairFctn1D: public AliHBTOnePairFctn
1b446896 104{
105 public:
27b3fe5d 106 AliHBTOnePairFctn1D(Int_t nbins = 100, Double_t maxXval = 0.15, Double_t minXval = 0.0);
107 virtual ~AliHBTOnePairFctn1D();
1b446896 108
109
110 TH1* GetNumerator(){return fNumerator;}
111 TH1* GetDenominator(){return fDenominator;}
112
113 void ProcessSameEventParticles(AliHBTPair* pair);
114 void ProcessDiffEventParticles(AliHBTPair* pair);
976183fd 115 Double_t Scale();
116 void SetNumberOfBinsToScale();
1b446896 117 protected:
118 //retruns velue to be histogrammed
119 virtual Double_t GetValue(AliHBTPair* pair) = 0;
976183fd 120
1b446896 121 TH1D* fNumerator;
122 TH1D* fDenominator;
976183fd 123 Int_t fNBinsToScale;
1b446896 124
125 public:
27b3fe5d 126 ClassDef(AliHBTOnePairFctn1D,2)
1b446896 127};
128
1b446896 129/******************************************************************/
130/******************************************************************/
131/******************************************************************/
132
27b3fe5d 133class AliHBTOnePairFctn2D: public AliHBTOnePairFctn
1b446896 134{
135 public:
27b3fe5d 136 AliHBTOnePairFctn2D(Int_t nXbins = 200, Double_t maxXval = 1.5, Double_t minXval = 0.0,
1b446896 137 Int_t nYbins = 200, Double_t maxYval = .15, Double_t minYval =-0.15);
27b3fe5d 138 ~AliHBTOnePairFctn2D();
1b446896 139
140 TH1* GetNumerator(){return fNumerator;}
141 TH1* GetDenominator(){return fDenominator;}
142
143 void ProcessSameEventParticles(AliHBTPair* pair);
144 void ProcessDiffEventParticles(AliHBTPair* pair);
145
976183fd 146
1b446896 147 protected:
976183fd 148 virtual void GetValues(AliHBTPair* pair, Double_t&, Double_t&) = 0;
149
1b446896 150 TH2D* fNumerator;
151 TH2D* fDenominator;
152
153 public:
27b3fe5d 154 ClassDef(AliHBTOnePairFctn2D,1)
1b446896 155};
156/******************************************************************/
157/******************************************************************/
158/******************************************************************/
159
27b3fe5d 160class AliHBTOnePairFctn3D: public AliHBTOnePairFctn
1b446896 161{
162 public:
27b3fe5d 163 AliHBTOnePairFctn3D(Int_t nXbins = 200, Double_t maxXval = 1.5, Double_t minXval = 0.0,
1b446896 164 Int_t nYbins = 200, Double_t maxYval = .15, Double_t minYval =-0.15,
165 Int_t nZbins = 200, Double_t maxZval = .15, Double_t minZval =-0.15);
166
27b3fe5d 167 virtual ~AliHBTOnePairFctn3D();
1b446896 168
169 TH1* GetNumerator(){return fNumerator;}
170 TH1* GetDenominator(){return fDenominator;}
171
172 protected:
173 TH3D* fNumerator;
174 TH3D* fDenominator;
175 public:
27b3fe5d 176 ClassDef(AliHBTOnePairFctn3D,1)
1b446896 177};
178/******************************************************************/
179/******************************************************************/
180/******************************************************************/
181
182
183
184/******************************************************************/
185/******************************************************************/
186/******************************************************************/
27b3fe5d 187class AliHBTTwoPairFctn2D: public AliHBTTwoPairFctn
1b446896 188{
189 public:
27b3fe5d 190 AliHBTTwoPairFctn2D(Int_t nXbins = 200, Double_t maxXval = 1.5, Double_t minXval = 0.0,
1b446896 191 Int_t nYbins = 200, Double_t maxYval = .15, Double_t minYval =-0.15);
27b3fe5d 192 ~AliHBTTwoPairFctn2D();
1b446896 193
194 TH1* GetNumerator(){return fNumerator;}
195 TH1* GetDenominator(){return fDenominator;}
196
197 void ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair);
198 void ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair);
199
1b446896 200
201 protected:
976183fd 202 virtual void GetValues(AliHBTPair*,AliHBTPair*, Double_t&, Double_t&) = 0;
203
1b446896 204 TH2D* fNumerator;
205 TH2D* fDenominator;
206
207 public:
27b3fe5d 208 ClassDef(AliHBTTwoPairFctn2D,1)
1b446896 209};
210
211
212/******************************************************************/
213/******************************************************************/
214/******************************************************************/
215
216/******************************************************************/
217/******************************************************************/
218/******************************************************************/
219
220
221
222#endif