]>
Commit | Line | Data |
---|---|---|
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 | ||
14 | class AliHBTAnalysis; | |
15 | ||
16 | class AliHBTFunction: public TNamed | |
17 | //Abstract base class for HBT functions | |
18 | { | |
19 | public: | |
20 | AliHBTFunction(); | |
21 | virtual ~AliHBTFunction(){} | |
22 | ||
23 | virtual TH1* GetNumerator() =0; | |
24 | virtual TH1* GetDenominator() =0; | |
25 | virtual TH1* GetResult() = 0; | |
26 | ||
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 | }; | |
44 | inline AliHBTPair* AliHBTFunction::CheckPair(AliHBTPair* pair) | |
45 | { | |
46 | //check if pair and both particles meets the cut criteria | |
47 | if(fPairCut->Pass(pair)) //if the pair is BAD | |
48 | {//it is BAD | |
49 | pair = pair->GetSwapedPair(); | |
50 | if(fPairCut->Pass(pair)) //so try reverse combination | |
51 | { | |
52 | return 0x0;//it is BAD as well - so return | |
53 | } | |
54 | } | |
55 | return pair; | |
56 | } | |
57 | ||
58 | ||
59 | ||
60 | /******************************************************************/ | |
61 | /******************************************************************/ | |
62 | /******************************************************************/ | |
63 | class AliHBTTwoPartFctn: public AliHBTFunction | |
64 | { | |
65 | public: | |
66 | AliHBTTwoPartFctn(){} | |
67 | virtual ~AliHBTTwoPartFctn(){} | |
68 | ||
69 | virtual void ProcessSameEventParticles(AliHBTPair* pair) = 0; | |
70 | virtual void ProcessDiffEventParticles(AliHBTPair* pair) = 0; | |
71 | ||
72 | ||
73 | protected: | |
74 | public: | |
75 | ClassDef(AliHBTTwoPartFctn,1) | |
76 | ||
77 | }; | |
78 | /******************************************************************/ | |
79 | /******************************************************************/ | |
80 | /******************************************************************/ | |
81 | class AliHBTFourPartFctn: public AliHBTFunction | |
82 | { | |
83 | public: | |
84 | AliHBTFourPartFctn(){}; | |
85 | virtual ~AliHBTFourPartFctn(){}; | |
86 | ||
87 | virtual void | |
88 | ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair) = 0; | |
89 | virtual void | |
90 | ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair) = 0; | |
91 | ||
92 | protected: | |
93 | public: | |
94 | ClassDef(AliHBTFourPartFctn,1) | |
95 | ||
96 | }; | |
97 | /******************************************************************/ | |
98 | /******************************************************************/ | |
99 | /******************************************************************/ | |
100 | ||
101 | ||
102 | class AliHBTTwoPartFctn1D: public AliHBTTwoPartFctn | |
103 | { | |
104 | public: | |
105 | AliHBTTwoPartFctn1D(Int_t nbins = 100, Double_t maxXval = 0.15, Double_t minXval = 0.0); | |
106 | virtual ~AliHBTTwoPartFctn1D(); | |
107 | ||
108 | ||
109 | TH1* GetNumerator(){return fNumerator;} | |
110 | TH1* GetDenominator(){return fDenominator;} | |
111 | ||
112 | void ProcessSameEventParticles(AliHBTPair* pair); | |
113 | void ProcessDiffEventParticles(AliHBTPair* pair); | |
114 | ||
115 | protected: | |
116 | //retruns velue to be histogrammed | |
117 | virtual Double_t GetValue(AliHBTPair* pair) = 0; | |
118 | ||
119 | TH1D* fNumerator; | |
120 | TH1D* fDenominator; | |
121 | ||
122 | public: | |
123 | ClassDef(AliHBTTwoPartFctn1D,1) | |
124 | }; | |
125 | ||
126 | inline void | |
127 | AliHBTTwoPartFctn1D::ProcessSameEventParticles(AliHBTPair* pair) | |
128 | { | |
129 | //Fills the numerator | |
130 | pair = CheckPair(pair); | |
131 | if(pair) fNumerator->Fill(GetValue(pair)); | |
132 | } | |
133 | ||
134 | ||
135 | inline void | |
136 | AliHBTTwoPartFctn1D::ProcessDiffEventParticles(AliHBTPair* pair) | |
137 | { | |
138 | //fills denumerator | |
139 | pair = CheckPair(pair); | |
140 | if(pair) fDenominator->Fill(GetValue(pair)); | |
141 | ||
142 | } | |
143 | /******************************************************************/ | |
144 | /******************************************************************/ | |
145 | /******************************************************************/ | |
146 | ||
147 | class AliHBTTwoPartFctn2D: public AliHBTTwoPartFctn | |
148 | { | |
149 | public: | |
150 | AliHBTTwoPartFctn2D(Int_t nXbins = 200, Double_t maxXval = 1.5, Double_t minXval = 0.0, | |
151 | Int_t nYbins = 200, Double_t maxYval = .15, Double_t minYval =-0.15); | |
152 | ~AliHBTTwoPartFctn2D(); | |
153 | ||
154 | TH1* GetNumerator(){return fNumerator;} | |
155 | TH1* GetDenominator(){return fDenominator;} | |
156 | ||
157 | void ProcessSameEventParticles(AliHBTPair* pair); | |
158 | void ProcessDiffEventParticles(AliHBTPair* pair); | |
159 | ||
160 | virtual void GetValues(AliHBTPair* pair, Double_t&, Double_t&) = 0; | |
161 | ||
162 | protected: | |
163 | TH2D* fNumerator; | |
164 | TH2D* fDenominator; | |
165 | ||
166 | public: | |
167 | ClassDef(AliHBTTwoPartFctn2D,1) | |
168 | }; | |
169 | /******************************************************************/ | |
170 | /******************************************************************/ | |
171 | /******************************************************************/ | |
172 | ||
173 | class AliHBTTwoPartFctn3D: public AliHBTTwoPartFctn | |
174 | { | |
175 | public: | |
176 | AliHBTTwoPartFctn3D(Int_t nXbins = 200, Double_t maxXval = 1.5, Double_t minXval = 0.0, | |
177 | Int_t nYbins = 200, Double_t maxYval = .15, Double_t minYval =-0.15, | |
178 | Int_t nZbins = 200, Double_t maxZval = .15, Double_t minZval =-0.15); | |
179 | ||
180 | virtual ~AliHBTTwoPartFctn3D(); | |
181 | ||
182 | TH1* GetNumerator(){return fNumerator;} | |
183 | TH1* GetDenominator(){return fDenominator;} | |
184 | ||
185 | protected: | |
186 | TH3D* fNumerator; | |
187 | TH3D* fDenominator; | |
188 | public: | |
189 | ClassDef(AliHBTTwoPartFctn3D,1) | |
190 | }; | |
191 | /******************************************************************/ | |
192 | /******************************************************************/ | |
193 | /******************************************************************/ | |
194 | ||
195 | ||
196 | ||
197 | /******************************************************************/ | |
198 | /******************************************************************/ | |
199 | /******************************************************************/ | |
200 | class AliHBTFourPartFctn2D: public AliHBTFourPartFctn | |
201 | { | |
202 | public: | |
203 | AliHBTFourPartFctn2D(Int_t nXbins = 200, Double_t maxXval = 1.5, Double_t minXval = 0.0, | |
204 | Int_t nYbins = 200, Double_t maxYval = .15, Double_t minYval =-0.15); | |
205 | ~AliHBTFourPartFctn2D(); | |
206 | ||
207 | TH1* GetNumerator(){return fNumerator;} | |
208 | TH1* GetDenominator(){return fDenominator;} | |
209 | ||
210 | void ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair); | |
211 | void ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair); | |
212 | ||
213 | virtual void GetValues(AliHBTPair*,AliHBTPair*, Double_t&, Double_t&) = 0; | |
214 | ||
215 | protected: | |
216 | TH2D* fNumerator; | |
217 | TH2D* fDenominator; | |
218 | ||
219 | public: | |
220 | ClassDef(AliHBTFourPartFctn2D,1) | |
221 | }; | |
222 | ||
223 | ||
224 | /******************************************************************/ | |
225 | /******************************************************************/ | |
226 | /******************************************************************/ | |
227 | ||
228 | /******************************************************************/ | |
229 | /******************************************************************/ | |
230 | /******************************************************************/ | |
231 | ||
232 | ||
233 | ||
234 | #endif |