AliHBTMonPIDPurityVsPtFctn::AliHBTMonPIDPurityVsPtFctn(Int_t nbins, Double_t maxXval, Double_t minXval):
AliHBTMonTwoParticleFctn1D(nbins,maxXval,minXval),
- fGood(0x0)
+ fGood(0x0),
+ fAll(0x0)
{
//ctor
Rename("pidpurityvspt","PIDPurityVsPt");
{
//dtor
delete fGood;
+ delete fAll;
}
/******************************************************************/
void AliHBTMonPIDPurityVsPtFctn::Write()
{
AliHBTMonitorFunction::Write();
fGood->Write();
+ fAll->Write();
}
/******************************************************************/
fGood = new TH1D(numstr,numstr,xax->GetNbins(),xax->GetXmin(),xax->GetXmax());
}
+ if (fAll == 0x0)
+ {
+ TString numstr = fName + " All"; //title and name of the
+ //result histogram
+ TAxis* xax = fResult->GetXaxis();
+ fAll = new TH1D(numstr,numstr,xax->GetNbins(),xax->GetXmin(),xax->GetXmax());
+ }
+
fResult->Reset();
fResult->SetDirectory(0x0);
+ fResult->Sumw2();
fGood->Reset();
fGood->SetDirectory(0x0);
+ fGood->Sumw2();
+ fAll->Reset();
+ fAll->SetDirectory(0x0);
+ fAll->Sumw2();
if (AliHBTParticle::GetDebug()>0) Info("Init","%s Done.",GetName());
}
fGood->SetName(numstr);
fGood->SetTitle(numstr);
}
+
+ if (fAll)
+ {
+ TString numstr = fName + " All";
+ fAll->SetName(numstr);
+ fAll->SetTitle(numstr);
+ }
}
/******************************************************************/
fGood->SetTitle(numstrt);
}
+ if (fAll)
+ {
+ TString numstrn = fName + " All"; //name of the All histogram
+ TString numstrt = fTitle + " All"; //title of the All histogram
+ fAll->SetName(numstrn);
+ fAll->SetTitle(numstrt);
+ }
+
}
/******************************************************************/
//Returns the result of the fuction
//that is histogram with effciency and contamination
- TH1D* htmp = (TH1D*)fResult->Clone("PIDPurityHTMP");
- fResult->Reset();
- fResult->Divide(fGood,htmp);
+ fResult->Divide(fGood,fAll);
return fResult;
}
/******************************************************************/
{
//process the particle/track
Double_t pt = part->Pt();
- fResult->Fill(pt);
+ fAll->Fill(pt);
if (track->GetPdgCode() == part->GetPdgCode())
{
fGood->Fill(pt);
AliHBTMonPIDContaminationVsPtFctn::AliHBTMonPIDContaminationVsPtFctn(Int_t nbins, Double_t maxXval, Double_t minXval):
AliHBTMonTwoParticleFctn1D(nbins,maxXval,minXval),
- fWrong(0x0)
+ fWrong(0x0),
+ fAll(0x0)
{
//ctor
Rename("pidcontaminationvspt","PIDContaminationVsPt");
{
//dtor
delete fWrong;
+ delete fAll;
}
/******************************************************************/
//Writes the function results
AliHBTMonitorFunction::Write();
fWrong->Write();
+ fAll->Write();
}
/******************************************************************/
fWrong = new TH1D(numstr,numstr,xax->GetNbins(),xax->GetXmin(),xax->GetXmax());
}
+ if (fAll == 0x0)
+ {
+ TString numstr = fName + " All"; //title and name of the
+ //result histogram
+ TAxis* xax = fResult->GetXaxis();
+ fAll = new TH1D(numstr,numstr,xax->GetNbins(),xax->GetXmin(),xax->GetXmax());
+ }
fResult->Reset();
fResult->SetDirectory(0x0);
+ fResult->Sumw2();
fWrong->Reset();
fWrong->SetDirectory(0x0);
-
+ fWrong->Sumw2();
+ fAll->Reset();
+ fAll->SetDirectory(0x0);
+ fAll->Sumw2();
+
if (AliHBTParticle::GetDebug()>0) Info("Init","%s Done.",GetName());
}
fWrong->SetName(numstr);
fWrong->SetTitle(numstr);
}
+
+ if (fAll)
+ {
+ TString numstrn = fName + " All"; //name of the All histogram
+ TString numstrt = fTitle + " All"; //title of the All histogram
+ fAll->SetName(numstrn);
+ fAll->SetTitle(numstrt);
+ }
}
/******************************************************************/
fWrong->SetName(numstrn);
fWrong->SetTitle(numstrt);
}
+
+ if (fAll)
+ {
+ TString numstr = fName + " All";
+ fAll->SetName(numstr);
+ fAll->SetTitle(numstr);
+ }
+
}
/******************************************************************/
//Returns the result of the fuction
//that is histogram with effciency and contamination
- TH1D* htmp = (TH1D*)fResult->Clone("PIDContaminationHTMP");
- fResult->Reset();
- fResult->Divide(fWrong,htmp);
+ fResult->Divide(fWrong,fAll);
return fResult;
}
/******************************************************************/
{
//process the particle/track
Double_t pt = part->Pt();
- fResult->Fill(pt);
+ fAll->Fill(pt);
if (track->GetPdgCode() != part->GetPdgCode())
{