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