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