1 #include "AliHBTPIDPurityFctns.h"
2 //_______________________________________________________________________________
3 /////////////////////////////////////////////////////////////////////////////////
5 // class AliHBTMonPhiResolutionVsPtFctn;
6 // class AliHBTMonThetaResolutionVsPtFctn;
8 // file: AliHBTPIDPurityFctns.cxx AliHBTPIDPurityFctns.h
10 // Caution: On 2D plots on X axis in simulated values
11 // That is contrary to two-particle resolutions where it is reconstructed one
13 // added by Piotr.Skowronski@cern.ch
16 //////////////////////////////////////////////////////////////////////////////////
19 /******************************************************************/
20 /******************************************************************/
21 /******************************************************************/
23 ClassImp(AliHBTMonPIDPurityVsPtFctn)
25 AliHBTMonPIDPurityVsPtFctn::AliHBTMonPIDPurityVsPtFctn(Int_t nbins, Double_t maxXval, Double_t minXval):
26 AliHBTMonTwoParticleFctn1D(nbins,maxXval,minXval),
31 Rename("pidpurityvspt","PIDPurityVsPt");
34 /******************************************************************/
36 AliHBTMonPIDPurityVsPtFctn::~AliHBTMonPIDPurityVsPtFctn()
42 /******************************************************************/
43 void AliHBTMonPIDPurityVsPtFctn::Write()
45 AliHBTMonitorFunction::Write();
49 /******************************************************************/
51 void AliHBTMonPIDPurityVsPtFctn::Init()
54 if (AliHBTParticle::GetDebug()>0) Info("Init","%s",GetName());
58 Warning("Init","Function has NULL result histogram!");
64 TString numstr = fName + " Good"; //title and name of the
66 TAxis* xax = fResult->GetXaxis();
67 fGood = new TH1D(numstr,numstr,xax->GetNbins(),xax->GetXmin(),xax->GetXmax());
72 TString numstr = fName + " All"; //title and name of the
74 TAxis* xax = fResult->GetXaxis();
75 fAll = new TH1D(numstr,numstr,xax->GetNbins(),xax->GetXmin(),xax->GetXmax());
79 fResult->SetDirectory(0x0);
82 fGood->SetDirectory(0x0);
85 fAll->SetDirectory(0x0);
88 if (AliHBTParticle::GetDebug()>0) Info("Init","%s Done.",GetName());
91 /******************************************************************/
93 void AliHBTMonPIDPurityVsPtFctn::Rename(const Char_t * name)
95 //Rename fuctions and all histograms belonging to it
101 TString numstr = fName + " Result"; //title and name of the result histogram
102 fResult->SetName(numstr);
103 fResult->SetTitle(numstr);
107 TString numstr = fName + " Good";
108 fGood->SetName(numstr);
109 fGood->SetTitle(numstr);
114 TString numstr = fName + " All";
115 fAll->SetName(numstr);
116 fAll->SetTitle(numstr);
119 /******************************************************************/
121 void AliHBTMonPIDPurityVsPtFctn::Rename(const Char_t * name, const Char_t * title)
123 //renames and retitle the function and histograms
130 TString numstrn = fName + " Result"; //name of the result histogram
131 TString numstrt = fTitle + " Result"; //title of the result histogram
132 fResult->SetName(numstrn);
133 fResult->SetTitle(numstrt);
137 TString numstrn = fName + " Good"; //name of the Good histogram
138 TString numstrt = fTitle + " Good"; //title of the Good histogram
139 fGood->SetName(numstrn);
140 fGood->SetTitle(numstrt);
145 TString numstrn = fName + " All"; //name of the All histogram
146 TString numstrt = fTitle + " All"; //title of the All histogram
147 fAll->SetName(numstrn);
148 fAll->SetTitle(numstrt);
152 /******************************************************************/
154 TH1* AliHBTMonPIDPurityVsPtFctn::GetResult()
156 //Returns the result of the fuction
157 //that is histogram with effciency and contamination
159 fResult->Divide(fGood,fAll);
162 /******************************************************************/
164 void AliHBTMonPIDPurityVsPtFctn::Process(AliHBTParticle * track,AliHBTParticle * part)
166 //process the particle/track
167 Double_t pt = part->Pt();
169 if (track->GetPdgCode() == part->GetPdgCode())
175 // Info("Process","Catched pid impurity ...");
179 /******************************************************************/
180 /******************************************************************/
181 /******************************************************************/
183 ClassImp(AliHBTMonPIDContaminationVsPtFctn)
185 AliHBTMonPIDContaminationVsPtFctn::AliHBTMonPIDContaminationVsPtFctn(Int_t nbins, Double_t maxXval, Double_t minXval):
186 AliHBTMonTwoParticleFctn1D(nbins,maxXval,minXval),
191 Rename("pidcontaminationvspt","PIDContaminationVsPt");
193 /******************************************************************/
195 AliHBTMonPIDContaminationVsPtFctn::~AliHBTMonPIDContaminationVsPtFctn()
201 /******************************************************************/
203 void AliHBTMonPIDContaminationVsPtFctn::Write()
205 //Writes the function results
206 AliHBTMonitorFunction::Write();
210 /******************************************************************/
212 void AliHBTMonPIDContaminationVsPtFctn::Init()
214 //Initializes fuction
215 if (AliHBTParticle::GetDebug()>0) Info("Init","%s",GetName());
219 Warning("Init","Function has NULL result histogram!");
225 TString numstr = fName + " Wrong"; //title and name of the
227 TAxis* xax = fResult->GetXaxis();
228 fWrong = new TH1D(numstr,numstr,xax->GetNbins(),xax->GetXmin(),xax->GetXmax());
233 TString numstr = fName + " All"; //title and name of the
235 TAxis* xax = fResult->GetXaxis();
236 fAll = new TH1D(numstr,numstr,xax->GetNbins(),xax->GetXmin(),xax->GetXmax());
239 fResult->SetDirectory(0x0);
242 fWrong->SetDirectory(0x0);
245 fAll->SetDirectory(0x0);
248 if (AliHBTParticle::GetDebug()>0) Info("Init","%s Done.",GetName());
251 /******************************************************************/
253 void AliHBTMonPIDContaminationVsPtFctn::Rename(const Char_t * name)
255 //Rename fuctions and all histograms belonging to it
261 TString numstr = fName + " Result"; //title and name of the result histogram
262 fResult->SetName(numstr);
263 fResult->SetTitle(numstr);
267 TString numstr = fName + " Wrong";
268 fWrong->SetName(numstr);
269 fWrong->SetTitle(numstr);
274 TString numstrn = fName + " All"; //name of the All histogram
275 TString numstrt = fTitle + " All"; //title of the All histogram
276 fAll->SetName(numstrn);
277 fAll->SetTitle(numstrt);
280 /******************************************************************/
282 void AliHBTMonPIDContaminationVsPtFctn::Rename(const Char_t * name, const Char_t * title)
284 //renames and retitle the function and histograms
291 TString numstrn = fName + " Result"; //name of the result histogram
292 TString numstrt = fTitle + " Result"; //title of the result histogram
293 fResult->SetName(numstrn);
294 fResult->SetTitle(numstrt);
298 TString numstrn = fName + " Wrong"; //name of the Wrong histogram
299 TString numstrt = fTitle + " Wrong"; //title of the Wrong histogram
300 fWrong->SetName(numstrn);
301 fWrong->SetTitle(numstrt);
306 TString numstr = fName + " All";
307 fAll->SetName(numstr);
308 fAll->SetTitle(numstr);
312 /******************************************************************/
314 TH1* AliHBTMonPIDContaminationVsPtFctn::GetResult()
316 //Returns the result of the fuction
317 //that is histogram with effciency and contamination
319 fResult->Divide(fWrong,fAll);
322 /******************************************************************/
324 void AliHBTMonPIDContaminationVsPtFctn::Process(AliHBTParticle * track, AliHBTParticle * part)
326 //process the particle/track
327 Double_t pt = part->Pt();
330 if (track->GetPdgCode() != part->GetPdgCode())
332 // Info("Process","Catched contamination");
333 // track->Print();part->Print();
338 /******************************************************************/
339 /******************************************************************/
340 /******************************************************************/
342 ClassImp(AliHBTPairPIDProbVsQInvFctn)
344 AliHBTPairPIDProbVsQInvFctn::AliHBTPairPIDProbVsQInvFctn(Int_t nbins, Double_t maxXval, Double_t minXval):
345 AliHBTOnePairFctn1D(nbins,maxXval,minXval)
347 fWriteNumAndDen = kTRUE;//change default behaviour
348 Rename("qinvpidpur","Q_{inv} Function");
350 /******************************************************************/
352 TH1* AliHBTPairPIDProbVsQInvFctn::GetResult()
354 //returns the scaled ratio
356 fRatio = GetRatio(Scale());
359 /******************************************************************/
361 void AliHBTPairPIDProbVsQInvFctn::ProcessSameEventParticles(AliHBTPair* pair)
363 //Fills the numerator using pair from the same event
364 pair = CheckPair(pair);
365 if(pair) fNumerator->Fill(pair->GetQInv(),pair->GetPIDProb());
367 /******************************************************************/
369 void AliHBTPairPIDProbVsQInvFctn::ProcessDiffEventParticles(AliHBTPair* pair)
371 //Fills the denumerator using mixed pairs
372 pair = CheckPair(pair);
373 if(pair) fDenominator->Fill(pair->GetQInv(),pair->GetPIDProb());
376 /******************************************************************/
377 /******************************************************************/
378 /******************************************************************/
380 ClassImp(AliHBTPairPIDProbVsQOutSQideQLongFctn)
382 AliHBTPairPIDProbVsQOutSQideQLongFctn::AliHBTPairPIDProbVsQOutSQideQLongFctn(Int_t nXbins, Double_t maxXval, Double_t minXval,
383 Int_t nYbins, Double_t maxYval, Double_t minYval,
384 Int_t nZbins, Double_t maxZval, Double_t minZval):
385 AliHBTOnePairFctn3D(nXbins,maxXval,minXval,nYbins,maxYval,minYval,nZbins,maxZval,minZval)
388 fWriteNumAndDen = kTRUE;//change default behaviour
389 Rename("qoslpidpur","Pair PID Probablilty .vs. Q_{out}-Q_{side}-Q_{long} Fctn");
391 /***************1**********************************************/
393 void AliHBTPairPIDProbVsQOutSQideQLongFctn::ProcessSameEventParticles(AliHBTPair* pair)
396 pair = CheckPair(pair);
397 if (pair == 0x0) return;
398 Double_t weight = pair->GetPIDProb();
399 Double_t out = TMath::Abs(pair->GetQOutCMSLC());
400 Double_t side = TMath::Abs(pair->GetQSideCMSLC());
401 Double_t lon = TMath::Abs(pair->GetQLongCMSLC());
402 fNumerator->Fill(out,side,lon,weight);
404 /*************************************************************/
406 void AliHBTPairPIDProbVsQOutSQideQLongFctn::ProcessDiffEventParticles(AliHBTPair* pair)
409 pair = CheckPair(pair);
410 if (pair == 0x0) return;
411 Double_t weight = pair->GetPIDProb();
412 Double_t out = TMath::Abs(pair->GetQOutCMSLC());
413 Double_t side = TMath::Abs(pair->GetQSideCMSLC());
414 Double_t lon = TMath::Abs(pair->GetQLongCMSLC());
415 fDenominator->Fill(out,side,lon,weight);
417 /*************************************************************/
419 TH1* AliHBTPairPIDProbVsQOutSQideQLongFctn::GetResult()
421 //returns the scaled ratio
424 fRatio = GetRatio(Scale());