]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HBTAN/AliHBTPIDPurityFctns.cxx
New version of TOF tracker which uses TOF clusters as an input (A. De Caro)
[u/mrichter/AliRoot.git] / HBTAN / AliHBTPIDPurityFctns.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 /* $Id$ */
17
18 #include "AliHBTPIDPurityFctns.h"
19 #include "AliLog.h"
20
21 //_______________________________________________________________________________
22 /////////////////////////////////////////////////////////////////////////////////
23 //
24 // class AliHBTMonPhiResolutionVsPtFctn;
25 // class AliHBTMonThetaResolutionVsPtFctn;
26 //
27 // file: AliHBTPIDPurityFctns.cxx AliHBTPIDPurityFctns.h
28 //
29 // Classes for calculating PID purity, efficiency and other things connected with PID
30 // xxx
31 // xxx
32 //
33 // added by Piotr.Skowronski@cern.ch
34 //
35 //////////////////////////////////////////////////////////////////////////////////
36
37
38 /******************************************************************/
39 /******************************************************************/
40 /******************************************************************/
41
42 ClassImp(AliHBTMonPIDPurityVsPtFctn)
43
44 AliHBTMonPIDPurityVsPtFctn::AliHBTMonPIDPurityVsPtFctn(Int_t nbins, Double_t maxXval, Double_t minXval):
45  AliHBTMonTwoParticleFctn1D(nbins,maxXval,minXval),
46  fGood(0x0),
47  fAll(0x0)
48 {
49   //ctor
50   Rename("pidpurityvspt","PIDPurityVsPt");
51   
52 }
53 /******************************************************************/
54
55 AliHBTMonPIDPurityVsPtFctn::AliHBTMonPIDPurityVsPtFctn(const AliHBTMonPIDPurityVsPtFctn& /*in*/):
56  AliHBTMonTwoParticleFctn1D(),
57  AliHBTCorrelFunction(),
58  fGood(0x0),
59  fAll(0x0)
60 {
61   //cpy constructor
62   Error("AliHBTMonPIDPurityVsPtFctn(const AliHBTMonPIDPurityVsPtFctn&",
63         "Functions can not be copied because of histogram names clashes");
64 }
65
66 /******************************************************************/
67
68 AliHBTMonPIDPurityVsPtFctn::~AliHBTMonPIDPurityVsPtFctn()
69 {
70  //dtor
71   delete fGood;
72   delete fAll;
73 }
74 /******************************************************************/
75
76 AliHBTMonPIDPurityVsPtFctn& AliHBTMonPIDPurityVsPtFctn::operator=
77                                    (const AliHBTMonPIDPurityVsPtFctn& /*in*/)
78 {
79 //assigment operator
80   Error("operator=","Functions can not be copied because of histogram names clashes");
81   return *this;
82 }
83 /******************************************************************/
84
85 void AliHBTMonPIDPurityVsPtFctn::Write()
86 {
87 //Writes a fucntion results
88  AliHBTMonitorFunction::Write();
89  fGood->Write();
90  fAll->Write();
91 }
92 /******************************************************************/
93
94 void AliHBTMonPIDPurityVsPtFctn::Init()
95 {
96 //Initializes fuction
97   AliDebug(1,"Entering");
98
99   if (fResult == 0x0)
100    {   
101       AliWarning("Function has NULL result histogram!");
102       return;
103    }
104   
105   if (fGood == 0x0)
106    {
107      TString numstr = fName + " Good";  //title and name of the
108                                            //result histogram
109      TAxis* xax = fResult->GetXaxis();
110      fGood = new TH1D(numstr,numstr,xax->GetNbins(),xax->GetXmin(),xax->GetXmax());
111    }
112
113   if (fAll == 0x0)
114    {
115      TString numstr = fName + " All";  //title and name of the
116                                            //result histogram
117      TAxis* xax = fResult->GetXaxis();
118      fAll = new TH1D(numstr,numstr,xax->GetNbins(),xax->GetXmin(),xax->GetXmax());
119    }
120
121   fResult->Reset();
122   fResult->SetDirectory(0x0);
123   fResult->Sumw2();
124   fGood->Reset();
125   fGood->SetDirectory(0x0);
126   fGood->Sumw2();
127   fAll->Reset();
128   fAll->SetDirectory(0x0);
129   fAll->Sumw2();
130
131   AliDebug(1,"Done");
132 }
133
134 /******************************************************************/
135
136 void AliHBTMonPIDPurityVsPtFctn::Rename(const Char_t * name)
137
138   //Rename fuctions and all histograms belonging to it
139   SetName(name);
140   SetTitle(name);
141   
142   if (fResult)
143    {
144      TString numstr = fName + " Result";  //title and name of the result histogram
145      fResult->SetName(numstr);
146      fResult->SetTitle(numstr);
147    }
148    
149   if (fGood)
150    {
151      TString numstr = fName + " Good";
152      fGood->SetName(numstr);
153      fGood->SetTitle(numstr);
154    }
155    
156   if (fAll)
157    {
158      TString numstr = fName + " All";
159      fAll->SetName(numstr);
160      fAll->SetTitle(numstr);
161    }
162 }
163 /******************************************************************/
164
165 void AliHBTMonPIDPurityVsPtFctn::Rename(const Char_t * name, const Char_t * title)
166 {
167  //renames and retitle the function and histograms
168  
169   SetName(name);
170   SetTitle(title);
171   
172   if (fResult)
173    {
174      TString numstrn = fName + " Result";  //name of the result histogram
175      TString numstrt = fTitle + " Result";  //title of the result histogram
176      fResult->SetName(numstrn);
177      fResult->SetTitle(numstrt);
178    }
179   if (fGood)
180    {
181      TString numstrn = fName + " Good";  //name of the Good histogram
182      TString numstrt = fTitle + " Good";  //title of the Good histogram
183      fGood->SetName(numstrn);
184      fGood->SetTitle(numstrt);
185    }
186
187   if (fAll)
188    {
189      TString numstrn = fName + " All";  //name of the All histogram
190      TString numstrt = fTitle + " All";  //title of the All histogram
191      fAll->SetName(numstrn);
192      fAll->SetTitle(numstrt);
193    }
194
195 }
196 /******************************************************************/
197
198 TH1* AliHBTMonPIDPurityVsPtFctn::GetResult()
199 {
200   //Returns the result of the fuction
201   //that is histogram with effciency and contamination
202   
203   fResult->Divide(fGood,fAll);
204   return fResult;
205 }
206 /******************************************************************/
207
208 void AliHBTMonPIDPurityVsPtFctn::Process(AliVAODParticle * track,AliVAODParticle * part)
209 {
210  //process the particle/track
211  Double_t pt = part->Pt();
212  fAll->Fill(pt);
213  if (track->GetPdgCode() == part->GetPdgCode()) 
214   {
215     fGood->Fill(pt);
216   }
217 // else
218 //  {
219 //    Info("Process","Catched pid impurity ...");
220 //  }
221 }
222
223 /******************************************************************/
224 /******************************************************************/
225 /******************************************************************/
226
227 ClassImp(AliHBTMonPIDContaminationVsPtFctn)
228
229 AliHBTMonPIDContaminationVsPtFctn::AliHBTMonPIDContaminationVsPtFctn(Int_t nbins, Double_t maxXval, Double_t minXval):
230  AliHBTMonTwoParticleFctn1D(nbins,maxXval,minXval),
231  fWrong(0x0),
232  fAll(0x0)
233 {
234   //ctor
235   Rename("pidcontaminationvspt","PIDContaminationVsPt");
236 }
237 /******************************************************************/
238
239 AliHBTMonPIDContaminationVsPtFctn::AliHBTMonPIDContaminationVsPtFctn
240                                           (const AliHBTMonPIDContaminationVsPtFctn& /*in*/):
241  AliHBTMonTwoParticleFctn1D(),
242  AliHBTCorrelFunction(),
243  fWrong(0x0),
244  fAll(0x0)
245 {
246   //cpy constructor
247   Error("AliHBTMonPIDContaminationVsPtFctn(const AliHBTMonPIDContaminationVsPtFctn&",
248         "Functions can not be copied because of histogram names clashes");
249 }
250
251 /******************************************************************/
252
253 AliHBTMonPIDContaminationVsPtFctn::~AliHBTMonPIDContaminationVsPtFctn()
254 {
255  //dtor
256   delete fWrong;
257   delete fAll;
258 }
259 /******************************************************************/
260
261 AliHBTMonPIDContaminationVsPtFctn& AliHBTMonPIDContaminationVsPtFctn::operator=
262                                            (const AliHBTMonPIDContaminationVsPtFctn& /*in*/)
263 {
264 //assigment operator
265   Error("operator=","Functions can not be copied because of histogram names clashes");
266   return *this;
267 }
268 /******************************************************************/
269
270 void AliHBTMonPIDContaminationVsPtFctn::Write()
271 {
272  //Writes the function results
273  AliHBTMonitorFunction::Write();
274  fWrong->Write();
275  fAll->Write();
276 }
277 /******************************************************************/
278
279 void AliHBTMonPIDContaminationVsPtFctn::Init()
280 {
281 //Initializes fuction
282   AliDebug(1,"Entering");
283
284   if (fResult == 0x0)
285    {   
286       AliWarning("Function has NULL result histogram!");
287       return;
288    }
289   
290   if (fWrong == 0x0)
291    {
292      TString numstr = fName + " Wrong";  //title and name of the
293                                            //result histogram
294      TAxis* xax = fResult->GetXaxis();
295      fWrong = new TH1D(numstr,numstr,xax->GetNbins(),xax->GetXmin(),xax->GetXmax());
296    }
297
298   if (fAll == 0x0)
299    {
300      TString numstr = fName + " All";  //title and name of the
301                                            //result histogram
302      TAxis* xax = fResult->GetXaxis();
303      fAll = new TH1D(numstr,numstr,xax->GetNbins(),xax->GetXmin(),xax->GetXmax());
304    }
305   fResult->Reset();
306   fResult->SetDirectory(0x0);
307   fResult->Sumw2();
308   fWrong->Reset();
309   fWrong->SetDirectory(0x0);
310   fWrong->Sumw2();
311   fAll->Reset();
312   fAll->SetDirectory(0x0);
313   fAll->Sumw2();
314   
315   AliDebug(1,"Done");
316 }
317
318 /******************************************************************/
319
320 void AliHBTMonPIDContaminationVsPtFctn::Rename(const Char_t * name)
321
322   //Rename fuctions and all histograms belonging to it
323   SetName(name);
324   SetTitle(name);
325   
326   if (fResult)
327    {
328      TString numstr = fName + " Result";  //title and name of the result histogram
329      fResult->SetName(numstr);
330      fResult->SetTitle(numstr);
331    }
332   if (fWrong)
333    {
334      TString numstr = fName + " Wrong";
335      fWrong->SetName(numstr);
336      fWrong->SetTitle(numstr);
337    }
338
339   if (fAll)
340    {
341      TString numstrn = fName + " All";  //name of the All histogram
342      TString numstrt = fTitle + " All";  //title of the All histogram
343      fAll->SetName(numstrn);
344      fAll->SetTitle(numstrt);
345    }
346 }
347 /******************************************************************/
348
349 void AliHBTMonPIDContaminationVsPtFctn::Rename(const Char_t * name, const Char_t * title)
350 {
351  //renames and retitle the function and histograms
352  
353   SetName(name);
354   SetTitle(title);
355   
356   if (fResult)
357    {
358      TString numstrn = fName + " Result";  //name of the result histogram
359      TString numstrt = fTitle + " Result";  //title of the result histogram
360      fResult->SetName(numstrn);
361      fResult->SetTitle(numstrt);
362    }
363   if (fWrong)
364    {
365      TString numstrn = fName + " Wrong";  //name of the Wrong histogram
366      TString numstrt = fTitle + " Wrong";  //title of the Wrong histogram
367      fWrong->SetName(numstrn);
368      fWrong->SetTitle(numstrt);
369    }
370    
371   if (fAll)
372    {
373      TString numstr = fName + " All";
374      fAll->SetName(numstr);
375      fAll->SetTitle(numstr);
376    }
377
378 }
379 /******************************************************************/
380
381 TH1* AliHBTMonPIDContaminationVsPtFctn::GetResult()
382 {
383   //Returns the result of the fuction
384   //that is histogram with effciency and contamination
385   
386   fResult->Divide(fWrong,fAll);
387   return fResult;
388 }
389 /******************************************************************/
390
391 void AliHBTMonPIDContaminationVsPtFctn::Process(AliVAODParticle * track, AliVAODParticle * part)
392 {
393  //process the particle/track
394  Double_t pt = part->Pt();
395  fAll->Fill(pt);
396  
397  if (track->GetPdgCode() != part->GetPdgCode()) 
398   {
399 //    Info("Process","Catched contamination");
400 //    track->Print();part->Print();
401     fWrong->Fill(pt);
402   }
403 }
404
405 /******************************************************************/
406 /******************************************************************/
407 /******************************************************************/
408 ClassImp(AliHBTQInvCorrelFctnPerfectPID)
409
410 AliHBTQInvCorrelFctnPerfectPID::AliHBTQInvCorrelFctnPerfectPID(Int_t nbins, Double_t maxXval, Double_t minXval):
411  AliHBTTwoPairFctn1D(nbins,maxXval,minXval)
412 {
413 //ctor
414  fWriteNumAndDen = kTRUE;//change default behaviour
415  Rename("qinvcfprfctpid","Q_{inv} Correlation Function Perfect PID");
416 }
417 /*************************************************************/
418
419 void AliHBTQInvCorrelFctnPerfectPID::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
420 {
421 //Fills numerator
422   if (trackpair->Particle1()->GetPdgCode() != partpair->Particle1()->GetPdgCode()) return;
423   if (trackpair->Particle2()->GetPdgCode() != partpair->Particle2()->GetPdgCode()) return;
424
425   trackpair  = CheckPair(trackpair);
426   if (trackpair == 0x0) return;
427 //  partpair  = CheckPair(partpair);
428   if (partpair == 0x0) return;
429
430   fNumerator->Fill(trackpair->GetQInv());
431 }
432
433 /*************************************************************/
434 void AliHBTQInvCorrelFctnPerfectPID::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
435 {
436 //Fills numerator
437   if (trackpair->Particle1()->GetPdgCode() != partpair->Particle1()->GetPdgCode()) return;
438   if (trackpair->Particle2()->GetPdgCode() != partpair->Particle2()->GetPdgCode()) return;
439
440   trackpair  = CheckPair(trackpair);
441   if (trackpair == 0x0) return;
442 //  partpair  = CheckPair(partpair);
443   if (partpair == 0x0) return;
444
445   fDenominator->Fill(trackpair->GetQInv());
446 }
447 /*************************************************************/
448
449 TH1* AliHBTQInvCorrelFctnPerfectPID::GetResult()
450 {
451  //returns the scaled ratio
452  
453  delete fRatio;
454  fRatio = GetRatio(Scale());
455  return fRatio;
456 }
457 /*************************************************************/
458 /******************************************************************/
459 /******************************************************************/
460 /******************************************************************/
461
462 ClassImp(AliHBTWeightQInvCorrelFctnPerfectPID)
463
464 AliHBTWeightQInvCorrelFctnPerfectPID::AliHBTWeightQInvCorrelFctnPerfectPID(Int_t nbins, Double_t maxXval, Double_t minXval):
465  AliHBTTwoPairFctn1D(nbins,maxXval,minXval)
466 {
467 //ctor
468  fWriteNumAndDen = kTRUE;//change default behaviour
469  Rename("wqinvcfprfctpid","Q_{inv} Weight Correlation Function Perfect PID");
470 }
471 /*************************************************************/
472
473 void AliHBTWeightQInvCorrelFctnPerfectPID::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
474 {
475 //Fills numerator
476   if (trackpair->Particle1()->GetPdgCode() != partpair->Particle1()->GetPdgCode()) return;
477   if (trackpair->Particle2()->GetPdgCode() != partpair->Particle2()->GetPdgCode()) return;
478
479   trackpair  = CheckPair(trackpair);
480   if (trackpair == 0x0) return;
481 //  partpair  = CheckPair(partpair);
482   if (partpair == 0x0) return;
483
484   fNumerator->Fill(trackpair->GetQInv(),partpair->GetWeight());
485 }
486
487 /*************************************************************/
488 void AliHBTWeightQInvCorrelFctnPerfectPID::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
489 {
490 //Fills numerator
491   if (trackpair->Particle1()->GetPdgCode() != partpair->Particle1()->GetPdgCode()) return;
492   if (trackpair->Particle2()->GetPdgCode() != partpair->Particle2()->GetPdgCode()) return;
493
494   trackpair  = CheckPair(trackpair);
495   if (trackpair == 0x0) return;
496 //  partpair  = CheckPair(partpair);
497   if (partpair == 0x0) return;
498   
499   fDenominator->Fill(trackpair->GetQInv());
500 }
501 /*************************************************************/
502
503 TH1* AliHBTWeightQInvCorrelFctnPerfectPID::GetResult()
504 {
505  //returns the scaled ratio
506  
507  delete fRatio;
508  fRatio = GetRatio(Scale());
509  return fRatio;
510 }
511
512
513 /******************************************************************/
514 /******************************************************************/
515 /******************************************************************/
516
517 ClassImp(AliHBTWeightQOutSQideQLongFctnPerfectPID)
518
519 AliHBTWeightQOutSQideQLongFctnPerfectPID::AliHBTWeightQOutSQideQLongFctnPerfectPID
520   (Int_t nXbins, Double_t maxXval, Double_t minXval,
521    Int_t nYbins, Double_t maxYval, Double_t minYval,
522    Int_t nZbins, Double_t maxZval, Double_t minZval):
523  AliHBTTwoPairFctn3D(nXbins,maxXval,minXval,nYbins,maxYval,minYval,nZbins,maxZval,minZval)
524 {
525   //ctor
526   fWriteNumAndDen = kTRUE;//change default behaviour
527   Rename("wqoslprfctpid","Q_{out}-Q_{side}-Q_{long} Weight Fctn with perfect PID");
528 }
529 /*************************************************************/
530
531 void AliHBTWeightQOutSQideQLongFctnPerfectPID::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
532 {
533 //Fills numerator
534   if (trackpair->Particle1()->GetPdgCode() != partpair->Particle1()->GetPdgCode()) return;
535   if (trackpair->Particle2()->GetPdgCode() != partpair->Particle2()->GetPdgCode()) return;
536
537   trackpair  = CheckPair(trackpair);
538   if (trackpair == 0x0) return;
539 //  partpair  = CheckPair(partpair);
540   if (partpair == 0x0) return;
541
542
543   Double_t weight = partpair->GetWeight();
544   Double_t out = trackpair->GetQOutLCMS();
545   Double_t side = trackpair->GetQSideLCMS();
546   Double_t lon = trackpair->GetQLongLCMS();
547
548   if (fAbs)
549    {
550      out = TMath::Abs(out);
551      side = TMath::Abs(side);
552      lon = TMath::Abs(lon);
553    }
554   fNumerator->Fill(out,side,lon,weight);
555 }
556 /*************************************************************/
557
558 void AliHBTWeightQOutSQideQLongFctnPerfectPID::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
559 {
560 //Fills numerator
561   if (trackpair->Particle1()->GetPdgCode() != partpair->Particle1()->GetPdgCode()) return;
562   if (trackpair->Particle2()->GetPdgCode() != partpair->Particle2()->GetPdgCode()) return;
563
564   trackpair  = CheckPair(trackpair);
565   if (trackpair == 0x0) return;
566 //  partpair  = CheckPair(partpair);
567   if (partpair == 0x0) return;
568
569   Double_t out = trackpair->GetQOutLCMS();
570   Double_t side = trackpair->GetQSideLCMS();
571   Double_t lon = trackpair->GetQLongLCMS();
572
573   if (fAbs)
574    {
575      out = TMath::Abs(out);
576      side = TMath::Abs(side);
577      lon = TMath::Abs(lon);
578    }
579   fDenominator->Fill(out,side,lon);
580 }
581 /******************************************************************/
582
583 TH1* AliHBTWeightQOutSQideQLongFctnPerfectPID::GetResult()
584 {
585  //returns the scaled ratio
586  delete fRatio;
587  fRatio = GetRatio(Scale());
588  return fRatio;
589 }
590
591
592 /******************************************************************/
593 /******************************************************************/
594 /******************************************************************/
595
596 ClassImp(AliHBTQOutSQideQLongFctnPerfectPID)
597
598 AliHBTQOutSQideQLongFctnPerfectPID::AliHBTQOutSQideQLongFctnPerfectPID
599    (Int_t nXbins, Double_t maxXval, Double_t minXval,
600     Int_t nYbins, Double_t maxYval, Double_t minYval,
601     Int_t nZbins, Double_t maxZval, Double_t minZval):
602  AliHBTTwoPairFctn3D(nXbins,maxXval,minXval,nYbins,maxYval,minYval,nZbins,maxZval,minZval)
603 {
604   //ctor
605   fWriteNumAndDen = kTRUE;//change default behaviour
606   Rename("qoslprfctpid","Q_{out}-Q_{side}-Q_{long} Fctn with perfect PID");
607 }
608 /*************************************************************/
609
610 void AliHBTQOutSQideQLongFctnPerfectPID::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
611 {
612 //Fills numerator
613   if (trackpair->Particle1()->GetPdgCode() != partpair->Particle1()->GetPdgCode()) return;
614   if (trackpair->Particle2()->GetPdgCode() != partpair->Particle2()->GetPdgCode()) return;
615
616   trackpair  = CheckPair(trackpair);
617   if (trackpair == 0x0) return;
618 //  partpair  = CheckPair(partpair);
619   if (partpair == 0x0) return;
620   
621   Double_t out = trackpair->GetQOutLCMS();
622   Double_t side = trackpair->GetQSideLCMS();
623   Double_t lon = trackpair->GetQLongLCMS();
624
625   if (fAbs)
626    {
627      out = TMath::Abs(out);
628      side = TMath::Abs(side);
629      lon = TMath::Abs(lon);
630    }
631   fNumerator->Fill(out,side,lon);
632 }
633 /*************************************************************/
634
635 void AliHBTQOutSQideQLongFctnPerfectPID::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
636 {
637 //Fills numerator
638   if (trackpair->Particle1()->GetPdgCode() != partpair->Particle1()->GetPdgCode()) return;
639   if (trackpair->Particle2()->GetPdgCode() != partpair->Particle2()->GetPdgCode()) return;
640
641   trackpair  = CheckPair(trackpair);
642   if (trackpair == 0x0) return;
643 //  partpair  = CheckPair(partpair);
644   if (partpair == 0x0) return;
645   
646   Double_t out = trackpair->GetQOutLCMS();
647   Double_t side = trackpair->GetQSideLCMS();
648   Double_t lon = trackpair->GetQLongLCMS();
649
650   if (fAbs)
651    {
652      out = TMath::Abs(out);
653      side = TMath::Abs(side);
654      lon = TMath::Abs(lon);
655    }
656   fDenominator->Fill(out,side,lon);
657 }
658 /******************************************************************/
659
660 TH1* AliHBTQOutSQideQLongFctnPerfectPID::GetResult()
661 {
662  //returns the scaled ratio
663  delete fRatio;
664  fRatio = GetRatio(Scale());
665  return fRatio;
666 }
667
668 /******************************************************************/
669 /******************************************************************/
670 /******************************************************************/
671
672
673
674 ClassImp(AliHBTPairPIDProbVsQInvFctn)
675
676 AliHBTPairPIDProbVsQInvFctn::AliHBTPairPIDProbVsQInvFctn(Int_t nbins, Double_t maxXval, Double_t minXval):
677  AliHBTOnePairFctn1D(nbins,maxXval,minXval)
678 {
679  fWriteNumAndDen = kTRUE;//change default behaviour
680  Rename("qinvpidpur","Q_{inv}  Function");
681 }
682 /******************************************************************/
683
684 TH1* AliHBTPairPIDProbVsQInvFctn::GetResult()
685 {
686  //returns the scaled ratio
687  delete fRatio;
688  fRatio = GetRatio(Scale());
689  return fRatio;
690 }
691 /******************************************************************/
692
693 void AliHBTPairPIDProbVsQInvFctn::ProcessSameEventParticles(AliHBTPair* pair)
694 {
695  //Fills the numerator using pair from the same event
696    pair = CheckPair(pair);
697    if(pair) fNumerator->Fill(pair->GetQInv(),pair->GetPIDProb());
698 }
699 /******************************************************************/
700
701 void AliHBTPairPIDProbVsQInvFctn::ProcessDiffEventParticles(AliHBTPair* pair)
702  {
703   //Fills the denumerator using mixed pairs
704    pair = CheckPair(pair);
705    if(pair) fDenominator->Fill(pair->GetQInv(),pair->GetPIDProb());
706   }
707
708 /******************************************************************/
709 /******************************************************************/
710 /******************************************************************/
711
712 ClassImp(AliHBTPairPIDProbVsQOutSQideQLongFctn)
713
714 AliHBTPairPIDProbVsQOutSQideQLongFctn::AliHBTPairPIDProbVsQOutSQideQLongFctn(Int_t nXbins, Double_t maxXval, Double_t minXval,
715                                                    Int_t nYbins, Double_t maxYval, Double_t minYval,
716                                                    Int_t nZbins, Double_t maxZval, Double_t minZval):
717  AliHBTOnePairFctn3D(nXbins,maxXval,minXval,nYbins,maxYval,minYval,nZbins,maxZval,minZval)
718 {
719   //ctor
720   fWriteNumAndDen = kTRUE;//change default behaviour
721   Rename("qoslpidpur","Pair PID Probablilty .vs. Q_{out}-Q_{side}-Q_{long} Fctn");
722 }
723 /*************************************************************/
724
725 void AliHBTPairPIDProbVsQOutSQideQLongFctn::ProcessSameEventParticles(AliHBTPair* pair)
726 {
727 //Fills numerator
728   pair  = CheckPair(pair);
729   if (pair == 0x0) return;
730   Double_t weight = pair->GetPIDProb();
731   Double_t out = pair->GetQOutLCMS();
732   Double_t side = pair->GetQSideLCMS();
733   Double_t lon = pair->GetQLongLCMS();
734
735   if (fAbs)
736    {
737      out = TMath::Abs(out);
738      side = TMath::Abs(side);
739      lon = TMath::Abs(lon);
740    }
741
742   fNumerator->Fill(out,side,lon,weight);
743 }
744 /*************************************************************/
745
746 void AliHBTPairPIDProbVsQOutSQideQLongFctn::ProcessDiffEventParticles(AliHBTPair* pair)
747 {
748 //Fills numerator
749   pair  = CheckPair(pair);
750   if (pair == 0x0) return;
751   Double_t weight = pair->GetPIDProb();
752   Double_t out = pair->GetQOutLCMS();
753   Double_t side = pair->GetQSideLCMS();
754   Double_t lon = pair->GetQLongLCMS();
755
756   if (fAbs)
757    {
758      out = TMath::Abs(out);
759      side = TMath::Abs(side);
760      lon = TMath::Abs(lon);
761    }
762   
763   fDenominator->Fill(out,side,lon,weight);
764 }
765 /*************************************************************/
766
767 TH1* AliHBTPairPIDProbVsQOutSQideQLongFctn::GetResult()
768 {
769  //returns the scaled ratio
770  
771  delete fRatio;
772  fRatio = GetRatio(Scale());
773  return fRatio;
774 }
775
776 /******************************************************************/
777 /******************************************************************/
778 /******************************************************************/
779
780 ClassImp(AliHBTTwoTrackEffFctnPtThetaPhiPerfectPID)
781
782 AliHBTTwoTrackEffFctnPtThetaPhiPerfectPID::AliHBTTwoTrackEffFctnPtThetaPhiPerfectPID(Int_t nXbins, Double_t maxXval, Double_t minXval,
783                                                    Int_t nYbins, Double_t maxYval, Double_t minYval,
784                                                    Int_t nZbins, Double_t maxZval, Double_t minZval):
785  AliHBTTwoPairFctn3D(nXbins,maxXval,minXval,nYbins,maxYval,minYval,nZbins,maxZval,minZval)
786 {
787 //ctor
788 //Set Axis Title
789  fWriteNumAndDen = kTRUE;
790  Rename("tteffptthetaphipfctPID","P_{t} \\theta \\phi Two Track Efficiency Function");
791  if(fNumerator)
792   {
793    fNumerator->GetXaxis()->SetTitle("\\Delta P_{t} [GeV]");
794    fNumerator->GetYaxis()->SetTitle("\\Delta \\theta [rad]");
795    fNumerator->GetZaxis()->SetTitle("\\Delta \\phi [rad]");
796   }
797
798  if(fDenominator)
799   {
800    fDenominator->GetXaxis()->SetTitle("\\Delta P_{t} [GeV]");
801    fDenominator->GetYaxis()->SetTitle("\\Delta \\theta [rad]");
802    fDenominator->GetZaxis()->SetTitle("\\Delta \\phi [rad]");
803   }
804 }
805 /******************************************************************/
806
807 void AliHBTTwoTrackEffFctnPtThetaPhiPerfectPID::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
808 {
809 //Fills numerator
810   if (trackpair->Particle1()->GetPdgCode() != partpair->Particle1()->GetPdgCode()) return;
811   if (trackpair->Particle2()->GetPdgCode() != partpair->Particle2()->GetPdgCode()) return;
812
813   trackpair  = CheckPair(trackpair);
814   if (trackpair == 0x0) return;
815 //  partpair  = CheckPair(partpair);
816   if (partpair == 0x0) return;
817
818   Double_t x = TMath::Abs(trackpair->GetDeltaPt());
819   Double_t y = TMath::Abs(trackpair->GetDeltaTheta());
820   Double_t z = TMath::Abs(trackpair->GetDeltaPhi());
821   fNumerator->Fill(x,y,z);
822 }
823 /******************************************************************/
824
825 void AliHBTTwoTrackEffFctnPtThetaPhiPerfectPID::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
826 {
827 //Fills numerator
828   if (trackpair->Particle1()->GetPdgCode() != partpair->Particle1()->GetPdgCode()) return;
829   if (trackpair->Particle2()->GetPdgCode() != partpair->Particle2()->GetPdgCode()) return;
830
831   trackpair  = CheckPair(trackpair);
832   if (trackpair == 0x0) return;
833 //  partpair  = CheckPair(partpair);
834   if (partpair == 0x0) return;
835
836   Double_t x = TMath::Abs(trackpair->GetDeltaPt());
837   Double_t y = TMath::Abs(trackpair->GetDeltaTheta());
838   Double_t z = TMath::Abs(trackpair->GetDeltaPhi());
839   fDenominator->Fill(x,y,z);
840 }
841 /******************************************************************/
842
843 TH1* AliHBTTwoTrackEffFctnPtThetaPhiPerfectPID::GetResult()
844 {
845 //returns ratio of numerator and denominator
846  delete fRatio;
847  fRatio = GetRatio(Scale());
848  if(fRatio)
849   {
850    fRatio->GetXaxis()->SetTitle("\\Delta P_{t} [GeV]");
851    fRatio->GetYaxis()->SetTitle("\\Delta \\theta [rad]");
852    fRatio->GetZaxis()->SetTitle("\\Delta \\phi [rad]");
853   }
854  return fRatio;
855 }
856 /******************************************************************/
857 /******************************************************************/
858 /******************************************************************/
859
860 ClassImp(AliHBTPairPIDProbVsPtThetaPhiFctn)
861
862 AliHBTPairPIDProbVsPtThetaPhiFctn::AliHBTPairPIDProbVsPtThetaPhiFctn(Int_t nXbins, Double_t maxXval, Double_t minXval,
863                                                    Int_t nYbins, Double_t maxYval, Double_t minYval,
864                                                    Int_t nZbins, Double_t maxZval, Double_t minZval):
865  AliHBTOnePairFctn3D(nXbins,maxXval,minXval,nYbins,maxYval,minYval,nZbins,maxZval,minZval)
866 {
867   //ctor
868   fWriteNumAndDen = kTRUE;//change default behaviour
869   Rename("ptthetaphipidpur","Pair PID Probablilty .vs. \\Delta P_{t}-\\Delta \\theta-\\Delta \\phi Fctn");
870   if(fNumerator)
871    {
872     fNumerator->GetXaxis()->SetTitle("\\Delta P_{t} [GeV]");
873     fNumerator->GetYaxis()->SetTitle("\\Delta \\theta [rad]");
874     fNumerator->GetZaxis()->SetTitle("\\Delta \\phi [rad]");
875    }
876
877   if(fDenominator)
878    {
879     fDenominator->GetXaxis()->SetTitle("\\Delta P_{t} [GeV]");
880     fDenominator->GetYaxis()->SetTitle("\\Delta \\theta [rad]");
881     fDenominator->GetZaxis()->SetTitle("\\Delta \\phi [rad]");
882    }
883   
884 }
885 /*************************************************************/
886
887 void AliHBTPairPIDProbVsPtThetaPhiFctn::ProcessSameEventParticles(AliHBTPair* pair)
888 {
889 //Fills numerator
890   pair  = CheckPair(pair);
891   if (pair == 0x0) return;
892   Double_t weight = pair->GetPIDProb();
893   Double_t pt = TMath::Abs(pair->GetDeltaPt());
894   Double_t theta = TMath::Abs(pair->GetDeltaTheta());
895   Double_t phi = TMath::Abs(pair->GetDeltaPhi());
896   fNumerator->Fill(pt,theta,phi,weight);
897 }
898 /*************************************************************/
899
900 void AliHBTPairPIDProbVsPtThetaPhiFctn::ProcessDiffEventParticles(AliHBTPair* pair)
901 {
902 //Fills numerator
903   pair  = CheckPair(pair);
904   if (pair == 0x0) return;
905   Double_t weight = pair->GetPIDProb();
906   Double_t pt = TMath::Abs(pair->GetDeltaPt());
907   Double_t phi = TMath::Abs(pair->GetDeltaTheta());
908   Double_t theta = TMath::Abs(pair->GetDeltaPhi());
909   fDenominator->Fill(pt,theta,phi,weight);
910 }
911 /*************************************************************/
912
913 TH1* AliHBTPairPIDProbVsPtThetaPhiFctn::GetResult()
914 {
915  //returns the scaled ratio
916  
917  delete fRatio;
918  fRatio = GetRatio(Scale());
919  if(fRatio)
920   {
921    fRatio->GetXaxis()->SetTitle("\\Delta P_{t} [GeV]");
922    fRatio->GetYaxis()->SetTitle("\\Delta \\theta [rad]");
923    fRatio->GetZaxis()->SetTitle("\\Delta \\phi [rad]");
924   }
925  return fRatio;
926 }
927