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