]>
Commit | Line | Data |
---|---|---|
1b446896 | 1 | #include "AliHBTFunction.h" |
6e8d850a | 2 | |
3 | /* $Id: */ | |
4 | ||
5 | //-------------------------------------------------------------------- | |
26f1270c | 6 | //AliHBTFunction |
7 | //Author: Piotr Krzysztof Skowronski | |
8 | //Piotr.Skowronski@cern.ch | |
6e8d850a | 9 | //Base classes for HBT functions |
10 | /* | |
2c33acf3 | 11 | OnePairFctn Function TwoPairFctn |
26f1270c | 12 | | \ \ / | \ /|\ |
13 | | \ \ / | \ / | \ | |
14 | | \ \ 1D 2D 3D / | \ | |
15 | | \ \ / \ |\ | \________________/__ | \ | |
16 | | \ \/ \ | \__|_____________ / \| \ | |
17 | | \ \ \_|____|__ \ / | \ | |
18 | | \ / \___ | | \ \/ |\ \ | |
19 | | / \ | | \ /\ | \ \ | |
20 | | / \ \| | \ / \ | \ \ | |
21 | | / \ /\ | \ / \ | \ | | |
22 | | / \ / \ | \ / \ | \ | | |
6e8d850a | 23 | | / \ / \ | \ / \ | \ | |
26f1270c | 24 | | / \/ \ | \/ \ | \ | |
25 | OnePair1D OnePair2D OnePair3D TwoPair1D TwoPair2D TwoPair3D | |
26 | ||
27 | ||
1b446896 | 28 | four particle functions are intendent to be resolution functions: |
29 | it is mecessary to have simulated particle pair corresponding to given | |
30 | recontructed track pair in order to calculate function simualted value | |
2c33acf3 | 31 | and recontructed value, to be further histogrammed |
1b446896 | 32 | */ |
6e8d850a | 33 | //--------------------------------------------------------------------- |
26f1270c | 34 | |
2dc7203b | 35 | #include <TH2.h> |
36 | #include <TH3.h> | |
37 | ||
1b446896 | 38 | /******************************************************************/ |
39 | /******************************************************************/ | |
40 | ||
41 | ClassImp( AliHBTFunction ) | |
42 | ||
201fedb7 | 43 | AliHBTFunction::AliHBTFunction(): |
e6e21fa2 | 44 | fPairCut(new AliHBTEmptyPairCut()), //dummy cut |
45 | fWriteNumAndDen(kFALSE) | |
1b446896 | 46 | { |
2c33acf3 | 47 | //Default constructor |
ba95ae3f | 48 | } |
49 | /******************************************************************/ | |
28cf76fa | 50 | |
201fedb7 | 51 | AliHBTFunction::AliHBTFunction(const char* name,const char* title): |
e6e21fa2 | 52 | TNamed(name,title), |
53 | fPairCut(new AliHBTEmptyPairCut()), //dummy cut | |
54 | fWriteNumAndDen(kFALSE) | |
ba95ae3f | 55 | { |
201fedb7 | 56 | //Constructor |
1b446896 | 57 | } |
2674b9ff | 58 | /******************************************************************/ |
59 | ||
28cf76fa | 60 | AliHBTFunction::AliHBTFunction(const AliHBTFunction & source): |
61 | TNamed(source), | |
e6e21fa2 | 62 | fPairCut((AliHBTPairCut*)source.fPairCut->Clone()), |
63 | fWriteNumAndDen(source.fWriteNumAndDen) | |
28cf76fa | 64 | { |
65 | // Copy constructor needed by the coding conventions | |
66 | } | |
67 | /******************************************************************/ | |
68 | ||
2674b9ff | 69 | AliHBTFunction::~AliHBTFunction() |
2c33acf3 | 70 | { |
71 | //destructor | |
8928fd0d | 72 | delete fPairCut; |
2c33acf3 | 73 | } |
2674b9ff | 74 | /******************************************************************/ |
28cf76fa | 75 | AliHBTFunction & AliHBTFunction::operator= (const AliHBTFunction & source) |
76 | { | |
77 | // Assignment needed by the coding conventions | |
78 | delete fPairCut; | |
79 | fPairCut = (AliHBTPairCut*)source.fPairCut->Clone(); | |
80 | return * this; | |
81 | } | |
1b446896 | 82 | |
c41732dc | 83 | void AliHBTFunction::WriteFunction() |
2c33acf3 | 84 | { |
85 | //writes result of the function to file | |
3976deed | 86 | if (AliHBTParticle::GetDebug()) Info("AliHBTFunction","%s",GetName()); |
e6e21fa2 | 87 | if (fWriteNumAndDen) |
88 | { | |
3976deed | 89 | if (AliHBTParticle::GetDebug()) Info("AliHBTFunction","Writing Num & Den"); |
e6e21fa2 | 90 | if (GetNumerator()) GetNumerator()->Write(); |
91 | if (GetDenominator()) GetDenominator()->Write(); | |
3976deed | 92 | if (AliHBTParticle::GetDebug()) Info("AliHBTFunction","Writing Num & Den Done"); |
e6e21fa2 | 93 | } |
3976deed | 94 | if (AliHBTParticle::GetDebug()) Info("AliHBTFunction","Getting Result"); |
1b446896 | 95 | TH1* res = GetResult(); |
3976deed | 96 | if (AliHBTParticle::GetDebug()) Info("AliHBTFunction","Getting Result Done"); |
97 | ||
98 | if (res) | |
99 | { | |
100 | if (AliHBTParticle::GetDebug()) Info("AliHBTFunction","Writing Result"); | |
101 | res->Write(); | |
102 | if (AliHBTParticle::GetDebug()) Info("AliHBTFunction","Writing Result Done"); | |
103 | } | |
2c33acf3 | 104 | } |
1b446896 | 105 | /******************************************************************/ |
106 | ||
266c51ca | 107 | TH1* AliHBTFunction::GetRatio(Double_t normfactor) |
1b446896 | 108 | { |
2c33acf3 | 109 | //returns ratio of numerator and denominator |
110 | // | |
18c3af34 | 111 | if (AliHBTParticle::GetDebug()>0) Info("GetRatio","Norm. Factor is %f for %s",normfactor,GetName()); |
976183fd | 112 | |
113 | if (normfactor == 0.0) | |
114 | { | |
115 | Error("GetRatio","Scaling Factor is 0. Null poiner returned"); | |
116 | return 0x0; | |
117 | } | |
1b446896 | 118 | TString str = fName + " ratio"; |
119 | TH1 *result = (TH1*)GetNumerator()->Clone(str.Data()); | |
120 | ||
121 | result->SetTitle(str.Data()); | |
1b446896 | 122 | |
123 | result->Divide(GetNumerator(),GetDenominator(),normfactor); | |
124 | ||
125 | return result; | |
126 | ||
127 | } | |
128 | /******************************************************************/ | |
129 | void AliHBTFunction::SetPairCut(AliHBTPairCut* cut) | |
130 | { | |
131 | //Sets new Pair Cut. Old one is deleted | |
132 | //Note that it is created new object instead of simple pointer set | |
133 | //I do not want to have pointer | |
134 | //to object created somewhere else | |
135 | //because in that case I could not believe that | |
136 | //it would always exist (sb could delete it) | |
137 | //so we have always own copy | |
138 | ||
139 | if(!cut) | |
140 | { | |
141 | Error("AliHBTFunction::SetPairCut","argument is NULL"); | |
142 | return; | |
143 | } | |
144 | delete fPairCut; | |
145 | fPairCut = (AliHBTPairCut*)cut->Clone(); | |
146 | ||
147 | } | |
148 | ||
149 | /******************************************************************/ | |
150 | ||
8928fd0d | 151 | void AliHBTFunction::Rename(const Char_t * name) |
1b446896 | 152 | { |
153 | //renames the function and histograms | |
154 | SetName(name); | |
155 | SetTitle(name); | |
156 | ||
157 | TString numstr = fName + " Numerator"; //title and name of the | |
158 | //numerator histogram | |
159 | TString denstr = fName + " Denominator";//title and name of the | |
160 | //denominator histogram | |
161 | ||
162 | GetNumerator()->SetName(numstr.Data()); | |
163 | GetNumerator()->SetTitle(numstr.Data()); | |
164 | ||
165 | GetDenominator()->SetName(denstr.Data()); | |
166 | GetDenominator()->SetTitle(denstr.Data()); | |
167 | ||
168 | } | |
169 | ||
8928fd0d | 170 | void AliHBTFunction::Rename(const Char_t * name, const Char_t * title) |
1b446896 | 171 | { |
172 | //renames and retitle the function and histograms | |
173 | ||
174 | SetName(name); | |
175 | SetTitle(title); | |
176 | ||
177 | TString numstrn = fName + " Numerator"; //name of the | |
178 | //numerator histogram | |
179 | ||
180 | TString numstrt = fTitle + " Numerator"; //title of the | |
181 | //numerator histogram | |
182 | ||
183 | TString denstrn = fName + " Denominator";//name of the | |
184 | //denominator histogram | |
185 | ||
186 | TString denstrt = fTitle + " Denominator";//title of the | |
187 | //denominator histogram | |
188 | ||
189 | ||
190 | GetNumerator()->SetName(numstrn.Data()); | |
191 | GetNumerator()->SetTitle(numstrt.Data()); | |
192 | ||
193 | GetDenominator()->SetName(denstrn.Data()); | |
194 | GetDenominator()->SetTitle(denstrt.Data()); | |
195 | ||
196 | ||
197 | } | |
26f1270c | 198 | /******************************************************************/ |
199 | ||
c41732dc | 200 | void AliHBTFunction::InitFunction() |
26f1270c | 201 | { |
202 | //Iniotializes fctn.: Resets histograms | |
203 | //In case histograms are not created in ctor, builds with default parameters | |
3976deed | 204 | Info("InitFunction","%s",GetName()); |
26f1270c | 205 | if ( !(GetNumerator()&&GetDenominator()) ) BuildHistos(); |
206 | GetNumerator()->Reset(); | |
207 | GetDenominator()->Reset(); | |
3976deed | 208 | |
209 | GetNumerator()->SetDirectory(0x0); | |
210 | GetDenominator()->SetDirectory(0x0); | |
211 | Info("InitFunction","Done"); | |
26f1270c | 212 | } |
fc13079c | 213 | /******************************************************************/ |
214 | /******************************************************************/ | |
215 | /******************************************************************/ | |
216 | ClassImp(AliHBTCorrelFunction) | |
217 | //____________________________________________ | |
218 | ////////////////////////////////////////////// | |
219 | // | |
220 | // class AliHBTCorrelFunction | |
221 | // | |
222 | // Base class for correlation fuctions, that is which returns ratio. | |
223 | // Stores pointer the created ratio histogram and deletes it when function is deleted | |
224 | // created in order to evoid memory leak | |
225 | // | |
226 | //////////////////////////////////////////////////////// | |
227 | AliHBTCorrelFunction& AliHBTCorrelFunction::operator=(const AliHBTCorrelFunction& in) | |
228 | { | |
229 | //assigment operator | |
230 | if (&in == this) return *this; | |
231 | delete fRatio; | |
232 | fRatio=(in.fRatio)?(TH1*)in.fRatio->Clone():0x0; | |
233 | return *this; | |
234 | } | |
1b446896 | 235 | |
236 | /******************************************************************/ | |
237 | /******************************************************************/ | |
238 | /******************************************************************/ | |
239 | ||
27b3fe5d | 240 | ClassImp( AliHBTOnePairFctn ) |
1b446896 | 241 | |
242 | /******************************************************************/ | |
243 | /******************************************************************/ | |
244 | /******************************************************************/ | |
245 | ||
27b3fe5d | 246 | ClassImp( AliHBTTwoPairFctn) |
1b446896 | 247 | |
248 | /******************************************************************/ | |
249 | /******************************************************************/ | |
250 | /******************************************************************/ | |
251 | ||
26f1270c | 252 | ClassImp( AliHBTFunction1D ) |
1b446896 | 253 | |
26f1270c | 254 | const Int_t AliHBTFunction1D::fgkDefaultNBins = 100; |
255 | const Float_t AliHBTFunction1D::fgkDefaultMin = 0.0; | |
256 | const Float_t AliHBTFunction1D::fgkDefaultMax = 0.15; | |
257 | const UInt_t AliHBTFunction1D::fgkDefaultNBinsToScale = 30; | |
258 | ||
259 | ||
260 | AliHBTFunction1D::AliHBTFunction1D(): | |
261 | fNumerator(0x0), | |
262 | fDenominator(0x0), | |
263 | fNBinsToScale(fgkDefaultNBinsToScale) | |
2c33acf3 | 264 | {//default constructor |
26f1270c | 265 | } |
266 | /******************************************************************/ | |
267 | ||
268 | AliHBTFunction1D::AliHBTFunction1D(Int_t nbins, Float_t maxXval, Float_t minXval): | |
269 | fNumerator(0x0), | |
270 | fDenominator(0x0), | |
271 | fNBinsToScale(fgkDefaultNBinsToScale) | |
272 | { | |
1b446896 | 273 | //Constructor of Two Part One Dimentional Function |
274 | // nbins: number of bins in histograms - default 100 | |
275 | // maxXval and minXval: range of histgram(s) default 0 - 0.15 (GeV) | |
26f1270c | 276 | BuildHistos(nbins,maxXval,minXval); |
277 | } | |
278 | /******************************************************************/ | |
279 | AliHBTFunction1D::AliHBTFunction1D(const Char_t *name, const Char_t *title): | |
280 | AliHBTFunction(name,title), | |
281 | fNumerator(0x0), | |
282 | fDenominator(0x0), | |
283 | fNBinsToScale(fgkDefaultNBinsToScale) | |
2c33acf3 | 284 | {//constructor |
ba95ae3f | 285 | } |
1b446896 | 286 | /******************************************************************/ |
26f1270c | 287 | AliHBTFunction1D::AliHBTFunction1D(const Char_t *name, const Char_t *title, |
288 | Int_t nbins, Float_t maxXval, Float_t minXval): | |
289 | AliHBTFunction(name,title), | |
290 | fNumerator(0x0), | |
291 | fDenominator(0x0), | |
292 | fNBinsToScale(fgkDefaultNBinsToScale) | |
293 | { | |
2c33acf3 | 294 | //constructor |
295 | BuildHistos(nbins,maxXval,minXval); | |
26f1270c | 296 | } |
297 | /******************************************************************/ | |
298 | ||
28cf76fa | 299 | AliHBTFunction1D::AliHBTFunction1D(const AliHBTFunction1D& source): |
300 | AliHBTFunction(source) | |
301 | { | |
302 | // Copy constructor needed by the coding conventions byt not used | |
303 | Fatal("AliHBTFunction1D(const AliHBTFunction1D&)","Cpy ctor not usable."); | |
304 | } | |
305 | /******************************************************************/ | |
306 | ||
307 | AliHBTFunction1D& AliHBTFunction1D::operator= (const AliHBTFunction1D & /*source*/) | |
308 | { | |
309 | // Assignment needed by the coding conventions byt not used | |
310 | Fatal("Assignment operator","not implemented"); | |
311 | return * this; | |
312 | } | |
313 | /******************************************************************/ | |
314 | ||
26f1270c | 315 | AliHBTFunction1D::~AliHBTFunction1D() |
1b446896 | 316 | { |
2c33acf3 | 317 | //destructor |
1b446896 | 318 | delete fNumerator; |
319 | delete fDenominator; | |
320 | } | |
26f1270c | 321 | /******************************************************************/ |
322 | void AliHBTFunction1D::BuildHistos() | |
323 | { | |
2c33acf3 | 324 | //builds histograms with default settings |
26f1270c | 325 | BuildHistos(fgkDefaultNBins,fgkDefaultMax,fgkDefaultMin); |
326 | } | |
327 | ||
976183fd | 328 | /******************************************************************/ |
329 | ||
26f1270c | 330 | void AliHBTFunction1D::BuildHistos(Int_t nbins, Float_t max, Float_t min) |
976183fd | 331 | { |
2c33acf3 | 332 | //builds numarator and denominator hitograms |
26f1270c | 333 | TString numstr = fName + " Numerator"; //title and name of the |
334 | //numerator histogram | |
335 | TString denstr = fName + " Denominator";//title and name of the | |
336 | //denominator histogram | |
337 | fNumerator = new TH1D(numstr.Data(),numstr.Data(),nbins,min,max); | |
338 | fDenominator = new TH1D(denstr.Data(),denstr.Data(),nbins,min,max); | |
339 | ||
340 | fNumerator->Sumw2(); | |
341 | fDenominator->Sumw2(); | |
976183fd | 342 | } |
343 | /******************************************************************/ | |
976183fd | 344 | |
26f1270c | 345 | Double_t AliHBTFunction1D::Scale() |
346 | { | |
347 | //Calculates the factor that should be used to scale | |
348 | //quatience of fNumerator and fDenominator to 1 at tail | |
349 | return Scale(fNumerator,fDenominator); | |
350 | } | |
976183fd | 351 | /******************************************************************/ |
26f1270c | 352 | |
353 | Double_t AliHBTFunction1D::Scale(TH1D* num,TH1D* den) | |
976183fd | 354 | { |
26f1270c | 355 | //Calculates the factor that should be used to scale |
356 | //quatience of num and den to 1 at tail | |
357 | ||
18c3af34 | 358 | if (AliHBTParticle::GetDebug()>0) Info("Scale","Enetered Scale()"); |
26f1270c | 359 | if(!num) |
976183fd | 360 | { |
361 | Error("Scale","No numerator"); | |
362 | return 0.0; | |
363 | } | |
26f1270c | 364 | if(!den) |
976183fd | 365 | { |
366 | Error("Scale","No denominator"); | |
367 | return 0.0; | |
368 | } | |
369 | ||
370 | if(fNBinsToScale < 1) | |
371 | { | |
976183fd | 372 | Error("Scale","Number of bins for scaling is smaller thnan 1"); |
0798b21e | 373 | return 0.0; |
976183fd | 374 | } |
26f1270c | 375 | UInt_t nbins = num->GetNbinsX(); |
976183fd | 376 | if (fNBinsToScale > nbins) |
377 | { | |
378 | Error("Scale","Number of bins for scaling is bigger thnan number of bins in histograms"); | |
379 | return 0.0; | |
380 | } | |
18c3af34 | 381 | if (AliHBTParticle::GetDebug()>0) Info("Scale","No errors detected"); |
976183fd | 382 | |
dd82cadc | 383 | Double_t densum = 0.0; |
384 | Double_t numsum = 0.0; | |
2674b9ff | 385 | |
976183fd | 386 | Int_t offset = nbins - fNBinsToScale - 1; |
2c33acf3 | 387 | |
388 | for (UInt_t i = offset; i< nbins; i++) | |
976183fd | 389 | { |
26f1270c | 390 | if ( num->GetBinContent(i) > 0.0 ) |
976183fd | 391 | { |
dd82cadc | 392 | densum = fDenominator->GetBinContent(i); |
393 | numsum = fNumerator->GetBinContent(i); | |
976183fd | 394 | } |
395 | } | |
2674b9ff | 396 | |
dd82cadc | 397 | if(AliHBTParticle::GetDebug() > 0) |
398 | Info("Scale","numsum=%f densum=%f fNBinsToScaleX=%d",numsum,densum,fNBinsToScale); | |
2674b9ff | 399 | |
dd82cadc | 400 | if (numsum == 0) return 0.0; |
401 | Double_t ret = densum/numsum; | |
976183fd | 402 | |
18c3af34 | 403 | if(AliHBTParticle::GetDebug() > 0) Info("Scale","returning %f",ret); |
2674b9ff | 404 | return ret; |
976183fd | 405 | } |
406 | ||
1b446896 | 407 | /******************************************************************/ |
408 | /******************************************************************/ | |
409 | /******************************************************************/ | |
410 | ||
26f1270c | 411 | //____________________ |
412 | /////////////////////////////////////////////////////// | |
413 | // // | |
414 | // AliHBTFunction2D // | |
415 | // // | |
416 | // Base Calss for 2-dimensinal Functions // | |
417 | // // | |
418 | // Piotr.Skowronski@cern.ch // | |
419 | // http://alisoft.cern.ch/people/skowron/analyzer // | |
420 | // // | |
421 | /////////////////////////////////////////////////////// | |
1b446896 | 422 | |
1db320d4 | 423 | ClassImp( AliHBTFunction2D ) |
1b446896 | 424 | |
26f1270c | 425 | const Int_t AliHBTFunction2D::fgkDefaultNBinsX = 200;//default number of Bins in X axis in histograms |
426 | const Float_t AliHBTFunction2D::fgkDefaultMinX = 0.0;//Default min value of X axis in histograms | |
427 | const Float_t AliHBTFunction2D::fgkDefaultMaxX = 1.5;//Default max value of X axis inhistograms | |
428 | ||
429 | const Int_t AliHBTFunction2D::fgkDefaultNBinsY = 200;//default number of Bins in histograms | |
430 | const Float_t AliHBTFunction2D::fgkDefaultMinY = -0.15;//Default min value of histograms | |
431 | const Float_t AliHBTFunction2D::fgkDefaultMaxY = 0.15;//Default max value of histograms | |
432 | ||
433 | const UInt_t AliHBTFunction2D::fgkDefaultNBinsToScaleX = 30;//Default number of X bins used for scaling to tale | |
434 | const UInt_t AliHBTFunction2D::fgkDefaultNBinsToScaleY = 30;//Default number of bins used for scaling to tale | |
435 | ||
436 | /******************************************************************/ | |
437 | AliHBTFunction2D::AliHBTFunction2D(): | |
438 | fNumerator(0x0), | |
439 | fDenominator(0x0), | |
440 | fNBinsToScaleX(fgkDefaultNBinsToScaleX), | |
441 | fNBinsToScaleY(fgkDefaultNBinsToScaleY) | |
442 | {//default constructor | |
443 | } | |
444 | /******************************************************************/ | |
445 | AliHBTFunction2D::AliHBTFunction2D(const Char_t *name, const Char_t *title): | |
446 | AliHBTFunction(name,title), | |
447 | fNumerator(0x0), | |
448 | fDenominator(0x0), | |
449 | fNBinsToScaleX(fgkDefaultNBinsToScaleX), | |
450 | fNBinsToScaleY(fgkDefaultNBinsToScaleY) | |
451 | {//constructor | |
452 | } | |
453 | /******************************************************************/ | |
454 | ||
455 | AliHBTFunction2D::AliHBTFunction2D(Int_t nXbins, Double_t maxXval, Double_t minXval, | |
456 | Int_t nYbins, Double_t maxYval, Double_t minYval): | |
457 | fNumerator(0x0), | |
458 | fDenominator(0x0), | |
459 | fNBinsToScaleX(fgkDefaultNBinsToScaleX), | |
460 | fNBinsToScaleY(fgkDefaultNBinsToScaleY) | |
1b446896 | 461 | { |
26f1270c | 462 | BuildHistos(nXbins,maxXval,minXval,nYbins,maxYval,minYval); |
463 | } | |
464 | /******************************************************************/ | |
1b446896 | 465 | |
26f1270c | 466 | AliHBTFunction2D::AliHBTFunction2D(const Char_t *name, const Char_t *title, |
467 | Int_t nXbins, Double_t maxXval, Double_t minXval, | |
468 | Int_t nYbins, Double_t maxYval, Double_t minYval): | |
469 | AliHBTFunction(name,title), | |
470 | fNumerator(0x0), | |
471 | fDenominator(0x0), | |
472 | fNBinsToScaleX(fgkDefaultNBinsToScaleX), | |
473 | fNBinsToScaleY(fgkDefaultNBinsToScaleY) | |
474 | { | |
475 | BuildHistos(nXbins,maxXval,minXval,nYbins,maxYval,minYval); | |
1b446896 | 476 | } |
26f1270c | 477 | /******************************************************************/ |
28cf76fa | 478 | AliHBTFunction2D::AliHBTFunction2D(const AliHBTFunction2D & source): |
479 | AliHBTFunction(source) | |
480 | { | |
481 | // Copy constructor needed by the coding conventions byt not used | |
482 | Fatal("AliHBTFunction2D(const AliHBTFunction2D&)","Cpy ctor not usable."); | |
483 | } | |
484 | /******************************************************************/ | |
485 | ||
486 | AliHBTFunction2D& AliHBTFunction2D::operator= (const AliHBTFunction2D& /*source*/) { | |
487 | // Assignment needed by the coding conventions byt not used | |
488 | Fatal("Assignment operator","not implemented"); | |
489 | return * this; | |
490 | } | |
491 | /******************************************************************/ | |
26f1270c | 492 | |
493 | AliHBTFunction2D::~AliHBTFunction2D() | |
1b446896 | 494 | { |
28cf76fa | 495 | //dtor |
1b446896 | 496 | delete fNumerator; |
497 | delete fDenominator; | |
498 | } | |
26f1270c | 499 | /******************************************************************/ |
500 | ||
501 | void AliHBTFunction2D::BuildHistos() | |
1b446896 | 502 | { |
26f1270c | 503 | //Creates default histograms |
504 | BuildHistos(fgkDefaultNBinsX,fgkDefaultMaxX,fgkDefaultMinX, | |
505 | fgkDefaultNBinsY,fgkDefaultMaxY,fgkDefaultMinY); | |
1b446896 | 506 | } |
26f1270c | 507 | /******************************************************************/ |
1b446896 | 508 | |
26f1270c | 509 | void AliHBTFunction2D::BuildHistos(Int_t nxbins, Float_t xmax, Float_t xmin, |
510 | Int_t nybins, Float_t ymax, Float_t ymin) | |
1b446896 | 511 | { |
28cf76fa | 512 | //Builds numerator and denominator histograms (2d-case) |
26f1270c | 513 | TString numstr = fName + " Numerator"; //title and name of the |
514 | //numerator histogram | |
515 | TString denstr = fName + " Denominator";//title and name of the | |
516 | //denominator histogram | |
517 | ||
518 | fNumerator = new TH2D(numstr.Data(),numstr.Data(), | |
519 | nxbins,xmin,xmax,nybins,ymin,ymax); | |
520 | ||
521 | fDenominator = new TH2D(denstr.Data(),denstr.Data(), | |
522 | nxbins,xmin,xmax,nybins,ymin,ymax); | |
523 | ||
524 | fNumerator->Sumw2(); | |
525 | fDenominator->Sumw2(); | |
526 | } | |
527 | /******************************************************************/ | |
1b446896 | 528 | |
26f1270c | 529 | void AliHBTFunction2D::SetNumberOfBinsToScale(UInt_t xn, UInt_t yn) |
530 | { | |
531 | //defines area used for scaling factor calculation | |
532 | fNBinsToScaleX = xn; | |
533 | fNBinsToScaleY = yn; | |
1b446896 | 534 | } |
26f1270c | 535 | /******************************************************************/ |
1b446896 | 536 | |
26f1270c | 537 | Double_t AliHBTFunction2D::Scale() |
538 | { | |
28cf76fa | 539 | // Calculates the factor that should be used to scale |
540 | // quatience of fNumerator and fDenominator to 1 at | |
541 | // given region | |
18c3af34 | 542 | if (AliHBTParticle::GetDebug()>0) Info("Scale","Enetered Scale()"); |
26f1270c | 543 | if(!fNumerator) |
544 | { | |
545 | Error("Scale","No numerator"); | |
546 | return 0.0; | |
547 | } | |
548 | if(!fDenominator) | |
549 | { | |
550 | Error("Scale","No denominator"); | |
551 | return 0.0; | |
552 | } | |
553 | ||
554 | if( (fNBinsToScaleX < 1) || (fNBinsToScaleY < 1) ) | |
555 | { | |
26f1270c | 556 | Error("Scale","Number of bins for scaling is smaller thnan 1"); |
0798b21e | 557 | return 0.0; |
26f1270c | 558 | } |
559 | UInt_t nbinsX = fNumerator->GetNbinsX(); | |
560 | if (fNBinsToScaleX > nbinsX) | |
561 | { | |
562 | Error("Scale","Number of X bins for scaling is bigger thnan number of bins in histograms"); | |
563 | return 0.0; | |
564 | } | |
565 | ||
566 | UInt_t nbinsY = fNumerator->GetNbinsX(); | |
567 | if (fNBinsToScaleY > nbinsY) | |
568 | { | |
569 | Error("Scale","Number of Y bins for scaling is bigger thnan number of bins in histograms"); | |
570 | return 0.0; | |
571 | } | |
572 | ||
18c3af34 | 573 | if (AliHBTParticle::GetDebug()>0) Info("Scale","No errors detected"); |
26f1270c | 574 | |
575 | Int_t offsetX = nbinsX - fNBinsToScaleX - 1; //bin that we start loop over bins in axis X | |
576 | Int_t offsetY = nbinsY - fNBinsToScaleY - 1; //bin that we start loop over bins in axis X | |
577 | ||
dd82cadc | 578 | Double_t densum = 0.0; |
579 | Double_t numsum = 0.0; | |
26f1270c | 580 | |
2c33acf3 | 581 | for (UInt_t j = offsetY; j< nbinsY; j++) |
582 | for (UInt_t i = offsetX; i< nbinsX; i++) | |
26f1270c | 583 | { |
584 | if ( fNumerator->GetBinContent(i,j) > 0.0 ) | |
585 | { | |
dd82cadc | 586 | densum = fDenominator->GetBinContent(i,j); |
587 | numsum = fNumerator->GetBinContent(i,j); | |
26f1270c | 588 | } |
589 | } | |
590 | ||
dd82cadc | 591 | if(AliHBTParticle::GetDebug() > 0) |
592 | Info("Scale","numsum=%f densum=%f fNBinsToScaleX=%d fNBinsToScaleY=%d",numsum,densum,fNBinsToScaleX,fNBinsToScaleY); | |
26f1270c | 593 | |
dd82cadc | 594 | if (numsum == 0) return 0.0; |
595 | Double_t ret = densum/numsum; | |
26f1270c | 596 | |
18c3af34 | 597 | if(AliHBTParticle::GetDebug() > 0) Info("Scale","returning %f",ret); |
26f1270c | 598 | return ret; |
599 | } | |
1b446896 | 600 | |
601 | /******************************************************************/ | |
602 | /******************************************************************/ | |
603 | /******************************************************************/ | |
604 | ||
26f1270c | 605 | //____________________ |
606 | /////////////////////////////////////////////////////// | |
607 | // // | |
608 | // AliHBTFunction3D // | |
609 | // // | |
610 | // Base Calss for 3-dimensinal Functions // | |
611 | // // | |
612 | // Piotr.Skowronski@cern.ch // | |
613 | // http://alisoft.cern.ch/people/skowron/analyzer // | |
614 | // // | |
615 | /////////////////////////////////////////////////////// | |
1b446896 | 616 | |
26f1270c | 617 | ClassImp( AliHBTFunction3D) |
1b446896 | 618 | |
26f1270c | 619 | const Int_t AliHBTFunction3D::fgkDefaultNBinsX = 200;//default number of Bins in X axis in histograms |
620 | const Float_t AliHBTFunction3D::fgkDefaultMinX = 0.0;//Default min value of X axis in histograms | |
621 | const Float_t AliHBTFunction3D::fgkDefaultMaxX = 1.5;//Default max value of X axis inhistograms | |
1b446896 | 622 | |
26f1270c | 623 | const Int_t AliHBTFunction3D::fgkDefaultNBinsY = 200;//default number of Bins in histograms |
624 | const Float_t AliHBTFunction3D::fgkDefaultMinY = -0.15;//Default min value of histograms | |
625 | const Float_t AliHBTFunction3D::fgkDefaultMaxY = 0.15;//Default max value of histograms | |
626 | ||
627 | const Int_t AliHBTFunction3D::fgkDefaultNBinsZ = 200;//default number of Bins in histograms | |
628 | const Float_t AliHBTFunction3D::fgkDefaultMinZ = -0.15;//Default min value of histograms | |
629 | const Float_t AliHBTFunction3D::fgkDefaultMaxZ = 0.15;//Default max value of histograms | |
630 | ||
631 | const UInt_t AliHBTFunction3D::fgkDefaultNBinsToScaleX = 30;//Default number of X bins used for scaling to tale | |
632 | const UInt_t AliHBTFunction3D::fgkDefaultNBinsToScaleY = 30;//Default number of bins used for scaling to tale | |
633 | const UInt_t AliHBTFunction3D::fgkDefaultNBinsToScaleZ = 30;//Default number of bins used for scaling to tale | |
634 | ||
2c33acf3 | 635 | AliHBTFunction3D::AliHBTFunction3D(): |
636 | fNumerator(0x0), | |
637 | fDenominator(0x0), | |
638 | fNBinsToScaleX(fgkDefaultNBinsToScaleX), | |
639 | fNBinsToScaleY(fgkDefaultNBinsToScaleY), | |
640 | fNBinsToScaleZ(fgkDefaultNBinsToScaleZ) | |
641 | { | |
642 | //constructor | |
643 | } | |
644 | /******************************************************************/ | |
645 | ||
646 | AliHBTFunction3D::AliHBTFunction3D(const Char_t *name, const Char_t *title): | |
647 | AliHBTFunction(name,title), | |
648 | fNumerator(0x0), | |
649 | fDenominator(0x0), | |
650 | fNBinsToScaleX(fgkDefaultNBinsToScaleX), | |
651 | fNBinsToScaleY(fgkDefaultNBinsToScaleY), | |
652 | fNBinsToScaleZ(fgkDefaultNBinsToScaleZ) | |
653 | { | |
654 | //constructor | |
655 | } | |
656 | /******************************************************************/ | |
26f1270c | 657 | |
658 | AliHBTFunction3D::AliHBTFunction3D(Int_t nXbins, Double_t maxXval, Double_t minXval, | |
659 | Int_t nYbins, Double_t maxYval, Double_t minYval, | |
660 | Int_t nZbins, Double_t maxZval, Double_t minZval): | |
661 | fNumerator(0x0), | |
662 | fDenominator(0x0), | |
663 | fNBinsToScaleX(fgkDefaultNBinsToScaleX), | |
664 | fNBinsToScaleY(fgkDefaultNBinsToScaleY), | |
665 | fNBinsToScaleZ(fgkDefaultNBinsToScaleZ) | |
666 | { | |
2c33acf3 | 667 | //constructor |
668 | BuildHistos( nXbins,maxXval,minXval,nYbins,maxYval,minYval,nZbins,maxZval,minZval); | |
1b446896 | 669 | } |
ba95ae3f | 670 | /******************************************************************/ |
7836ee94 | 671 | |
2c33acf3 | 672 | AliHBTFunction3D::AliHBTFunction3D(const Char_t *name, const Char_t *title, |
673 | Int_t nXbins, Double_t maxXval, Double_t minXval, | |
674 | Int_t nYbins, Double_t maxYval, Double_t minYval, | |
675 | Int_t nZbins, Double_t maxZval, Double_t minZval): | |
676 | AliHBTFunction(name,title), | |
677 | fNumerator(0x0), | |
678 | fDenominator(0x0), | |
679 | fNBinsToScaleX(fgkDefaultNBinsToScaleX), | |
680 | fNBinsToScaleY(fgkDefaultNBinsToScaleY), | |
681 | fNBinsToScaleZ(fgkDefaultNBinsToScaleZ) | |
682 | { | |
683 | //constructor | |
684 | BuildHistos( nXbins,maxXval,minXval,nYbins,maxYval,minYval,nZbins,maxZval,minZval); | |
685 | } | |
686 | /******************************************************************/ | |
687 | ||
28cf76fa | 688 | AliHBTFunction3D::AliHBTFunction3D(const AliHBTFunction3D& source): |
689 | AliHBTFunction(source) | |
690 | { | |
691 | // Copy constructor needed by the coding conventions byt not used | |
692 | Fatal("AliHBTFunction3D(const AliHBTFunction3D&)","Cpy ctor not usable."); | |
693 | } | |
694 | /******************************************************************/ | |
695 | ||
696 | AliHBTFunction3D& AliHBTFunction3D::operator= (const AliHBTFunction3D & /*source*/) | |
697 | { | |
698 | // Assignment needed by the coding conventions byt not used | |
699 | Fatal("Assignment operator","not implemented"); | |
700 | return * this; | |
701 | } | |
702 | /******************************************************************/ | |
703 | ||
2c33acf3 | 704 | |
26f1270c | 705 | AliHBTFunction3D::~AliHBTFunction3D() |
7836ee94 | 706 | { |
707 | delete fNumerator; | |
708 | delete fDenominator; | |
709 | } | |
ba95ae3f | 710 | /******************************************************************/ |
7836ee94 | 711 | |
26f1270c | 712 | void AliHBTFunction3D::BuildHistos() |
713 | { | |
714 | //Creates default histograms | |
715 | BuildHistos(fgkDefaultNBinsX,fgkDefaultMaxX,fgkDefaultMinX, | |
716 | fgkDefaultNBinsY,fgkDefaultMaxY,fgkDefaultMinY, | |
717 | fgkDefaultNBinsZ,fgkDefaultMaxZ,fgkDefaultMinZ); | |
718 | } | |
ba95ae3f | 719 | /******************************************************************/ |
ba95ae3f | 720 | |
26f1270c | 721 | void AliHBTFunction3D::BuildHistos(Int_t nxbins, Float_t xmax, Float_t xmin, |
722 | Int_t nybins, Float_t ymax, Float_t ymin, | |
723 | Int_t nzbins, Float_t zmax, Float_t zmin) | |
724 | { | |
6e8d850a | 725 | //Builds numerator and denominator histograms (3d-case) |
ba95ae3f | 726 | TString numstr = fName + " Numerator"; //title and name of the |
727 | //numerator histogram | |
728 | TString denstr = fName + " Denominator";//title and name of the | |
729 | //denominator histogram | |
730 | ||
dd82cadc | 731 | fNumerator = new TH3F(numstr.Data(),numstr.Data(), |
bed069a4 | 732 | nxbins,xmin,xmax,nybins,ymin,ymax,nzbins,zmin,zmax); |
ba95ae3f | 733 | |
dd82cadc | 734 | fDenominator = new TH3F(denstr.Data(),denstr.Data(), |
bed069a4 | 735 | nxbins,xmin,xmax,nybins,ymin,ymax,nzbins,zmin,zmax); |
ba95ae3f | 736 | |
737 | fNumerator->Sumw2(); | |
738 | fDenominator->Sumw2(); | |
ba95ae3f | 739 | } |
ba95ae3f | 740 | |
4e871a8a | 741 | /******************************************************************/ |
26f1270c | 742 | |
743 | Double_t AliHBTFunction3D::Scale() | |
4e871a8a | 744 | { |
6e8d850a | 745 | // Calculates the factor that should be used to scale |
746 | // quatience of fNumerator and fDenominator to 1 at | |
747 | // given volume | |
18c3af34 | 748 | if (AliHBTParticle::GetDebug()>0) Info("Scale","Enetered Scale()"); |
4e871a8a | 749 | if(!fNumerator) |
750 | { | |
751 | Error("Scale","No numerator"); | |
752 | return 0.0; | |
753 | } | |
754 | if(!fDenominator) | |
755 | { | |
756 | Error("Scale","No denominator"); | |
757 | return 0.0; | |
758 | } | |
759 | ||
26f1270c | 760 | if( (fNBinsToScaleX < 1) || (fNBinsToScaleY < 1) || (fNBinsToScaleZ < 1)) |
4e871a8a | 761 | { |
4e871a8a | 762 | Error("Scale","Number of bins for scaling is smaller thnan 1"); |
0798b21e | 763 | return 0.0; |
4e871a8a | 764 | } |
26f1270c | 765 | UInt_t nbinsX = fNumerator->GetNbinsX(); |
766 | if (fNBinsToScaleX > nbinsX) | |
4e871a8a | 767 | { |
26f1270c | 768 | Error("Scale","Number of X bins for scaling is bigger thnan number of bins in histograms"); |
769 | return 0.0; | |
770 | } | |
771 | ||
772 | UInt_t nbinsY = fNumerator->GetNbinsX(); | |
773 | if (fNBinsToScaleY > nbinsY) | |
774 | { | |
775 | Error("Scale","Number of Y bins for scaling is bigger thnan number of bins in histograms"); | |
776 | return 0.0; | |
777 | } | |
778 | ||
779 | UInt_t nbinsZ = fNumerator->GetNbinsZ(); | |
780 | if (fNBinsToScaleZ > nbinsZ) | |
781 | { | |
782 | Error("Scale","Number of Z bins for scaling is bigger thnan number of bins in histograms"); | |
4e871a8a | 783 | return 0.0; |
784 | } | |
26f1270c | 785 | |
18c3af34 | 786 | if (AliHBTParticle::GetDebug()>0) Info("Scale","No errors detected"); |
4e871a8a | 787 | |
26f1270c | 788 | Int_t offsetX = nbinsX - fNBinsToScaleX - 1; //bin that we start loop over bins in axis X |
196e34f6 | 789 | Int_t offsetY = nbinsY - fNBinsToScaleY - 1; //bin that we start loop over bins in axis Y |
790 | Int_t offsetZ = nbinsZ - fNBinsToScaleZ - 1; //bin that we start loop over bins in axis Z | |
26f1270c | 791 | |
dd82cadc | 792 | Double_t densum = 0.0; |
793 | Double_t numsum = 0.0; | |
4e871a8a | 794 | |
196e34f6 | 795 | for (UInt_t k = offsetZ; k<nbinsZ; k++) |
796 | for (UInt_t j = offsetY; j<nbinsY; j++) | |
797 | for (UInt_t i = offsetX; i<nbinsX; i++) | |
26f1270c | 798 | { |
799 | if ( fNumerator->GetBinContent(i,j,k) > 0.0 ) | |
800 | { | |
dd82cadc | 801 | |
802 | densum = fDenominator->GetBinContent(i,j,k); | |
803 | numsum = fNumerator->GetBinContent(i,j,k); | |
26f1270c | 804 | } |
805 | } | |
4e871a8a | 806 | |
18c3af34 | 807 | if(AliHBTParticle::GetDebug() > 0) |
dd82cadc | 808 | Info("Scale","numsum=%f densum=%f fNBinsToScaleX=%d fNBinsToScaleY=%d fNBinsToScaleZ=%d", |
809 | numsum,densum,fNBinsToScaleX,fNBinsToScaleY,fNBinsToScaleZ); | |
4e871a8a | 810 | |
dd82cadc | 811 | if (numsum == 0) return 0.0; |
812 | Double_t ret = densum/numsum; | |
4e871a8a | 813 | |
18c3af34 | 814 | if(AliHBTParticle::GetDebug() > 0) Info("Scale","returning %f",ret); |
4e871a8a | 815 | return ret; |
816 | } | |
2c33acf3 | 817 | /******************************************************************/ |
818 | ||
819 | void AliHBTFunction3D::SetNumberOfBinsToScale(UInt_t xn, UInt_t yn,UInt_t zn) | |
820 | { | |
821 | //sets up the volume to be used for scaling to tail | |
822 | fNBinsToScaleX = xn; | |
823 | fNBinsToScaleY = yn; | |
824 | fNBinsToScaleZ = zn; | |
825 | } | |
ba95ae3f | 826 | |
1b446896 | 827 | /******************************************************************/ |
828 | /******************************************************************/ | |
829 | /******************************************************************/ | |
26f1270c | 830 | /******************************************************************/ |
831 | /******************************************************************/ | |
832 | /******************************************************************/ | |
833 | /******************************************************************/ | |
834 | /******************************************************************/ | |
835 | /******************************************************************/ | |
1b446896 | 836 | |
26f1270c | 837 | //____________________ |
838 | /////////////////////////////////////////////////////// | |
839 | // // | |
840 | // AliHBTOnePairFctn1D // | |
841 | // // | |
842 | // Base Calss for 1-dimensinal Functions that need // | |
843 | // one pair to fill function // | |
844 | // // | |
845 | // Piotr.Skowronski@cern.ch // | |
846 | // http://alisoft.cern.ch/people/skowron/analyzer // | |
847 | // // | |
848 | /////////////////////////////////////////////////////// | |
1b446896 | 849 | |
26f1270c | 850 | ClassImp( AliHBTOnePairFctn1D ) |
851 | /******************************************************************/ | |
1b446896 | 852 | |
26f1270c | 853 | AliHBTOnePairFctn1D::AliHBTOnePairFctn1D(Int_t nbins, Float_t maxXval, Float_t minXval): |
854 | AliHBTFunction1D(nbins,maxXval,minXval) | |
1b446896 | 855 | { |
aa4e0a70 | 856 | //constructor |
26f1270c | 857 | } |
858 | /******************************************************************/ | |
1b446896 | 859 | |
26f1270c | 860 | AliHBTOnePairFctn1D::AliHBTOnePairFctn1D(const Char_t *name, const Char_t *title): |
861 | AliHBTFunction1D(name,title) | |
862 | { | |
aa4e0a70 | 863 | |
26f1270c | 864 | } |
865 | /******************************************************************/ | |
866 | ||
867 | AliHBTOnePairFctn1D::AliHBTOnePairFctn1D(const Char_t *name, const Char_t *title, | |
868 | Int_t nbins, Float_t maxXval, Float_t minXval): | |
869 | AliHBTFunction1D(name,title,nbins,maxXval,minXval) | |
870 | { | |
aa4e0a70 | 871 | //constructor |
26f1270c | 872 | } |
873 | /******************************************************************/ | |
874 | ||
875 | void AliHBTOnePairFctn1D::ProcessSameEventParticles(AliHBTPair* pair) | |
876 | { | |
6e8d850a | 877 | //Fills the numerator using pair from the same event |
26f1270c | 878 | pair = CheckPair(pair); |
879 | if(pair) fNumerator->Fill(GetValue(pair)); | |
880 | } | |
881 | /******************************************************************/ | |
882 | void AliHBTOnePairFctn1D::ProcessDiffEventParticles(AliHBTPair* pair) | |
883 | { | |
6e8d850a | 884 | //Fills the denumerator using mixed pairs |
26f1270c | 885 | pair = CheckPair(pair); |
886 | if(pair) fDenominator->Fill(GetValue(pair)); | |
887 | } | |
888 | ||
889 | /******************************************************************/ | |
890 | /******************************************************************/ | |
891 | /******************************************************************/ | |
892 | ||
893 | //____________________ | |
894 | /////////////////////////////////////////////////////// | |
895 | // // | |
896 | // AliHBTOnePairFctn2D // | |
897 | // // | |
898 | // Base Calss for 2-dimensinal Functions that need // | |
899 | // one pair to fill function // | |
900 | // // | |
901 | // Piotr.Skowronski@cern.ch // | |
902 | // http://alisoft.cern.ch/people/skowron/analyzer // | |
903 | // // | |
904 | /////////////////////////////////////////////////////// | |
905 | ||
906 | ClassImp( AliHBTOnePairFctn2D ) | |
907 | /******************************************************************/ | |
908 | ||
909 | AliHBTOnePairFctn2D::AliHBTOnePairFctn2D(const Char_t *name, const Char_t *title): | |
910 | AliHBTFunction2D(name,title) | |
911 | { | |
aa4e0a70 | 912 | //constructor |
26f1270c | 913 | } |
914 | /******************************************************************/ | |
915 | ||
916 | AliHBTOnePairFctn2D::AliHBTOnePairFctn2D(Int_t nXbins, Double_t maxXval, Double_t minXval, | |
917 | Int_t nYbins, Double_t maxYval, Double_t minYval): | |
918 | AliHBTFunction2D(nXbins, maxXval, minXval, nYbins, maxYval, minYval) | |
919 | { | |
aa4e0a70 | 920 | //constructor |
26f1270c | 921 | } |
922 | /******************************************************************/ | |
923 | ||
924 | AliHBTOnePairFctn2D::AliHBTOnePairFctn2D(const Char_t *name, const Char_t *title, | |
925 | Int_t nXbins, Double_t maxXval, Double_t minXval, | |
926 | Int_t nYbins, Double_t maxYval, Double_t minYval): | |
927 | AliHBTFunction2D(name,title, nXbins, maxXval, minXval, nYbins, maxYval, minYval) | |
928 | { | |
aa4e0a70 | 929 | //constructor |
26f1270c | 930 | } |
931 | /******************************************************************/ | |
932 | ||
933 | void AliHBTOnePairFctn2D::ProcessSameEventParticles(AliHBTPair* pair) | |
934 | { | |
6e8d850a | 935 | // Fills the numerator using pairs from the same event |
26f1270c | 936 | pair = CheckPair(pair); |
937 | if(pair) | |
938 | { | |
939 | Double_t x,y; | |
940 | GetValues(pair,x,y); | |
941 | fNumerator->Fill(x,y); | |
942 | } | |
943 | } | |
944 | /******************************************************************/ | |
945 | ||
946 | void AliHBTOnePairFctn2D::ProcessDiffEventParticles(AliHBTPair* pair) | |
947 | { | |
6e8d850a | 948 | // Fills the denumerator using mixed pairs |
26f1270c | 949 | pair = CheckPair(pair); |
950 | if(pair) | |
951 | { | |
952 | Double_t x,y; | |
953 | GetValues(pair,x,y); | |
954 | fDenominator->Fill(x,y); | |
955 | } | |
956 | } | |
957 | /******************************************************************/ | |
958 | /******************************************************************/ | |
959 | /******************************************************************/ | |
960 | /******************************************************************/ | |
961 | //____________________ | |
962 | /////////////////////////////////////////////////////// | |
963 | // // | |
964 | // AliHBTOnePairFctn3D // | |
965 | // // | |
966 | // Base Calss for 3-dimensinal Functions that need // | |
967 | // one pair to fill function // | |
968 | // // | |
969 | // Piotr.Skowronski@cern.ch // | |
970 | // http://alisoft.cern.ch/people/skowron/analyzer // | |
971 | // // | |
972 | /////////////////////////////////////////////////////// | |
973 | ClassImp( AliHBTOnePairFctn3D) | |
974 | ||
975 | /******************************************************************/ | |
976 | ||
977 | AliHBTOnePairFctn3D::AliHBTOnePairFctn3D(const Char_t *name, const Char_t *title): | |
978 | AliHBTFunction3D(name,title) | |
1b446896 | 979 | { |
aa4e0a70 | 980 | //constructor |
1b446896 | 981 | } |
26f1270c | 982 | /******************************************************************/ |
983 | ||
984 | AliHBTOnePairFctn3D::AliHBTOnePairFctn3D(Int_t nXbins, Double_t maxXval, Double_t minXval, | |
985 | Int_t nYbins, Double_t maxYval, Double_t minYval, | |
986 | Int_t nZbins, Double_t maxZval, Double_t minZval): | |
987 | AliHBTFunction3D(nXbins, maxXval, minXval, nYbins, maxYval, minYval, nZbins, maxZval, minZval) | |
988 | { | |
aa4e0a70 | 989 | //constructor |
26f1270c | 990 | } |
991 | /******************************************************************/ | |
992 | ||
993 | AliHBTOnePairFctn3D::AliHBTOnePairFctn3D(const Char_t *name, const Char_t *title, | |
994 | Int_t nXbins, Double_t maxXval, Double_t minXval, | |
995 | Int_t nYbins, Double_t maxYval, Double_t minYval, | |
996 | Int_t nZbins, Double_t maxZval, Double_t minZval): | |
997 | AliHBTFunction3D(name,title,nXbins, maxXval, minXval, nYbins, maxYval, minYval, nZbins, maxZval, minZval) | |
998 | { | |
aa4e0a70 | 999 | //constructor |
26f1270c | 1000 | } |
1001 | /******************************************************************/ | |
1002 | ||
1003 | void AliHBTOnePairFctn3D::ProcessSameEventParticles(AliHBTPair* pair) | |
1004 | { | |
1005 | //Reacts on pair coming from same event (real pairs) | |
1006 | //and fills numerator histogram | |
1007 | pair = CheckPair(pair); | |
1008 | if( pair ) | |
1009 | { | |
1010 | Double_t x,y,z; | |
1011 | GetValues(pair,x,y,z); | |
1012 | fNumerator->Fill(x,y,z); | |
1013 | } | |
1014 | } | |
1015 | /******************************************************************/ | |
1016 | ||
1017 | void AliHBTOnePairFctn3D::ProcessDiffEventParticles(AliHBTPair* pair) | |
1018 | { | |
1019 | //Reacts on pair coming from different events (mixed pairs) | |
1020 | //and fills denominator histogram | |
1021 | pair = CheckPair(pair); | |
1022 | if( pair ) | |
1023 | { | |
1024 | Double_t x,y,z; | |
1025 | GetValues(pair,x,y,z); | |
1026 | fDenominator->Fill(x,y,z); | |
1027 | } | |
1028 | } | |
1029 | ||
1030 | /******************************************************************/ | |
1031 | /******************************************************************/ | |
1032 | /******************************************************************/ | |
1033 | ||
1034 | //____________________ | |
1035 | /////////////////////////////////////////////////////// | |
1036 | // // | |
1037 | // AliHBTTwoPairFctn1D // | |
1038 | // // | |
1039 | // Base Calss for 1-dimensinal Functions that need // | |
1040 | // two pair (simulated and reconstructed) // | |
1041 | // to fill function // | |
1042 | // // | |
1043 | // Piotr.Skowronski@cern.ch // | |
1044 | // http://alisoft.cern.ch/people/skowron/analyzer // | |
1045 | // // | |
1046 | /////////////////////////////////////////////////////// | |
1047 | ClassImp(AliHBTTwoPairFctn1D) | |
1048 | /******************************************************************/ | |
1049 | ||
1050 | AliHBTTwoPairFctn1D::AliHBTTwoPairFctn1D(Int_t nbins, Float_t maxXval, Float_t minXval): | |
1051 | AliHBTFunction1D(nbins,maxXval,minXval) | |
1052 | { | |
aa4e0a70 | 1053 | //constructor |
26f1270c | 1054 | } |
1055 | /******************************************************************/ | |
1056 | ||
1057 | AliHBTTwoPairFctn1D::AliHBTTwoPairFctn1D(const Char_t *name, const Char_t *title): | |
1058 | AliHBTFunction1D(name,title) | |
1059 | { | |
aa4e0a70 | 1060 | //constructor |
26f1270c | 1061 | } |
1062 | /******************************************************************/ | |
1063 | ||
1064 | AliHBTTwoPairFctn1D::AliHBTTwoPairFctn1D(const Char_t *name, const Char_t *title, | |
1065 | Int_t nbins, Float_t maxXval, Float_t minXval): | |
1066 | AliHBTFunction1D(name,title,nbins,maxXval,minXval) | |
1067 | { | |
aa4e0a70 | 1068 | //constructor |
26f1270c | 1069 | } |
1070 | /******************************************************************/ | |
1071 | ||
1072 | void AliHBTTwoPairFctn1D::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair) | |
1073 | { | |
6e8d850a | 1074 | // Fills the numerator using pairs from the same event |
26f1270c | 1075 | partpair = CheckPair(partpair); |
0bb07108 | 1076 | if( partpair == 0x0) return; |
1077 | ||
7513c9e5 | 1078 | if (partpair->GetSwapedPair() == 0x0)//it means that Check pair returned swapped pair |
1079 | trackpair = trackpair->GetSwapedPair();//so the track pair must be swapped as well | |
0bb07108 | 1080 | |
1081 | Double_t x = GetValue(trackpair,partpair); | |
1082 | fNumerator->Fill(x); | |
26f1270c | 1083 | } |
1084 | /******************************************************************/ | |
1085 | ||
1086 | void AliHBTTwoPairFctn1D::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair) | |
1087 | { | |
6e8d850a | 1088 | // Fills the denumerator usin mixed pairs |
26f1270c | 1089 | partpair = CheckPair(partpair); |
0bb07108 | 1090 | if( partpair == 0x0) return; |
1091 | ||
7513c9e5 | 1092 | if (partpair->GetSwapedPair() == 0x0)//it means that Check pair returned swapped pair |
1093 | trackpair = trackpair->GetSwapedPair();//so the track pair must be swapped as well | |
0bb07108 | 1094 | |
1095 | Double_t x = GetValue(trackpair,partpair); | |
1096 | fDenominator->Fill(x); | |
26f1270c | 1097 | } |
1098 | /******************************************************************/ | |
1099 | /******************************************************************/ | |
1100 | /******************************************************************/ | |
1101 | ||
1102 | //____________________ | |
1103 | /////////////////////////////////////////////////////// | |
1104 | // // | |
1105 | // AliHBTTwoPairFctn2D // | |
1106 | // // | |
1107 | // Base Calss for 2-dimensinal Functions that need // | |
1108 | // two pair (simulated and reconstructed) // | |
1109 | // to fill function // | |
1110 | // // | |
1111 | // Piotr.Skowronski@cern.ch // | |
1112 | // http://alisoft.cern.ch/people/skowron/analyzer // | |
1113 | // // | |
1114 | /////////////////////////////////////////////////////// | |
1115 | ||
1116 | ClassImp(AliHBTTwoPairFctn2D) | |
1117 | ||
1118 | /******************************************************************/ | |
1119 | ||
1120 | AliHBTTwoPairFctn2D::AliHBTTwoPairFctn2D(const Char_t *name, const Char_t *title): | |
1121 | AliHBTFunction2D(name,title) | |
1122 | { | |
aa4e0a70 | 1123 | //constructor |
26f1270c | 1124 | } |
1125 | /******************************************************************/ | |
1126 | ||
1127 | AliHBTTwoPairFctn2D::AliHBTTwoPairFctn2D(Int_t nXbins, Double_t maxXval, Double_t minXval, | |
1128 | Int_t nYbins, Double_t maxYval, Double_t minYval): | |
1129 | AliHBTFunction2D(nXbins, maxXval, minXval, nYbins, maxYval, minYval) | |
1130 | { | |
aa4e0a70 | 1131 | //constructor |
26f1270c | 1132 | } |
1133 | /******************************************************************/ | |
1134 | ||
1135 | AliHBTTwoPairFctn2D::AliHBTTwoPairFctn2D(const Char_t *name, const Char_t *title, | |
1136 | Int_t nXbins, Double_t maxXval, Double_t minXval, | |
1137 | Int_t nYbins, Double_t maxYval, Double_t minYval): | |
1138 | AliHBTFunction2D(name,title,nXbins, maxXval, minXval, nYbins, maxYval, minYval) | |
1139 | { | |
aa4e0a70 | 1140 | //constructor |
26f1270c | 1141 | } |
1142 | /******************************************************************/ | |
1143 | ||
1144 | void AliHBTTwoPairFctn2D::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair) | |
1b446896 | 1145 | { |
2c33acf3 | 1146 | //processes pair of particles coming from a same events (real pair) |
1147 | partpair = CheckPair(partpair); //check cuts | |
0bb07108 | 1148 | if (partpair == 0x0) return; |
1149 | ||
7513c9e5 | 1150 | if (partpair->GetSwapedPair() == 0x0)//it means that Check pair returned swapped pair |
1151 | trackpair = trackpair->GetSwapedPair();//so the track pair must be swapped as well | |
0bb07108 | 1152 | |
1153 | Double_t x,y; | |
1154 | GetValues(trackpair,partpair,x,y); | |
1155 | fNumerator->Fill(x,y); | |
1b446896 | 1156 | } |
26f1270c | 1157 | /******************************************************************/ |
1b446896 | 1158 | |
26f1270c | 1159 | void AliHBTTwoPairFctn2D::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair) |
1b446896 | 1160 | { |
2c33acf3 | 1161 | //processes pair of particles coming from a different events (mixed pair) |
1b446896 | 1162 | partpair = CheckPair(partpair); |
0bb07108 | 1163 | if (partpair == 0x0) return; |
1164 | ||
7513c9e5 | 1165 | if (partpair->GetSwapedPair() == 0x0)//it means that Check pair returned swapped pair |
1166 | trackpair = trackpair->GetSwapedPair();//so the track pair must be swapped as well | |
0bb07108 | 1167 | |
1168 | Double_t x,y; | |
1169 | GetValues(trackpair,partpair,x,y); | |
1170 | fDenominator->Fill(x,y); | |
1b446896 | 1171 | } |
1172 | ||
ba95ae3f | 1173 | /******************************************************************/ |
1174 | /******************************************************************/ | |
1175 | /******************************************************************/ | |
26f1270c | 1176 | |
1177 | //____________________ | |
1178 | /////////////////////////////////////////////////////// | |
1179 | // // | |
1180 | // AliHBTTwoPairFctn3D // | |
1181 | // // | |
1182 | // Base Calss for 3-dimensinal Functions that need // | |
1183 | // two pair (simulated and reconstructed) // | |
1184 | // to fill function // | |
1185 | // // | |
1186 | // Piotr.Skowronski@cern.ch // | |
1187 | // http://alisoft.cern.ch/people/skowron/analyzer // | |
1188 | // // | |
1189 | /////////////////////////////////////////////////////// | |
1190 | ||
ba95ae3f | 1191 | ClassImp(AliHBTTwoPairFctn3D) |
1192 | ||
26f1270c | 1193 | /******************************************************************/ |
1194 | ||
1195 | AliHBTTwoPairFctn3D::AliHBTTwoPairFctn3D(const Char_t *name, const Char_t *title): | |
1196 | AliHBTFunction3D(name,title) | |
1197 | { | |
aa4e0a70 | 1198 | //constructor |
26f1270c | 1199 | } |
1200 | /******************************************************************/ | |
1201 | ||
1202 | AliHBTTwoPairFctn3D::AliHBTTwoPairFctn3D(Int_t nXbins, Double_t maxXval, Double_t minXval, | |
1203 | Int_t nYbins, Double_t maxYval, Double_t minYval, | |
1204 | Int_t nZbins, Double_t maxZval, Double_t minZval): | |
1205 | AliHBTFunction3D(nXbins, maxXval, minXval, nYbins, maxYval, minYval, nZbins, maxZval, minZval) | |
1206 | { | |
aa4e0a70 | 1207 | //constructor |
26f1270c | 1208 | } |
1209 | /******************************************************************/ | |
1210 | ||
1211 | AliHBTTwoPairFctn3D::AliHBTTwoPairFctn3D(const Char_t *name, const Char_t *title, | |
1212 | Int_t nXbins, Double_t maxXval, Double_t minXval, | |
1213 | Int_t nYbins, Double_t maxYval, Double_t minYval, | |
1214 | Int_t nZbins, Double_t maxZval, Double_t minZval): | |
1215 | AliHBTFunction3D(name,title,nXbins, maxXval, minXval, nYbins, maxYval, minYval, nZbins, maxZval, minZval) | |
1216 | { | |
aa4e0a70 | 1217 | //constructor |
26f1270c | 1218 | } |
1219 | /******************************************************************/ | |
1220 | ||
1221 | void AliHBTTwoPairFctn3D::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair) | |
ba95ae3f | 1222 | { |
6e8d850a | 1223 | // Fills th numerator using pairs from the same event |
ba95ae3f | 1224 | partpair = CheckPair(partpair); |
0bb07108 | 1225 | if( partpair == 0x0) return; |
1226 | ||
7513c9e5 | 1227 | if (partpair->GetSwapedPair() == 0x0)//it means that CheckPair returned swapped pair |
1228 | trackpair = trackpair->GetSwapedPair();//so the track pair must be swapped as well | |
0bb07108 | 1229 | |
1230 | Double_t x,y,z; | |
1231 | GetValues(trackpair,partpair,x,y,z); | |
1232 | fNumerator->Fill(x,y,z); | |
1233 | ||
ba95ae3f | 1234 | } |
26f1270c | 1235 | /******************************************************************/ |
ba95ae3f | 1236 | |
26f1270c | 1237 | void AliHBTTwoPairFctn3D::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair) |
ba95ae3f | 1238 | { |
6e8d850a | 1239 | // Fills the denumerator using mixed pairs |
ba95ae3f | 1240 | partpair = CheckPair(partpair); |
0bb07108 | 1241 | if( partpair == 0x0) return; |
1242 | ||
7513c9e5 | 1243 | if (partpair->GetSwapedPair() == 0x0)//it means that CheckPair returned swapped pair |
1244 | trackpair = trackpair->GetSwapedPair();//so the track pair must be swapped as well | |
0bb07108 | 1245 | |
1246 | Double_t x,y,z; | |
1247 | GetValues(trackpair,partpair,x,y,z); | |
1248 | fDenominator->Fill(x,y,z); | |
ba95ae3f | 1249 | } |
1250 | ||
26f1270c | 1251 | /******************************************************************/ |
1252 | /******************************************************************/ | |
1253 | /******************************************************************/ | |
1254 |