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