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 /******************************************************************/
22 ClassImp(AliHBTMonPIDPurityVsPtFctn)
24 AliHBTMonPIDPurityVsPtFctn::AliHBTMonPIDPurityVsPtFctn(Int_t nbins, Double_t maxXval, Double_t minXval):
25 AliHBTMonTwoParticleFctn1D(nbins,maxXval,minXval),
29 Rename("pidpurityvspt","PIDPurityVsPt");
32 /******************************************************************/
34 AliHBTMonPIDPurityVsPtFctn::~AliHBTMonPIDPurityVsPtFctn()
39 /******************************************************************/
40 void AliHBTMonPIDPurityVsPtFctn::Write()
42 AliHBTMonitorFunction::Write();
45 /******************************************************************/
47 void AliHBTMonPIDPurityVsPtFctn::Init()
50 if (AliHBTParticle::GetDebug()>0) Info("Init","%s",GetName());
54 Warning("Init","Function has NULL result histogram!");
60 TString numstr = fName + " Good"; //title and name of the
62 TAxis* xax = fResult->GetXaxis();
63 fGood = new TH1D(numstr,numstr,xax->GetNbins(),xax->GetXmin(),xax->GetXmax());
67 fResult->SetDirectory(0x0);
69 fGood->SetDirectory(0x0);
71 if (AliHBTParticle::GetDebug()>0) Info("Init","%s Done.",GetName());
74 /******************************************************************/
76 void AliHBTMonPIDPurityVsPtFctn::Rename(const Char_t * name)
78 //Rename fuctions and all histograms belonging to it
84 TString numstr = fName + " Result"; //title and name of the result histogram
85 fResult->SetName(numstr);
86 fResult->SetTitle(numstr);
90 TString numstr = fName + " Good";
91 fGood->SetName(numstr);
92 fGood->SetTitle(numstr);
95 /******************************************************************/
97 void AliHBTMonPIDPurityVsPtFctn::Rename(const Char_t * name, const Char_t * title)
99 //renames and retitle the function and histograms
106 TString numstrn = fName + " Result"; //name of the result histogram
107 TString numstrt = fTitle + " Result"; //title of the result histogram
108 fResult->SetName(numstrn);
109 fResult->SetTitle(numstrt);
113 TString numstrn = fName + " Good"; //name of the Good histogram
114 TString numstrt = fTitle + " Good"; //title of the Good histogram
115 fGood->SetName(numstrn);
116 fGood->SetTitle(numstrt);
120 /******************************************************************/
122 TH1* AliHBTMonPIDPurityVsPtFctn::GetResult()
124 //Returns the result of the fuction
125 //that is histogram with effciency and contamination
127 TH1D* htmp = (TH1D*)fResult->Clone("PIDPurityHTMP");
129 fResult->Divide(fGood,htmp);
132 /******************************************************************/
134 void AliHBTMonPIDPurityVsPtFctn::Process(AliHBTParticle * track,AliHBTParticle * part)
136 //process the particle/track
137 Double_t pt = part->Pt();
139 if (track->GetPdgCode() == part->GetPdgCode())
145 // Info("Process","Catched pid impurity ...");
149 /******************************************************************/
150 /******************************************************************/
151 /******************************************************************/
153 ClassImp(AliHBTMonPIDContaminationVsPtFctn)
155 AliHBTMonPIDContaminationVsPtFctn::AliHBTMonPIDContaminationVsPtFctn(Int_t nbins, Double_t maxXval, Double_t minXval):
156 AliHBTMonTwoParticleFctn1D(nbins,maxXval,minXval),
160 Rename("pidcontaminationvspt","PIDContaminationVsPt");
162 /******************************************************************/
164 AliHBTMonPIDContaminationVsPtFctn::~AliHBTMonPIDContaminationVsPtFctn()
169 /******************************************************************/
171 void AliHBTMonPIDContaminationVsPtFctn::Write()
173 //Writes the function results
174 AliHBTMonitorFunction::Write();
177 /******************************************************************/
179 void AliHBTMonPIDContaminationVsPtFctn::Init()
181 //Initializes fuction
182 if (AliHBTParticle::GetDebug()>0) Info("Init","%s",GetName());
186 Warning("Init","Function has NULL result histogram!");
192 TString numstr = fName + " Wrong"; //title and name of the
194 TAxis* xax = fResult->GetXaxis();
195 fWrong = new TH1D(numstr,numstr,xax->GetNbins(),xax->GetXmin(),xax->GetXmax());
199 fResult->SetDirectory(0x0);
201 fWrong->SetDirectory(0x0);
203 if (AliHBTParticle::GetDebug()>0) Info("Init","%s Done.",GetName());
206 /******************************************************************/
208 void AliHBTMonPIDContaminationVsPtFctn::Rename(const Char_t * name)
210 //Rename fuctions and all histograms belonging to it
216 TString numstr = fName + " Result"; //title and name of the result histogram
217 fResult->SetName(numstr);
218 fResult->SetTitle(numstr);
222 TString numstr = fName + " Wrong";
223 fWrong->SetName(numstr);
224 fWrong->SetTitle(numstr);
227 /******************************************************************/
229 void AliHBTMonPIDContaminationVsPtFctn::Rename(const Char_t * name, const Char_t * title)
231 //renames and retitle the function and histograms
238 TString numstrn = fName + " Result"; //name of the result histogram
239 TString numstrt = fTitle + " Result"; //title of the result histogram
240 fResult->SetName(numstrn);
241 fResult->SetTitle(numstrt);
245 TString numstrn = fName + " Wrong"; //name of the Wrong histogram
246 TString numstrt = fTitle + " Wrong"; //title of the Wrong histogram
247 fWrong->SetName(numstrn);
248 fWrong->SetTitle(numstrt);
251 /******************************************************************/
253 TH1* AliHBTMonPIDContaminationVsPtFctn::GetResult()
255 //Returns the result of the fuction
256 //that is histogram with effciency and contamination
258 TH1D* htmp = (TH1D*)fResult->Clone("PIDContaminationHTMP");
260 fResult->Divide(fWrong,htmp);
263 /******************************************************************/
265 void AliHBTMonPIDContaminationVsPtFctn::Process(AliHBTParticle * track, AliHBTParticle * part)
267 //process the particle/track
268 Double_t pt = part->Pt();
271 if (track->GetPdgCode() != part->GetPdgCode())
273 // Info("Process","Catched contamination");
274 // track->Print();part->Print();
279 /******************************************************************/
280 ClassImp(AliHBTPairPIDProbVsQInvFctn)
282 AliHBTPairPIDProbVsQInvFctn::AliHBTPairPIDProbVsQInvFctn(Int_t nbins, Double_t maxXval, Double_t minXval):
283 AliHBTOnePairFctn1D(nbins,maxXval,minXval)
285 fWriteNumAndDen = kTRUE;//change default behaviour
286 Rename("qinvpidpur","Q_{inv} Function");
288 /******************************************************************/
290 TH1* AliHBTPairPIDProbVsQInvFctn::GetResult()
292 //returns the scaled ratio
294 fRatio = GetRatio(Scale());
297 /******************************************************************/
299 void AliHBTPairPIDProbVsQInvFctn::ProcessSameEventParticles(AliHBTPair* pair)
301 //Fills the numerator using pair from the same event
302 pair = CheckPair(pair);
303 if(pair) fNumerator->Fill(pair->GetQInv(),pair->GetPIDProb());
305 /******************************************************************/
307 void AliHBTPairPIDProbVsQInvFctn::ProcessDiffEventParticles(AliHBTPair* pair)
309 //Fills the denumerator using mixed pairs
310 pair = CheckPair(pair);
311 if(pair) fDenominator->Fill(pair->GetQInv(),pair->GetPIDProb());
315 ClassImp(AliHBTPairPIDProbVsQOutSQideQLongFctn)
317 AliHBTPairPIDProbVsQOutSQideQLongFctn::AliHBTPairPIDProbVsQOutSQideQLongFctn(Int_t nXbins, Double_t maxXval, Double_t minXval,
318 Int_t nYbins, Double_t maxYval, Double_t minYval,
319 Int_t nZbins, Double_t maxZval, Double_t minZval):
320 AliHBTOnePairFctn3D(nXbins,maxXval,minXval,nYbins,maxYval,minYval,nZbins,maxZval,minZval)
323 fWriteNumAndDen = kTRUE;//change default behaviour
324 Rename("qoslpidpur","Pair PID Probablilty .vs. Q_{out}-Q_{side}-Q_{long} Fctn");
326 /*************************************************************/
328 void AliHBTPairPIDProbVsQOutSQideQLongFctn::ProcessSameEventParticles(AliHBTPair* pair)
331 pair = CheckPair(pair);
332 if (pair == 0x0) return;
333 Double_t weight = pair->GetPIDProb();
334 Double_t out = TMath::Abs(pair->GetQOutCMSLC());
335 Double_t side = TMath::Abs(pair->GetQSideCMSLC());
336 Double_t lon = TMath::Abs(pair->GetQLongCMSLC());
337 fNumerator->Fill(out,side,lon,weight);
339 /*************************************************************/
341 void AliHBTPairPIDProbVsQOutSQideQLongFctn::ProcessDiffEventParticles(AliHBTPair* pair)
344 pair = CheckPair(pair);
345 if (pair == 0x0) return;
346 Double_t weight = pair->GetPIDProb();
347 Double_t out = TMath::Abs(pair->GetQOutCMSLC());
348 Double_t side = TMath::Abs(pair->GetQSideCMSLC());
349 Double_t lon = TMath::Abs(pair->GetQLongCMSLC());
350 fDenominator->Fill(out,side,lon,weight);
352 /*************************************************************/
354 TH1* AliHBTPairPIDProbVsQOutSQideQLongFctn::GetResult()
356 //returns the scaled ratio
358 fRatio = GetRatio(Scale());