* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
+
+/* $Id$ */
+
//
//
// First implementation of a class
#include "AliCFContainer.h"
#include "AliHFEpid.h"
#include "AliESDpid.h"
+#include "AliLog.h"
#include "AliITSPIDResponse.h"
#include "AliTPCPIDResponse.h"
//___________________________________________________________________________________________
AliHFEelecbackground::AliHFEelecbackground():
- fESD1(0x0)
+ fhtmp(0x0)
+ ,fhtmpf(0x0)
+ ,fhtmpp(0x0)
+ ,fESD1(0x0)
,fAOD1(0x0)
,fMCEvent(0x0)
,fBz(0)
//
// Default constructor
//
+ for(Int_t k =0; k < 10; k++) {
+ fCuts[k] = kFALSE;
+ }
}
//_______________________________________________________________________________________________
AliHFEelecbackground::AliHFEelecbackground(const AliHFEelecbackground &p):
TObject(p)
+ ,fhtmp(0x0)
+ ,fhtmpf(0x0)
+ ,fhtmpp(0x0)
,fESD1(0x0)
,fAOD1(0x0)
,fMCEvent(0x0)
//
// Copy constructor
//
+ for(Int_t k =0; k < 10; k++) {
+ fCuts[k] = kFALSE;
+ }
}
//_______________________________________________________________________________________________
if(fPIDMethodPartner) delete fPIDMethodPartner;
if(fPIDMethodPartnerITS) delete fPIDMethodPartnerITS;
- if(fList){
- fList->Clear();
- delete fList;
- }
-
if(fListPostProcess){
- fListPostProcess->Clear();
+ fListPostProcess->SetOwner(kTRUE);
delete fListPostProcess;
}
+
+/*
+ if(fhtmp) delete fhtmp;
+ if(fhtmpf) delete fhtmpf;
+ if(fhtmpp) delete fhtmpp;
+*/
+
}
//___________________________________________________________________________________________
Bool_t AliHFEelecbackground::Load(const Char_t * filename)
// bins
/////////
- Int_t nBinsPt = 25;
+ const Int_t nBinsPt = 25;
Double_t minPt = 0.01;
Double_t maxPt = 10.0;
- Int_t nBinsPtMore = 100;
+ const Int_t nBinsPtMore = 100;
Double_t minPtMore = 0.01;
Double_t maxPtMore = 10.0;
- Int_t nBinsInv = 50;
+ const Int_t nBinsInv = 50;
Double_t minInv = 0.0;
Double_t maxInv = 0.2;
- Int_t nBinsOp = 50;
+ const Int_t nBinsOp = 50;
Double_t minOp = 0.0;
Double_t maxOp = 2;
- Int_t nBinsCh = 4;
+ const Int_t nBinsCh = 4;
Double_t minCh = 0.0;
Double_t maxCh = 4.0;
- Double_t *binLimLogPt = new Double_t[nBinsPt+1];
- Double_t *binLimPt = new Double_t[nBinsPt+1];
+ Double_t binLimLogPt[nBinsPt+1];
+ Double_t binLimPt[nBinsPt+1];
for(Int_t i=0; i<=nBinsPt; i++) binLimLogPt[i]=(Double_t)TMath::Log10(minPt) + (TMath::Log10(maxPt)-TMath::Log10(minPt))/nBinsPt*(Double_t)i ;
for(Int_t i=0; i<=nBinsPt; i++) binLimPt[i]=(Double_t)TMath::Power(10,binLimLogPt[i]);
- Double_t *binLimLogPtMore = new Double_t[nBinsPtMore+1];
- Double_t *binLimPtMore = new Double_t[nBinsPtMore+1];
+ Double_t binLimLogPtMore[nBinsPtMore+1];
+ Double_t binLimPtMore[nBinsPtMore+1];
for(Int_t i=0; i<=nBinsPtMore; i++) binLimLogPtMore[i]=(Double_t)TMath::Log10(minPtMore) + (TMath::Log10(maxPtMore)-TMath::Log10(minPtMore))/nBinsPtMore*(Double_t)i ;
for(Int_t i=0; i<=nBinsPtMore; i++) binLimPtMore[i]=(Double_t)TMath::Power(10,binLimLogPtMore[i]);
- Double_t *binLimInv = new Double_t[nBinsInv+1];
+ Double_t binLimInv[nBinsInv+1];
for(Int_t i=0; i<=nBinsInv; i++) binLimInv[i]=(Double_t)minInv + (maxInv-minInv) /nBinsInv*(Double_t)i ;
- Double_t *binLimOp = new Double_t[nBinsOp+1];
+ Double_t binLimOp[nBinsOp+1];
for(Int_t i=0; i<=nBinsOp; i++) binLimOp[i]=(Double_t)minOp + (maxOp-minOp) /nBinsOp*(Double_t)i ;
- Double_t *binLimCh = new Double_t[nBinsCh+1];
+ Double_t binLimCh[nBinsCh+1];
for(Int_t i=0; i<=nBinsCh; i++) binLimCh[i]=(Double_t)minCh + (maxCh-minCh) /nBinsCh*(Double_t)i ;
const Int_t nvarData = 5;
//
THnSparseF *hsSparseData = new THnSparseF("OpeningangleinvmassData","",nvarData,iBinData);
- hsSparseData->SetBinEdges(0,binLimPt);
- hsSparseData->SetBinEdges(1,binLimPt);
- hsSparseData->SetBinEdges(2,binLimOp);
- hsSparseData->SetBinEdges(3,binLimInv);
- hsSparseData->SetBinEdges(4,binLimCh);
+ hsSparseData->SetBinEdges(0,&binLimPt[0]);
+ hsSparseData->SetBinEdges(1,&binLimPt[0]);
+ hsSparseData->SetBinEdges(2,&binLimOp[0]);
+ hsSparseData->SetBinEdges(3,&binLimInv[0]);
+ hsSparseData->SetBinEdges(4,&binLimCh[0]);
hsSparseData->Sumw2();
fList->AddAt(hsSparseData,kDatai);
// MCSplitted: 0-not, 1-splittedOs, 2-ksplittedSs
- Int_t nBinsMCOrigin = 6;
+ const Int_t nBinsMCOrigin = 6;
Double_t minMCOrigin = 0.0;
Double_t maxMCOrigin = 6.0;
- Double_t *binLimMCOrigin = new Double_t[nBinsMCOrigin+1];
+ Double_t binLimMCOrigin[nBinsMCOrigin+1];
for(Int_t i=0; i<=nBinsMCOrigin; i++) binLimMCOrigin[i]=(Double_t)minMCOrigin + (maxMCOrigin-minMCOrigin) /nBinsMCOrigin*(Double_t)i ;
- Int_t nBinsMCSplitted = 3;
+ const Int_t nBinsMCSplitted = 3;
Double_t minMCSplitted = 0.0;
Double_t maxMCSplitted = 3.0;
- Double_t *binLimMCSplitted = new Double_t[nBinsMCSplitted+1];
+ Double_t binLimMCSplitted[nBinsMCSplitted+1];
for(Int_t i=0; i<=nBinsMCSplitted; i++) binLimMCSplitted[i]=(Double_t)minMCSplitted + (maxMCSplitted-minMCSplitted) /nBinsMCSplitted*(Double_t)i ;
Int_t iBinMCo[nvarMCo];
iBinMCo[5]=nBinsMCSplitted;
THnSparseF *hsSparseMCo = new THnSparseF("OpeningangleinvmassMC","",nvarMCo,iBinMCo);
- hsSparseMCo->SetBinEdges(0,binLimPt);
- hsSparseMCo->SetBinEdges(1,binLimPt);
- hsSparseMCo->SetBinEdges(2,binLimOp);
- hsSparseMCo->SetBinEdges(3,binLimInv);
- hsSparseMCo->SetBinEdges(4,binLimMCOrigin);
- hsSparseMCo->SetBinEdges(5,binLimMCSplitted);
+ hsSparseMCo->SetBinEdges(0,&binLimPt[0]);
+ hsSparseMCo->SetBinEdges(1,&binLimPt[0]);
+ hsSparseMCo->SetBinEdges(2,&binLimOp[0]);
+ hsSparseMCo->SetBinEdges(3,&binLimInv[0]);
+ hsSparseMCo->SetBinEdges(4,&binLimMCOrigin[0]);
+ hsSparseMCo->SetBinEdges(5,&binLimMCSplitted[0]);
hsSparseMCo->Sumw2();
fList->AddAt(hsSparseMCo,kMCo);
// cut passed: 0-all, 1-Partner tracked, 2-Opposite-sign, 3-SingleTrackCutPart, 4-ShareCluster, 5-PID, 6-DCA, 7-chi2Ndf AliKF, 8-Openingangle, 9-Invmass
// MC: 0-FromBackground, 1-FromGamma, 2-FromPi0, 3-FromEta, 4-FromC, 5-FromB
- Int_t nBinsMCCutPassed = 10;
+ const Int_t nBinsMCCutPassed = 10;
Double_t minMCCutPassed = -0.5;
Double_t maxMCCutPassed = 9.5;
- Double_t *binLimMCCutPassed = new Double_t[nBinsMCCutPassed+1];
+ Double_t binLimMCCutPassed[nBinsMCCutPassed+1];
for(Int_t i=0; i<=nBinsMCCutPassed; i++) binLimMCCutPassed[i]=(Double_t)minMCCutPassed + (maxMCCutPassed-minMCCutPassed) /nBinsMCCutPassed*(Double_t)i ;
Int_t iBinMCe[nvarMCe];
iBinMCe[2]=nBinsMCOrigin;
THnSparseF *hsSparseMCe = new THnSparseF("CutPassedMC","",nvarMCe,iBinMCe);
- hsSparseMCe->SetBinEdges(0,binLimPt);
- hsSparseMCe->SetBinEdges(1,binLimMCCutPassed);
- hsSparseMCe->SetBinEdges(2,binLimMCOrigin);
+ hsSparseMCe->SetBinEdges(0,&binLimPt[0]);
+ hsSparseMCe->SetBinEdges(1,&binLimMCCutPassed[0]);
+ hsSparseMCe->SetBinEdges(2,&binLimMCOrigin[0]);
hsSparseMCe->Sumw2();
fList->AddAt(hsSparseMCe,kMCe);
/////////////////////////////////////////////////////
const Int_t nvarITSsignal = 5;
- Int_t nBinsITSsignal = 100;
+ const Int_t nBinsITSsignal = 100;
Double_t minITSsignal = 0.0;
Double_t maxITSsignal = 350.0;
- Double_t *binLimITSsignal = new Double_t[nBinsITSsignal+1];
+ Double_t binLimITSsignal[nBinsITSsignal+1];
for(Int_t i=0; i<=nBinsITSsignal; i++) binLimITSsignal[i]=(Double_t)minITSsignal + (maxITSsignal-minITSsignal) /nBinsITSsignal*(Double_t)i ;
Int_t iBinITSsignal[nvarITSsignal];
iBinITSsignal[4]=nBinsITSsignal;
THnSparseF *hsSparseITSpid = new THnSparseF("SparseITSsignal","",nvarITSsignal,iBinITSsignal);
- hsSparseITSpid->SetBinEdges(0,binLimPt);
- hsSparseITSpid->SetBinEdges(1,binLimITSsignal);
- hsSparseITSpid->SetBinEdges(2,binLimITSsignal);
- hsSparseITSpid->SetBinEdges(3,binLimITSsignal);
- hsSparseITSpid->SetBinEdges(4,binLimITSsignal);
+ hsSparseITSpid->SetBinEdges(0,&binLimPt[0]);
+ hsSparseITSpid->SetBinEdges(1,&binLimITSsignal[0]);
+ hsSparseITSpid->SetBinEdges(2,&binLimITSsignal[0]);
+ hsSparseITSpid->SetBinEdges(3,&binLimITSsignal[0]);
+ hsSparseITSpid->SetBinEdges(4,&binLimITSsignal[0]);
hsSparseITSpid->Sumw2();
fList->AddAt(hsSparseITSpid,kMCcutPart2);
///////////////////////////////////////////////////////////////////////////////////////
const Int_t nvarITSsignalSplit = 5;
- Int_t nBinsITSSplit = 2;
+ const Int_t nBinsITSSplit = 2;
Double_t minITSSplit = 0.0;
Double_t maxITSSplit = 2.0;
- Double_t *binLimITSSplit = new Double_t[nBinsITSSplit+1];
+ Double_t binLimITSSplit[nBinsITSSplit+1];
for(Int_t i=0; i<=nBinsITSSplit; i++) binLimITSSplit[i]=(Double_t)minITSSplit + (maxITSSplit-minITSSplit) /nBinsITSSplit*(Double_t)i ;
- Int_t nBinsITSsignalSplit = 50;
+ const Int_t nBinsITSsignalSplit = 50;
Double_t minITSsignalSplit = -25.0;
Double_t maxITSsignalSplit = 25.0;
- Double_t *binLimITSsignalSplit = new Double_t[nBinsITSsignalSplit+1];
+ Double_t binLimITSsignalSplit[nBinsITSsignalSplit+1];
for(Int_t i=0; i<=nBinsITSsignalSplit; i++) binLimITSsignalSplit[i]=(Double_t)minITSsignalSplit + (maxITSsignalSplit-minITSsignalSplit) /nBinsITSsignalSplit*(Double_t)i ;
Int_t iBinITSsignalSplit[nvarITSsignalSplit];
}
THnSparseF *hsSparseITSpidSplit = new THnSparseF("SparseITSsignalSplit","",nvarITSsignalSplit,iBinITSsignalSplit);
- hsSparseITSpidSplit->SetBinEdges(0,binLimITSSplit);
+ hsSparseITSpidSplit->SetBinEdges(0,&binLimITSSplit[0]);
for(Int_t k = 1; k < 5; k++) {
- hsSparseITSpidSplit->SetBinEdges(k,binLimITSsignalSplit);
+ hsSparseITSpidSplit->SetBinEdges(k,&binLimITSsignalSplit[0]);
}
hsSparseITSpidSplit->Sumw2();
// pt tagged
//////////////////////
TVector3 v3Dtagged;
- Double_t *pxyz = new Double_t[3];
- track->PxPyPz(pxyz);
+ Double_t pxyz[3];
+ track->PxPyPz(&pxyz[0]);
v3Dtagged.SetXYZ(pxyz[0],pxyz[1],pxyz[2]);
fPtESD = TMath::Sqrt(pxyz[0]*pxyz[0]+pxyz[1]*pxyz[1]);
cuteffect[0] = fPtESD;
cuteffect[1] = 0.0;
cuteffect[2] = fIsFrom;
- if(!fCuts[0]) {
- (dynamic_cast<THnSparseF *>(fList->At(kMCe)))->Fill(cuteffect);
+ if(!fCuts[0]){
+ if((fhtmp = dynamic_cast<THnSparseF *>(fList->At(kMCe)))) fhtmp->Fill(cuteffect);
+ //if(fList->At(kMCe)) (dynamic_cast<THnSparseF *>(fList->At(kMCe)))->Fill(cuteffect);
fCuts[0] = kTRUE;
}
}
if(HasMCData() && fIsPartner) {
cuteffect[1] = 1.0;
if(!fCuts[1]) {
- (dynamic_cast<THnSparseF *>(fList->At(kMCe)))->Fill(cuteffect);
+ if((fhtmp = dynamic_cast<THnSparseF *>(fList->At(kMCe)))) fhtmp->Fill(cuteffect);
+ //if(fList->At(kMCe)) (dynamic_cast<THnSparseF *>(fList->At(kMCe)))->Fill(cuteffect);
fCuts[1] = kTRUE;
}
}
if(HasMCData() && fIsPartner && (sign == kOs)) {
cuteffect[1] = 2.0;
if(!fCuts[2]) {
- (dynamic_cast<THnSparseF *>(fList->At(kMCe)))->Fill(cuteffect);
+ if((fhtmp = dynamic_cast<THnSparseF *>(fList->At(kMCe)))) fhtmp->Fill(cuteffect);
+ //if(fList->At(kMCe)) (dynamic_cast<THnSparseF *>(fList->At(kMCe)))->Fill(cuteffect);
fCuts[2] = kTRUE;
}
}
if(HasMCData() && fIsPartner && (sign==kOs)) {
cuteffect[1] = 3.0;
if(!fCuts[3]) {
- (dynamic_cast<THnSparseF *>(fList->At(kMCe)))->Fill(cuteffect);
+ if((fhtmp = dynamic_cast<THnSparseF *>(fList->At(kMCe)))) fhtmp->Fill(cuteffect);
+ //if(fList->At(kMCe)) (dynamic_cast<THnSparseF *>(fList->At(kMCe)))->Fill(cuteffect);
fCuts[3] = kTRUE;
}
}
if(HasMCData() && fIsPartner && (sign==kOs)) {
cuteffect[1] = 4.0;
if(!fCuts[4]) {
- (dynamic_cast<THnSparseF *>(fList->At(kMCe)))->Fill(cuteffect);
+ if((fhtmp = dynamic_cast<THnSparseF *>(fList->At(kMCe)))) fhtmp->Fill(cuteffect);
+ //if(fList->At(kMCe)) (dynamic_cast<THnSparseF *>(fList->At(kMCe)))->Fill(cuteffect);
fCuts[4] = kTRUE;
}
}
if(HasMCData() && fIsPartner && (sign==kOs)) {
cuteffect[1] = 5.0;
if(!fCuts[5]) {
- (dynamic_cast<THnSparseF *>(fList->At(kMCe)))->Fill(cuteffect);
+ if((fhtmp = dynamic_cast<THnSparseF *>(fList->At(kMCe)))) fhtmp->Fill(cuteffect);
+ //if(fList->At(kMCe)) (dynamic_cast<THnSparseF *>(fList->At(kMCe)))->Fill(cuteffect);
fCuts[5] = kTRUE;
}
}
Double_t xthis,xp;
Double_t dca = track->GetDCA(trackPart,fBz,xthis,xp);
- (dynamic_cast<TH1F *>(fList->At(kDatadca)))->Fill(dca);
+ if((fhtmpp = dynamic_cast<TH1F *>(fList->At(kDatadca)))) fhtmpp->Fill(dca);
if(HasMCData()) {
//printf("has MC data for DCA\n");
//printf("IsPartner %d and isfrom %d\n",fIsPartner,fIsFrom);
- if(fIsFrom==kElectronFromBackground) (dynamic_cast<TH2F *>(fList->At(kMCdca)))->Fill(dca,fIsFrom);
+ if(fIsFrom==kElectronFromBackground) {
+ if((fhtmpf = dynamic_cast<TH2F *>(fList->At(kMCdca)))) fhtmpf->Fill(dca,fIsFrom);
+ }
else {
- if(fIsPartner) (dynamic_cast<TH2F *>(fList->At(kMCdca)))->Fill(dca,fIsFrom);
+ if(fIsPartner){
+ if((fhtmpf = dynamic_cast<TH2F *>(fList->At(kMCdca)))) fhtmpf->Fill(dca,fIsFrom);
+ }
}
}
+
if(TMath::Abs(dca) > 3.0) return;
-
+
if(fDebugLevel > 0) {
if(HasMCData() && fIsPartner && (sign==kOs)) {
cuteffect[1] = 6.0;
if(!fCuts[6]) {
- (dynamic_cast<THnSparseF *>(fList->At(kMCe)))->Fill(cuteffect);
+ if((fhtmp = dynamic_cast<THnSparseF *>(fList->At(kMCe)))) fhtmp->Fill(cuteffect);
+ //if(fList->At(kMCe)) (dynamic_cast<THnSparseF *>(fList->At(kMCe)))->Fill(cuteffect);
fCuts[6] = kTRUE;
}
}
Double_t norradius = TMath::Sqrt(fkVertex->GetX()*fkVertex->GetX()+fkVertex->GetY()*fkVertex->GetY());
- AliESDtrack *trackCopy = new AliESDtrack(*track);
- AliESDtrack *trackPartCopy = new AliESDtrack(*trackPart);
+ AliESDtrack trackCopy = AliESDtrack(*track);
+ AliESDtrack trackPartCopy = AliESDtrack(*trackPart);
Bool_t propagateok = kTRUE;
- if((!(trackPartCopy->PropagateTo(norradius,fBz))) || (!(trackCopy->PropagateTo(norradius,fBz)))) propagateok = kFALSE;
+ if((!(trackPartCopy.PropagateTo(norradius,fBz))) || (!(trackCopy.PropagateTo(norradius,fBz)))) propagateok = kFALSE;
if(!propagateok) {
- if(trackCopy) delete trackCopy;
- if(trackPartCopy) delete trackPartCopy;
+ //if(trackCopy) delete trackCopy;
+ //if(trackPartCopy) delete trackPartCopy;
return;
}
- CalculateMotherVariable(trackCopy,trackPartCopy,&results[0]);
- CalculateMotherVariableR(trackCopy,trackPartCopy,&resultsr[0]);
+ CalculateMotherVariable(&trackCopy,&trackPartCopy,&results[0]);
+ CalculateMotherVariableR(&trackCopy,&trackPartCopy,&resultsr[0]);
- if(trackCopy) delete trackCopy;
- if(trackPartCopy) delete trackPartCopy;
+ //if(trackCopy) delete trackCopy;
+ //if(trackPartCopy) delete trackPartCopy;
}
else {
if(HasMCData() && fIsPartner && (sign==kOs)) {
cuteffect[1] = 7.0;
if(!fCuts[7]) {
- (dynamic_cast<THnSparseF *>(fList->At(kMCe)))->Fill(cuteffect);
+ if((fhtmp = dynamic_cast<THnSparseF *>(fList->At(kMCe)))) fhtmp->Fill(cuteffect);
+ //if(fList->At(kMCe)) (dynamic_cast<THnSparseF *>(fList->At(kMCe)))->Fill(cuteffect);
fCuts[7] = kTRUE;
}
}
cuteffect[1] = 8.0;
if(!fCuts[8]) {
- (dynamic_cast<THnSparseF *>(fList->At(kMCe)))->Fill(cuteffect);
+ if((fhtmp = dynamic_cast<THnSparseF *>(fList->At(kMCe)))) fhtmp->Fill(cuteffect);
+ //if(fList->At(kMCe)) (dynamic_cast<THnSparseF *>(fList->At(kMCe)))->Fill(cuteffect);
fCuts[8] = kTRUE;
}
if(TMath::Abs(results[1]) < fInvMassCut) {
cuteffect[1] = 9.0;
if(!fCuts[9]) {
- (dynamic_cast<THnSparseF *>(fList->At(kMCe)))->Fill(cuteffect);
+ if((fhtmp = dynamic_cast<THnSparseF *>(fList->At(kMCe)))) fhtmp->Fill(cuteffect);
+ //if(fList->At(kMCe)) (dynamic_cast<THnSparseF *>(fList->At(kMCe)))->Fill(cuteffect);
fCuts[9] = kTRUE;
}
}
TVector3 v3Dtagged;
TVector3 v3Dpart;
- Double_t *pxyz = new Double_t[3];
- track->PxPyPz(pxyz);
+ Double_t pxyz[3];
+ track->PxPyPz(&pxyz[0]);
v3Dtagged.SetXYZ(pxyz[0],pxyz[1],pxyz[2]);
- Double_t *pxyzpart = new Double_t[3];
- trackpart->PxPyPz(pxyzpart);
+ Double_t pxyzpart[3];
+ trackpart->PxPyPz(&pxyzpart[0]);
v3Dpart.SetXYZ(pxyzpart[0],pxyzpart[1],pxyzpart[2]);
results[4] = openingangle;
// chi2Ndf cut
- (dynamic_cast<TH1F *>(fList->At(kDatachi2Ndf)))->Fill(chi2ndf);
+ if((fhtmpp = dynamic_cast<TH1F *>(fList->At(kDatachi2Ndf)))) fhtmpp->Fill(chi2ndf);
+ //if(fList->At(kDatachi2Ndf)) (dynamic_cast<TH1F *>(fList->At(kDatachi2Ndf)))->Fill(chi2ndf);
if(HasMCData()){
- if(fIsFrom==kElectronFromBackground) (dynamic_cast<TH2F *>(fList->At(kMCchi2Ndf)))->Fill(chi2ndf,fIsFrom);
+ if(fIsFrom==kElectronFromBackground) {
+ if((fhtmpf = dynamic_cast<TH2F *>(fList->At(kMCchi2Ndf)))) fhtmpf->Fill(chi2ndf,fIsFrom);
+ }
else {
- if(fIsPartner) (dynamic_cast<TH2F *>(fList->At(kMCchi2Ndf)))->Fill(chi2ndf,fIsFrom);
+ if(fIsPartner){
+ if((fhtmpf = dynamic_cast<TH2F *>(fList->At(kMCchi2Ndf)))) fhtmpf->Fill(chi2ndf,fIsFrom);
+ }
}
}
if(chi2ndf > fChi2NdfCut) return kFALSE;
else {
- (dynamic_cast<TH1F *>(fList->At(kDatar)))->Fill(radius);
+ if((fhtmpp = dynamic_cast<TH1F *>(fList->At(kDatar)))) fhtmpp->Fill(radius);
+ //if(fList->At(kDatar)) (dynamic_cast<TH1F *>(fList->At(kDatar)))->Fill(radius);
if(HasMCData()) {
- if(fIsFrom==kElectronFromBackground) (dynamic_cast<TH2F *>(fList->At(kMCr)))->Fill(radius,fIsFrom);
+ if(fIsFrom==kElectronFromBackground) {
+ if((fhtmpf = dynamic_cast<TH2F *>(fList->At(kMCr)))) fhtmpf->Fill(radius,fIsFrom);
+ //if(fList->At(kMCr))) (dynamic_cast<TH2F *>(fList->At(kMCr)))->Fill(radius,fIsFrom);
+ }
else {
- if(fIsPartner) (dynamic_cast<TH2F *>(fList->At(kMCr)))->Fill(radius,fIsFrom);
+ if(fIsPartner) {
+ if((fhtmpf = dynamic_cast<TH2F *>(fList->At(kMCr)))) fhtmpf->Fill(radius,fIsFrom);
+ }
}
}
return kTRUE;
TVector3 v3Dtagged;
TVector3 v3Dpart;
- Double_t *pxyz = new Double_t[3];
- track->PxPyPz(pxyz);
+ Double_t pxyz[3];
+ track->PxPyPz(&pxyz[0]);
v3Dtagged.SetXYZ(pxyz[0],pxyz[1],pxyz[2]);
- Double_t *pxyzpart = new Double_t[3];
- trackpart->PxPyPz(pxyzpart);
+ Double_t pxyzpart[3];
+ trackpart->PxPyPz(&pxyzpart[0]);
v3Dpart.SetXYZ(pxyzpart[0],pxyzpart[1],pxyzpart[2]);
// rotate the partner
co[4] = sign;
co[5] = 0.0;
- (dynamic_cast<THnSparseF *>(fList->At(kDatai)))->Fill(co);
+ if((fhtmp = dynamic_cast<THnSparseF *>(fList->At(kDatai)))) fhtmp->Fill(co);
+ //if(fList->At(kDatai))(dynamic_cast<THnSparseF *>(fList->At(kDatai)))->Fill(co);
if((sign==kOs) && (!fUseAliKFCode)) {
co[4] = kR;
co[5] = 0.0;
- (dynamic_cast<THnSparseF *>(fList->At(kDatai)))->Fill(co);
+ if((fhtmp = dynamic_cast<THnSparseF *>(fList->At(kDatai)))) fhtmp->Fill(co);
+ //if(fList->At(kDatai)) (dynamic_cast<THnSparseF *>(fList->At(kDatai)))->Fill(co);
}
}
}
- (dynamic_cast<THnSparseF *>(fList->At(kMCo)))->Fill(co);
+ if((fhtmp = dynamic_cast<THnSparseF *>(fList->At(kMCo)))) fhtmp->Fill(co);
+ //if(fList->At(kMCo)) (dynamic_cast<THnSparseF *>(fList->At(kMCo)))->Fill(co);
}
////////////////////
if(fRequireITSStandalone==1) {
- if(((status & AliESDtrack::kITSin) == 0 || (trackPart->IsPureITSStandalone()) || (status&AliESDtrack::kITSrefit)==0)) return kFALSE;
+ if(((status & AliESDtrack::kITSin) == 0 || (trackPart->IsPureITSStandalone()) || ((status&AliESDtrack::kITSrefit)==0))) return kFALSE;
}
if(fRequireITSStandalone==2) {
Double_t itsSignal = trackPart->GetITSsignal();
Double_t p = trackPart->P();
- if(fDebugLevel > 1) {
- (dynamic_cast<TH2F *>(fList->At(kMCcutPart0)))->Fill(p,itsSignal);
+ if(fDebugLevel > 1) {
+ if((fhtmpf = dynamic_cast<TH2F *>(fList->At(kMCcutPart0)))) fhtmpf->Fill(p,itsSignal);
+ //if(fList->At(kMCcutPart0)) (dynamic_cast<TH2F *>(fList->At(kMCcutPart0)))->Fill(p,itsSignal);
}
///////////
entries[3] = dEdxSamplesPart[2];
entries[4] = dEdxSamplesPart[3];
- (dynamic_cast<TH2F *>(fList->At(kMCcutPart1)))->Fill(p,itsSignal);
- (dynamic_cast<THnSparseF *>(fList->At(kMCcutPart2)))->Fill(entries);
+ //if(fList->At(kMCcutPart1)) (dynamic_cast<TH2F *>(fList->At(kMCcutPart1)))->Fill(p,itsSignal);
+ if((fhtmpf = dynamic_cast<TH2F *>(fList->At(kMCcutPart1)))) fhtmpf->Fill(p,itsSignal);
+ if((fhtmp = dynamic_cast<THnSparseF *>(fList->At(kMCcutPart2)))) fhtmp->Fill(entries);
+ //if(fList->At(kMCcutPart2)) (dynamic_cast<THnSparseF *>(fList->At(kMCcutPart2)))->Fill(entries);
}
if(fDebugLevel > 1) {
//printf("tpcSignal %f\n",tpcSignal);
- (dynamic_cast<TH2F *>(fList->At(kMCcutPart0)))->Fill(p,tpcSignal);
+ //if(fList->At(kMCcutPart0)) (dynamic_cast<TH2F *>(fList->At(kMCcutPart0)))->Fill(p,tpcSignal);
+ if((fhtmpf = dynamic_cast<TH2F *>(fList->At(kMCcutPart0)))) fhtmpf->Fill(p,tpcSignal);
}
// PID
if(fPIDPartner) {
if(!fPIDMethodPartner) return kFALSE;
AliHFEpidObject hfetrack;
- hfetrack.fAnalysisType = AliHFEpidObject::kESDanalysis;
- hfetrack.fRecTrack = trackPart;
+ hfetrack.SetAnalysisType(AliHFEpidObject::kESDanalysis);
+ hfetrack.SetRecTrack(trackPart);
//if(HasMCData()) hfetrack.fMCtrack = mctrack;
if(!fPIDMethodPartner->IsSelected(&hfetrack)) return kFALSE;
if(fDebugLevel > 1) {
- (dynamic_cast<TH2F *>(fList->At(kMCcutPart1)))->Fill(p,tpcSignal);
+ if((fhtmpf = dynamic_cast<TH2F *>(fList->At(kMCcutPart1)))) fhtmpf->Fill(p,tpcSignal);
+ //if(fList->At(kMCcutPart1)) (dynamic_cast<TH2F *>(fList->At(kMCcutPart1)))->Fill(p,tpcSignal);
}
}
}
//__________________________________________________________________________________________
-Bool_t AliHFEelecbackground::ShareCluster(AliESDtrack * const track1,AliESDtrack * const track2) const
+Bool_t AliHFEelecbackground::ShareCluster(AliESDtrack * const track1,AliESDtrack * const track2)
{
//
// Look if the two tracks shared clusters in the TPC or in the ITS depending on the method
}
else entriesSplit[layer+1] = -100.0;
}
- (dynamic_cast<THnSparseF *>(fList->At(kMCcutPart3)))->Fill(entriesSplit);
+ if((fhtmp = dynamic_cast<THnSparseF *>(fList->At(kMCcutPart3)))) fhtmp->Fill(entriesSplit);
+ //if(fList->At(kMCcutPart3)) (dynamic_cast<THnSparseF *>(fList->At(kMCcutPart3)))->Fill(entriesSplit);
}
// Return
if(!fPIDMethodPartner) {
fPIDMethodPartner = new AliHFEpid();
- fPIDMethodPartner->InitializePID("Strategy1"); // 3 sigma cut in TPC
+ fPIDMethodPartner->AddDetector("TPC", 0);
+ fPIDMethodPartner->InitializePID(); // 3 sigma cut in TPC
}
}
/////////////////////////////////
// Cuts on the opening angle
////////////////////////////////
+ if(!hsSparseData) return;
TAxis *axisOpeningAngleData = hsSparseData->GetAxis(2);
Int_t binCutData = axisOpeningAngleData->FindBin(fOpeningAngleCut);
hsSparseData->GetAxis(2)->SetRange(1,binCutData);
Double_t yieldf = invmassdiffptproj[k-1]->Integral();
if(invmassetaptproj[k-1] && invmasspi0ptproj[k-1] && invmassgammaptproj[k-1] && invmassCptproj[k-1] && invmassBptproj[k-1]) {
Double_t yieldg = invmassetaptproj[k-1]->Integral() + invmasspi0ptproj[k-1]->Integral() + invmassgammaptproj[k-1]->Integral();
- yieldPtSourcesMC->SetBinContent(k,yieldg);
+ if(yieldPtSourcesMC) yieldPtSourcesMC->SetBinContent(k,yieldg);
Double_t yieldsignal = invmassCptproj[k-1]->Integral() + invmassBptproj[k-1]->Integral();
- yieldPtSignalCutMC->SetBinContent(k,yieldsignal);
+ if(yieldPtSignalCutMC) yieldPtSignalCutMC->SetBinContent(k,yieldsignal);
}
yieldPtFound->SetBinContent(k,yieldf);
/////////////////////////
THnSparseF *hsSparseData = dynamic_cast<THnSparseF *>(fList->FindObject("OpeningangleinvmassData"));
THnSparseF *hsSparseMC = dynamic_cast<THnSparseF *>(fList->FindObject("OpeningangleinvmassMC"));
+ if(!hsSparseData) return;
////////////////////
// Opening angle
cinvmass2D->cd(12);
if(invmassSplittedTrackosproj2D) invmassSplittedTrackosproj2D->Draw("lego");
-
- ////////////////////////
- // Cut efficiencies
- ////////////////////////
-
- THnSparseF *hsSparseMCe = dynamic_cast<THnSparseF *>(fList->FindObject("CutPassedMC"));
-
- if(hsSparseMCe) {
-
- // init histos
- TAxis *axissources = hsSparseMCe->GetAxis(2);
- Int_t nbsources = axissources->GetNbins();
- TAxis *axiscuts = hsSparseMCe->GetAxis(1);
- Int_t nbcuts = axiscuts->GetNbins();
- TH1D **histopassedcuts = new TH1D*[nbsources*nbcuts];
- Double_t *nbEntriesCuts = new Double_t[nbsources*nbcuts];
-
- //printf("Number of cuts %d\n",nbcuts);
-
- // canvas
- TCanvas * chsSparseMCeeff =new TCanvas("hsSparseMCeeffDebug","hsSparseMCeeffDebug",800,800);
- chsSparseMCeeff->Divide(3,1);
-
- // histos
- for(Int_t sourceid = 0; sourceid < nbsources; sourceid++) {
- hsSparseMCe->GetAxis(2)->SetRange(sourceid+1,sourceid+1);
- for(Int_t cut = 0; cut < nbcuts; cut++){
- hsSparseMCe->GetAxis(1)->SetRange(cut+1,cut+1);
- histopassedcuts[sourceid*nbcuts+cut] = hsSparseMCe->Projection(0);
- hsSparseMCe->GetAxis(1)->SetRange(1,hsSparseMCe->GetAxis(1)->GetNbins());
- }
- hsSparseMCe->GetAxis(2)->SetRange(1,hsSparseMCe->GetAxis(2)->GetNbins());
- }
-
- // calcul efficiencies
- ///////////////////////
- // histos
- for(Int_t sourceid = 0; sourceid < nbsources; sourceid++) {
- // Next is compared to the partner tracked
- for(Int_t cut = 2; cut < nbcuts; cut++){
- nbEntriesCuts[sourceid*nbcuts+cut] = histopassedcuts[sourceid*nbcuts+cut]->GetEntries();
- if(histopassedcuts[sourceid*nbcuts+1]->GetEntries() > 0.0) histopassedcuts[sourceid*nbcuts+cut]->Divide(histopassedcuts[sourceid*nbcuts+1]);
- }
- // First one is if the partner is tracked.
- nbEntriesCuts[sourceid*nbcuts+1] = histopassedcuts[sourceid*nbcuts+1]->GetEntries();
- if(histopassedcuts[sourceid*nbcuts]->GetEntries() > 0.0) histopassedcuts[sourceid*nbcuts+1]->Divide(histopassedcuts[sourceid*nbcuts]);
- // First one is input
- nbEntriesCuts[sourceid*nbcuts] = histopassedcuts[sourceid*nbcuts]->GetEntries();
- }
-
- /////////////
- // ratios
- ////////////
- for(Int_t sourceid = 0; sourceid < nbsources; sourceid++) {
- for(Int_t cut = 1; cut < nbcuts; cut++){
- if(nbEntriesCuts[sourceid*nbcuts] > 0.0) nbEntriesCuts[sourceid*nbcuts+cut] = nbEntriesCuts[sourceid*nbcuts+cut]/nbEntriesCuts[sourceid*nbcuts];
- }
- }
- TH1F *ratioHistoEntriesGamma = new TH1F("ratioHistoEntriesGamma","", nbcuts-1, 0.0, nbcuts-1.0);
- TH1F *ratioHistoEntriesPi0 = new TH1F("ratioHistoEntriesPi0","", nbcuts-1, 0.0, nbcuts-1.0);
- TH1F *ratioHistoEntriesC = new TH1F("ratioHistoEntriesC","", nbcuts-1, 0.0, nbcuts-1.0);
- for(Int_t k = 1; k < nbcuts; k++){
- ratioHistoEntriesGamma->SetBinContent(k,nbEntriesCuts[nbcuts+k]);
- ratioHistoEntriesPi0->SetBinContent(k,nbEntriesCuts[2*nbcuts+k]);
- ratioHistoEntriesC->SetBinContent(k,nbEntriesCuts[4*nbcuts+k]);
- }
- //
- TAxis *xAxisGamma = ratioHistoEntriesGamma->GetXaxis();
- xAxisGamma->SetBinLabel(1,"Partner tracked");
- xAxisGamma->SetBinLabel(2,"Opposite sign");
- xAxisGamma->SetBinLabel(3,"Single Track Cut");
- xAxisGamma->SetBinLabel(4,"Shared Clusters");
- xAxisGamma->SetBinLabel(5,"PID");
- xAxisGamma->SetBinLabel(6,"DCA");
- xAxisGamma->SetBinLabel(7,"Chi^{2}/Ndf");
- xAxisGamma->SetBinLabel(8,"Opening angle");
- xAxisGamma->SetBinLabel(9,"Invariant mass");
- //
- TAxis *xAxisPi0 = ratioHistoEntriesPi0->GetXaxis();
- xAxisPi0->SetBinLabel(1,"Partner tracked");
- xAxisPi0->SetBinLabel(2,"Opposite sign");
- xAxisPi0->SetBinLabel(3,"Single Track Cut");
- xAxisPi0->SetBinLabel(4,"Shared Clusters");
- xAxisPi0->SetBinLabel(5,"PID");
- xAxisPi0->SetBinLabel(6,"DCA");
- xAxisPi0->SetBinLabel(7,"Chi^{2}/Ndf");
- xAxisPi0->SetBinLabel(8,"Opening angle");
- xAxisPi0->SetBinLabel(9,"Invariant mass");
- //
- TAxis *xAxisC = ratioHistoEntriesC->GetXaxis();
- xAxisC->SetBinLabel(1,"Partner tracked");
- xAxisC->SetBinLabel(2,"Opposite sign");
- xAxisC->SetBinLabel(3,"Single Track Cut");
- xAxisC->SetBinLabel(4,"Shared Clusters");
- xAxisC->SetBinLabel(5,"PID");
- xAxisC->SetBinLabel(6,"DCA");
- xAxisC->SetBinLabel(7,"Chi^{2}/Ndf");
- xAxisC->SetBinLabel(8,"Opening angle");
- xAxisC->SetBinLabel(9,"Invariant mass");
- //
- TCanvas * cRatioHistoEntries =new TCanvas("cRatioHistoEntries","cRatioHistoEntries",800,800);
- cRatioHistoEntries->cd(1);
- ratioHistoEntriesGamma->SetStats(0);
- ratioHistoEntriesGamma->Draw();
- ratioHistoEntriesPi0->SetStats(0);
- ratioHistoEntriesPi0->Draw("same");
- ratioHistoEntriesC->SetStats(0);
- //ratioHistoEntriesC->Draw("same");
- TLegend *legEntries = new TLegend(0.4,0.6,0.89,0.89);
- legEntries->AddEntry(ratioHistoEntriesGamma,"#gamma","l");
- legEntries->AddEntry(ratioHistoEntriesPi0,"#pi^{0}","l");
- //legEntries->AddEntry(ratioHistoEntriesC,"c","p");
- legEntries->Draw("same");
-
- ////////////////////
- // plot Debug
- ///////////////////
- Int_t source = 1;
- chsSparseMCeeff->cd(1);
- histopassedcuts[source*nbcuts+0]->SetTitle("#gamma");
- histopassedcuts[source*nbcuts+1]->SetTitle("#gamma");
- histopassedcuts[source*nbcuts+2]->SetTitle("#gamma");
- histopassedcuts[source*nbcuts+3]->SetTitle("#gamma");
- histopassedcuts[source*nbcuts+4]->SetTitle("#gamma");
- histopassedcuts[source*nbcuts+5]->SetTitle("#gamma");
- histopassedcuts[source*nbcuts+6]->SetTitle("#gamma");
- histopassedcuts[source*nbcuts+7]->SetTitle("#gamma");
- histopassedcuts[source*nbcuts+8]->SetTitle("#gamma");
- histopassedcuts[source*nbcuts+9]->SetTitle("#gamma");
- //histopassedcuts[source*nbcuts+0]->SetStats(0);
- histopassedcuts[source*nbcuts+1]->SetStats(0);
- histopassedcuts[source*nbcuts+2]->SetStats(0);
- histopassedcuts[source*nbcuts+3]->SetStats(0);
- histopassedcuts[source*nbcuts+4]->SetStats(0);
- histopassedcuts[source*nbcuts+5]->SetStats(0);
- histopassedcuts[source*nbcuts+6]->SetStats(0);
- histopassedcuts[source*nbcuts+7]->SetStats(0);
- histopassedcuts[source*nbcuts+8]->SetStats(0);
- histopassedcuts[source*nbcuts+9]->SetStats(0);
- //histopassedcuts[source*nbcuts+0]->Draw();
- //histopassedcuts[source*nbcuts+1]->Draw("");
- histopassedcuts[source*nbcuts+2]->Draw();
- histopassedcuts[source*nbcuts+3]->Draw("same");
- //histopassedcuts[source*nbcuts+4]->Draw("same");
- histopassedcuts[source*nbcuts+5]->Draw("same");
- histopassedcuts[source*nbcuts+6]->Draw("same");
- //histopassedcuts[source*nbcuts+7]->Draw("same");
- histopassedcuts[source*nbcuts+8]->Draw("same");
- histopassedcuts[source*nbcuts+9]->Draw("same");
- TLegend *legb = new TLegend(0.4,0.6,0.89,0.89);
- //legb->AddEntry(histopassedcuts[source*nbcuts+0],"all","p");
- //legb->AddEntry(histopassedcuts[source*nbcuts+1],"Partner tracked","p");
- legb->AddEntry(histopassedcuts[source*nbcuts+2],"Opposite sign","p");
- legb->AddEntry(histopassedcuts[source*nbcuts+3],"SingleTrackPart","p");
- //legb->AddEntry(histopassedcuts[source*nbcuts+4],"SharedCluster","p");
- legb->AddEntry(histopassedcuts[source*nbcuts+5],"PID","p");
- legb->AddEntry(histopassedcuts[source*nbcuts+6],"DCA","p");
- //legb->AddEntry(histopassedcuts[source*nbcuts+7],"Chi2Ndf","p");
- legb->AddEntry(histopassedcuts[source*nbcuts+8],"OpeningAngle","p");
- legb->AddEntry(histopassedcuts[source*nbcuts+9],"InvMass","p");
- legb->Draw("same");
-
- source = 2;
- chsSparseMCeeff->cd(2);
- histopassedcuts[source*nbcuts+0]->SetTitle("#pi^{0}");
- histopassedcuts[source*nbcuts+1]->SetTitle("#pi^{0}");
- histopassedcuts[source*nbcuts+2]->SetTitle("#pi^{0}");
- histopassedcuts[source*nbcuts+3]->SetTitle("#pi^{0}");
- histopassedcuts[source*nbcuts+4]->SetTitle("#pi^{0}");
- histopassedcuts[source*nbcuts+5]->SetTitle("#pi^{0}");
- histopassedcuts[source*nbcuts+6]->SetTitle("#pi^{0}");
- histopassedcuts[source*nbcuts+7]->SetTitle("#pi^{0}");
- histopassedcuts[source*nbcuts+8]->SetTitle("#pi^{0}");
- histopassedcuts[source*nbcuts+9]->SetTitle("#pi^{0}");
- //histopassedcuts[source*nbcuts+0]->SetStats(0);
- histopassedcuts[source*nbcuts+1]->SetStats(0);
- histopassedcuts[source*nbcuts+2]->SetStats(0);
- histopassedcuts[source*nbcuts+3]->SetStats(0);
- histopassedcuts[source*nbcuts+4]->SetStats(0);
- histopassedcuts[source*nbcuts+5]->SetStats(0);
- histopassedcuts[source*nbcuts+6]->SetStats(0);
- histopassedcuts[source*nbcuts+7]->SetStats(0);
- histopassedcuts[source*nbcuts+8]->SetStats(0);
- histopassedcuts[source*nbcuts+9]->SetStats(0);
- //histopassedcuts[source*nbcuts+0]->Draw();
- //histopassedcuts[source*nbcuts+1]->Draw();
- histopassedcuts[source*nbcuts+2]->Draw();
- histopassedcuts[source*nbcuts+3]->Draw("same");
- //histopassedcuts[source*nbcuts+4]->Draw("same");
- histopassedcuts[source*nbcuts+5]->Draw("same");
- histopassedcuts[source*nbcuts+6]->Draw("same");
- //histopassedcuts[source*nbcuts+7]->Draw("same");
- histopassedcuts[source*nbcuts+8]->Draw("same");
- histopassedcuts[source*nbcuts+9]->Draw("same");
- TLegend *legc = new TLegend(0.4,0.6,0.89,0.89);
- //legc->AddEntry(histopassedcuts[source*nbcuts+0],"all","p");
- //legc->AddEntry(histopassedcuts[source*nbcuts+1],"Partner tracked","p");
- legc->AddEntry(histopassedcuts[source*nbcuts+2],"Opposite sign","p");
- legc->AddEntry(histopassedcuts[source*nbcuts+3],"SingleTrackPart","p");
- //legc->AddEntry(histopassedcuts[source*nbcuts+4],"SharedCluster","p");
- legc->AddEntry(histopassedcuts[source*nbcuts+5],"PID","p");
- legc->AddEntry(histopassedcuts[source*nbcuts+6],"DCA","p");
- //legc->AddEntry(histopassedcuts[source*nbcuts+7],"Chi2Ndf","p");
- legc->AddEntry(histopassedcuts[source*nbcuts+8],"OpeningAngle","p");
- legc->AddEntry(histopassedcuts[source*nbcuts+9],"InvMass","p");
- legc->Draw("same");
-
- source = 4;
- chsSparseMCeeff->cd(3);
- histopassedcuts[source*nbcuts+0]->SetTitle("C");
- histopassedcuts[source*nbcuts+1]->SetTitle("C");
- histopassedcuts[source*nbcuts+2]->SetTitle("C");
- histopassedcuts[source*nbcuts+3]->SetTitle("C");
- histopassedcuts[source*nbcuts+4]->SetTitle("C");
- histopassedcuts[source*nbcuts+5]->SetTitle("C");
- histopassedcuts[source*nbcuts+6]->SetTitle("C");
- histopassedcuts[source*nbcuts+7]->SetTitle("C");
- histopassedcuts[source*nbcuts+8]->SetTitle("C");
- histopassedcuts[source*nbcuts+9]->SetTitle("C");
- //histopassedcuts[source*nbcuts+0]->SetStats(0);
- histopassedcuts[source*nbcuts+1]->SetStats(0);
- histopassedcuts[source*nbcuts+2]->SetStats(0);
- histopassedcuts[source*nbcuts+3]->SetStats(0);
- histopassedcuts[source*nbcuts+4]->SetStats(0);
- histopassedcuts[source*nbcuts+5]->SetStats(0);
- histopassedcuts[source*nbcuts+6]->SetStats(0);
- histopassedcuts[source*nbcuts+7]->SetStats(0);
- histopassedcuts[source*nbcuts+8]->SetStats(0);
- histopassedcuts[source*nbcuts+9]->SetStats(0);
- //histopassedcuts[source*nbcuts+0]->Draw();
- //histopassedcuts[source*nbcuts+1]->Draw();
- histopassedcuts[source*nbcuts+2]->Draw();
- histopassedcuts[source*nbcuts+3]->Draw("same");
- //histopassedcuts[source*nbcuts+4]->Draw("same");
- histopassedcuts[source*nbcuts+5]->Draw("same");
- histopassedcuts[source*nbcuts+6]->Draw("same");
- //histopassedcuts[source*nbcuts+7]->Draw("same");
- histopassedcuts[source*nbcuts+8]->Draw("same");
- histopassedcuts[source*nbcuts+9]->Draw("same");
- TLegend *lege = new TLegend(0.4,0.6,0.89,0.89);
- //lege->AddEntry(histopassedcuts[source*nbcuts+0],"all","p");
- //lege->AddEntry(histopassedcuts[source*nbcuts+1],"Partner tracked","p");
- lege->AddEntry(histopassedcuts[source*nbcuts+2],"Opposite sign","p");
- lege->AddEntry(histopassedcuts[source*nbcuts+3],"SingleTrackPart","p");
- //lege->AddEntry(histopassedcuts[source*nbcuts+4],"SharedCluster","p");
- lege->AddEntry(histopassedcuts[source*nbcuts+5],"PID","p");
- lege->AddEntry(histopassedcuts[source*nbcuts+6],"DCA","p");
- //lege->AddEntry(histopassedcuts[source*nbcuts+7],"Chi2Ndf","p");
- lege->AddEntry(histopassedcuts[source*nbcuts+8],"OpeningAngle","p");
- lege->AddEntry(histopassedcuts[source*nbcuts+9],"InvMass","p");
- lege->Draw("same");
-
- //////////////////////
- // Input
- //////////////////////
-
- TCanvas * chsSparseMCein =new TCanvas("hsSparseMCeinput","hsSparseMCeinput",800,800);
- chsSparseMCein->cd(1);
- Double_t nbGamma = 0.0;
- source = 1;
- nbGamma = histopassedcuts[source*nbcuts+0]->GetEntries();
- histopassedcuts[source*nbcuts+0]->SetStats(0);
- histopassedcuts[source*nbcuts+0]->Draw();
- TLegend *leginput = new TLegend(0.4,0.6,0.89,0.89);
- leginput->AddEntry(histopassedcuts[source*nbcuts+0],"#gamma","p");
- Double_t nbPi0 = 0.0;
- source = 2;
- nbPi0 = histopassedcuts[source*nbcuts+0]->GetEntries();
- histopassedcuts[source*nbcuts+0]->SetStats(0);
- histopassedcuts[source*nbcuts+0]->Draw("same");
- leginput->AddEntry(histopassedcuts[source*nbcuts+0],"#pi^{0}","p");
- Double_t nbEta = 0.0;
- source = 3;
- nbEta = histopassedcuts[source*nbcuts+0]->GetEntries();
- histopassedcuts[source*nbcuts+0]->SetStats(0);
- histopassedcuts[source*nbcuts+0]->Draw("same");
- leginput->AddEntry(histopassedcuts[source*nbcuts+0],"#eta","p");
- Double_t nbC = 0.0;
- source = 4;
- nbC = histopassedcuts[source*nbcuts+0]->GetEntries();
- histopassedcuts[source*nbcuts+0]->SetStats(0);
- histopassedcuts[source*nbcuts+0]->Draw("same");
- leginput->AddEntry(histopassedcuts[source*nbcuts+0],"c","p");
- leginput->Draw("same");
-
- //printf("Gamma %f, pi^{0} %f and #eta %f, c %f\n",nbGamma,nbPi0,nbEta,nbC);
-
- //////////////////////
- // Tracked
- //////////////////////
-
- TCanvas * cTracked = new TCanvas("cTracked","cTracked",800,800);
- cTracked->cd(1);
- source = 1;
- histopassedcuts[source*nbcuts+1]->Draw();
- TLegend *legTracked = new TLegend(0.4,0.6,0.89,0.89);
- legTracked->AddEntry(histopassedcuts[source*nbcuts+1],"#gamma","p");
- source = 2;
- histopassedcuts[source*nbcuts+1]->Draw("same");
- legTracked->AddEntry(histopassedcuts[source*nbcuts+1],"#pi^{0}","p");
- legTracked->Draw("same");
-
- }
-
/////////////////////////////////////
// Data Radius and chi2Ndf if AliKF
////////////////////////////////////
legITS5->Draw("same");
- }
+ }
+ ////////////////////////
+ // Cut efficiencies
+ ////////////////////////
+
+ THnSparseF *hsSparseMCe = dynamic_cast<THnSparseF *>(fList->FindObject("CutPassedMC"));
+ if(!hsSparseMCe) return;
+
+ // init histos
+ TAxis *axissources = hsSparseMCe->GetAxis(2);
+ Int_t nbsources = axissources->GetNbins();
+ TAxis *axiscuts = hsSparseMCe->GetAxis(1);
+ Int_t nbcuts = axiscuts->GetNbins();
+ TH1D **histopassedcuts = new TH1D*[nbsources*nbcuts];
+ Double_t *nbEntriesCuts = new Double_t[nbsources*nbcuts];
+ for(Int_t k =0; k < nbsources*nbcuts; k++){
+ nbEntriesCuts[k] = 0.0;
+ histopassedcuts[k] = 0x0;
+ }
+
+ //printf("Number of cuts %d\n",nbcuts);
+
+ // canvas
+ TCanvas * chsSparseMCeeff =new TCanvas("hsSparseMCeeffDebug","hsSparseMCeeffDebug",800,800);
+ chsSparseMCeeff->Divide(3,1);
+
+ // histos
+ for(Int_t sourceid = 0; sourceid < nbsources; sourceid++) {
+ hsSparseMCe->GetAxis(2)->SetRange(sourceid+1,sourceid+1);
+ for(Int_t cut = 0; cut < nbcuts; cut++){
+ hsSparseMCe->GetAxis(1)->SetRange(cut+1,cut+1);
+ histopassedcuts[sourceid*nbcuts+cut] = hsSparseMCe->Projection(0);
+ hsSparseMCe->GetAxis(1)->SetRange(1,hsSparseMCe->GetAxis(1)->GetNbins());
+ }
+ hsSparseMCe->GetAxis(2)->SetRange(1,hsSparseMCe->GetAxis(2)->GetNbins());
+ }
+
+ // calcul efficiencies
+
+ // histos
+ for(Int_t sourceid = 0; sourceid < nbsources; sourceid++) {
+ // Next is compared to the partner tracked
+ for(Int_t cut = 2; cut < nbcuts; cut++){
+ nbEntriesCuts[sourceid*nbcuts+cut] = histopassedcuts[sourceid*nbcuts+cut]->GetEntries();
+ if(histopassedcuts[sourceid*nbcuts+1]->GetEntries() > 0.0) histopassedcuts[sourceid*nbcuts+cut]->Divide(histopassedcuts[sourceid*nbcuts+1]);
+ }
+ // First one is if the partner is tracked.
+ nbEntriesCuts[sourceid*nbcuts+1] = histopassedcuts[sourceid*nbcuts+1]->GetEntries();
+ if(histopassedcuts[sourceid*nbcuts]->GetEntries() > 0.0) histopassedcuts[sourceid*nbcuts+1]->Divide(histopassedcuts[sourceid*nbcuts]);
+ // First one is input
+ nbEntriesCuts[sourceid*nbcuts] = histopassedcuts[sourceid*nbcuts]->GetEntries();
+ }
+
+ // ratios
+ for(Int_t sourceid = 0; sourceid < nbsources; sourceid++) {
+ for(Int_t cut = 1; cut < nbcuts; cut++){
+ if(nbEntriesCuts[sourceid*nbcuts] > 0.0) nbEntriesCuts[sourceid*nbcuts+cut] = nbEntriesCuts[sourceid*nbcuts+cut]/nbEntriesCuts[sourceid*nbcuts];
+ }
+ }
+ TH1F *ratioHistoEntriesGamma = new TH1F("ratioHistoEntriesGamma","", nbcuts-1, 0.0, nbcuts-1.0);
+ TH1F *ratioHistoEntriesPi0 = new TH1F("ratioHistoEntriesPi0","", nbcuts-1, 0.0, nbcuts-1.0);
+ TH1F *ratioHistoEntriesC = new TH1F("ratioHistoEntriesC","", nbcuts-1, 0.0, nbcuts-1.0);
+ for(Int_t k = 1; k < nbcuts; k++){
+ if((nbcuts+k) < (nbsources*nbcuts)) ratioHistoEntriesGamma->SetBinContent(k,nbEntriesCuts[nbcuts+k]);
+ if((2*nbcuts+k) < (nbsources*nbcuts)) ratioHistoEntriesPi0->SetBinContent(k,nbEntriesCuts[2*nbcuts+k]);
+ if((4*nbcuts+k) < (nbsources*nbcuts)) ratioHistoEntriesC->SetBinContent(k,nbEntriesCuts[4*nbcuts+k]);
+ }
+ //
+ TAxis *xAxisGamma = ratioHistoEntriesGamma->GetXaxis();
+ xAxisGamma->SetBinLabel(1,"Partner tracked");
+ xAxisGamma->SetBinLabel(2,"Opposite sign");
+ xAxisGamma->SetBinLabel(3,"Single Track Cut");
+ xAxisGamma->SetBinLabel(4,"Shared Clusters");
+ xAxisGamma->SetBinLabel(5,"PID");
+ xAxisGamma->SetBinLabel(6,"DCA");
+ xAxisGamma->SetBinLabel(7,"Chi^{2}/Ndf");
+ xAxisGamma->SetBinLabel(8,"Opening angle");
+ xAxisGamma->SetBinLabel(9,"Invariant mass");
+ //
+ TAxis *xAxisPi0 = ratioHistoEntriesPi0->GetXaxis();
+ xAxisPi0->SetBinLabel(1,"Partner tracked");
+ xAxisPi0->SetBinLabel(2,"Opposite sign");
+ xAxisPi0->SetBinLabel(3,"Single Track Cut");
+ xAxisPi0->SetBinLabel(4,"Shared Clusters");
+ xAxisPi0->SetBinLabel(5,"PID");
+ xAxisPi0->SetBinLabel(6,"DCA");
+ xAxisPi0->SetBinLabel(7,"Chi^{2}/Ndf");
+ xAxisPi0->SetBinLabel(8,"Opening angle");
+ xAxisPi0->SetBinLabel(9,"Invariant mass");
+ //
+ TAxis *xAxisC = ratioHistoEntriesC->GetXaxis();
+ xAxisC->SetBinLabel(1,"Partner tracked");
+ xAxisC->SetBinLabel(2,"Opposite sign");
+ xAxisC->SetBinLabel(3,"Single Track Cut");
+ xAxisC->SetBinLabel(4,"Shared Clusters");
+ xAxisC->SetBinLabel(5,"PID");
+ xAxisC->SetBinLabel(6,"DCA");
+ xAxisC->SetBinLabel(7,"Chi^{2}/Ndf");
+ xAxisC->SetBinLabel(8,"Opening angle");
+ xAxisC->SetBinLabel(9,"Invariant mass");
+ //
+ TCanvas * cRatioHistoEntries =new TCanvas("cRatioHistoEntries","cRatioHistoEntries",800,800);
+ cRatioHistoEntries->cd(1);
+ ratioHistoEntriesGamma->SetStats(0);
+ ratioHistoEntriesGamma->Draw();
+ ratioHistoEntriesPi0->SetStats(0);
+ ratioHistoEntriesPi0->Draw("same");
+ ratioHistoEntriesC->SetStats(0);
+ //ratioHistoEntriesC->Draw("same");
+ TLegend *legEntries = new TLegend(0.4,0.6,0.89,0.89);
+ legEntries->AddEntry(ratioHistoEntriesGamma,"#gamma","l");
+ legEntries->AddEntry(ratioHistoEntriesPi0,"#pi^{0}","l");
+ //legEntries->AddEntry(ratioHistoEntriesC,"c","p");
+ legEntries->Draw("same");
+
+ // plot Debug
+ Int_t source = 1;
+ chsSparseMCeeff->cd(1);
+ if(((source*nbcuts+0)> (nbsources*nbcuts-1)) || ((source*nbcuts+1)> (nbsources*nbcuts-1)) || ((source*nbcuts+2)> (nbsources*nbcuts-1)) || ((source*nbcuts+3)> (nbsources*nbcuts-1)) || ((source*nbcuts+4)> (nbsources*nbcuts-1)) || ((source*nbcuts+5)> (nbsources*nbcuts-1)) || ((source*nbcuts+6)> (nbsources*nbcuts-1)) || ((source*nbcuts+7)> (nbsources*nbcuts-1)) || ((source*nbcuts+8)> (nbsources*nbcuts-1)) || ((source*nbcuts+9)> (nbsources*nbcuts-1))) {
+ delete [] histopassedcuts;
+ delete [] nbEntriesCuts;
+ return;
+ }
+ if((!histopassedcuts[source*nbcuts+0]) || (!histopassedcuts[source*nbcuts+1]) || (!histopassedcuts[source*nbcuts+2]) || (!histopassedcuts[source*nbcuts+3]) || (!histopassedcuts[source*nbcuts+4]) || (!histopassedcuts[source*nbcuts+5]) || (!histopassedcuts[source*nbcuts+6]) || (!histopassedcuts[source*nbcuts+7]) || (!histopassedcuts[source*nbcuts+8]) || (!histopassedcuts[source*nbcuts+9])) {
+ delete [] histopassedcuts;
+ delete [] nbEntriesCuts;
+ return;
+ }
+ histopassedcuts[source*nbcuts+0]->SetTitle("#gamma");
+ histopassedcuts[source*nbcuts+1]->SetTitle("#gamma");
+ histopassedcuts[source*nbcuts+2]->SetTitle("#gamma");
+ histopassedcuts[source*nbcuts+3]->SetTitle("#gamma");
+ histopassedcuts[source*nbcuts+4]->SetTitle("#gamma");
+ histopassedcuts[source*nbcuts+5]->SetTitle("#gamma");
+ histopassedcuts[source*nbcuts+6]->SetTitle("#gamma");
+ histopassedcuts[source*nbcuts+7]->SetTitle("#gamma");
+ histopassedcuts[source*nbcuts+8]->SetTitle("#gamma");
+ histopassedcuts[source*nbcuts+9]->SetTitle("#gamma");
+ //histopassedcuts[source*nbcuts+0]->SetStats(0);
+ histopassedcuts[source*nbcuts+1]->SetStats(0);
+ histopassedcuts[source*nbcuts+2]->SetStats(0);
+ histopassedcuts[source*nbcuts+3]->SetStats(0);
+ histopassedcuts[source*nbcuts+4]->SetStats(0);
+ histopassedcuts[source*nbcuts+5]->SetStats(0);
+ histopassedcuts[source*nbcuts+6]->SetStats(0);
+ histopassedcuts[source*nbcuts+7]->SetStats(0);
+ histopassedcuts[source*nbcuts+8]->SetStats(0);
+ histopassedcuts[source*nbcuts+9]->SetStats(0);
+ //histopassedcuts[source*nbcuts+0]->Draw();
+ //histopassedcuts[source*nbcuts+1]->Draw("");
+ histopassedcuts[source*nbcuts+2]->Draw();
+ histopassedcuts[source*nbcuts+3]->Draw("same");
+ //histopassedcuts[source*nbcuts+4]->Draw("same");
+ histopassedcuts[source*nbcuts+5]->Draw("same");
+ histopassedcuts[source*nbcuts+6]->Draw("same");
+ //histopassedcuts[source*nbcuts+7]->Draw("same");
+ histopassedcuts[source*nbcuts+8]->Draw("same");
+ histopassedcuts[source*nbcuts+9]->Draw("same");
+ TLegend *legb = new TLegend(0.4,0.6,0.89,0.89);
+ //legb->AddEntry(histopassedcuts[source*nbcuts+0],"all","p");
+ //legb->AddEntry(histopassedcuts[source*nbcuts+1],"Partner tracked","p");
+ legb->AddEntry(histopassedcuts[source*nbcuts+2],"Opposite sign","p");
+ legb->AddEntry(histopassedcuts[source*nbcuts+3],"SingleTrackPart","p");
+ //legb->AddEntry(histopassedcuts[source*nbcuts+4],"SharedCluster","p");
+ legb->AddEntry(histopassedcuts[source*nbcuts+5],"PID","p");
+ legb->AddEntry(histopassedcuts[source*nbcuts+6],"DCA","p");
+ //legb->AddEntry(histopassedcuts[source*nbcuts+7],"Chi2Ndf","p");
+ legb->AddEntry(histopassedcuts[source*nbcuts+8],"OpeningAngle","p");
+ legb->AddEntry(histopassedcuts[source*nbcuts+9],"InvMass","p");
+ legb->Draw("same");
+
+ source = 2;
+ if(((source*nbcuts+0)> (nbsources*nbcuts-1)) || ((source*nbcuts+1)> (nbsources*nbcuts-1)) || ((source*nbcuts+2)> (nbsources*nbcuts-1)) || ((source*nbcuts+3)> (nbsources*nbcuts-1)) || ((source*nbcuts+4)> (nbsources*nbcuts-1)) || ((source*nbcuts+5)> (nbsources*nbcuts-1)) || ((source*nbcuts+6)> (nbsources*nbcuts-1)) || ((source*nbcuts+7)> (nbsources*nbcuts-1)) || ((source*nbcuts+8)> (nbsources*nbcuts-1)) || ((source*nbcuts+9)> (nbsources*nbcuts-1))) {
+ delete [] histopassedcuts;
+ delete [] nbEntriesCuts;
+ return;
+ }
+ if((!histopassedcuts[source*nbcuts+0]) || (!histopassedcuts[source*nbcuts+1]) || (!histopassedcuts[source*nbcuts+2]) || (!histopassedcuts[source*nbcuts+3]) || (!histopassedcuts[source*nbcuts+4]) || (!histopassedcuts[source*nbcuts+5]) || (!histopassedcuts[source*nbcuts+6]) || (!histopassedcuts[source*nbcuts+7]) || (!histopassedcuts[source*nbcuts+8]) || (!histopassedcuts[source*nbcuts+9])) {
+ delete [] histopassedcuts;
+ delete [] nbEntriesCuts;
+ return;
+ }
+ chsSparseMCeeff->cd(2);
+ histopassedcuts[source*nbcuts+0]->SetTitle("#pi^{0}");
+ histopassedcuts[source*nbcuts+1]->SetTitle("#pi^{0}");
+ histopassedcuts[source*nbcuts+2]->SetTitle("#pi^{0}");
+ histopassedcuts[source*nbcuts+3]->SetTitle("#pi^{0}");
+ histopassedcuts[source*nbcuts+4]->SetTitle("#pi^{0}");
+ histopassedcuts[source*nbcuts+5]->SetTitle("#pi^{0}");
+ histopassedcuts[source*nbcuts+6]->SetTitle("#pi^{0}");
+ histopassedcuts[source*nbcuts+7]->SetTitle("#pi^{0}");
+ histopassedcuts[source*nbcuts+8]->SetTitle("#pi^{0}");
+ histopassedcuts[source*nbcuts+9]->SetTitle("#pi^{0}");
+ //histopassedcuts[source*nbcuts+0]->SetStats(0);
+ histopassedcuts[source*nbcuts+1]->SetStats(0);
+ histopassedcuts[source*nbcuts+2]->SetStats(0);
+ histopassedcuts[source*nbcuts+3]->SetStats(0);
+ histopassedcuts[source*nbcuts+4]->SetStats(0);
+ histopassedcuts[source*nbcuts+5]->SetStats(0);
+ histopassedcuts[source*nbcuts+6]->SetStats(0);
+ histopassedcuts[source*nbcuts+7]->SetStats(0);
+ histopassedcuts[source*nbcuts+8]->SetStats(0);
+ histopassedcuts[source*nbcuts+9]->SetStats(0);
+ //histopassedcuts[source*nbcuts+0]->Draw();
+ //histopassedcuts[source*nbcuts+1]->Draw();
+ histopassedcuts[source*nbcuts+2]->Draw();
+ histopassedcuts[source*nbcuts+3]->Draw("same");
+ //histopassedcuts[source*nbcuts+4]->Draw("same");
+ histopassedcuts[source*nbcuts+5]->Draw("same");
+ histopassedcuts[source*nbcuts+6]->Draw("same");
+ //histopassedcuts[source*nbcuts+7]->Draw("same");
+ histopassedcuts[source*nbcuts+8]->Draw("same");
+ histopassedcuts[source*nbcuts+9]->Draw("same");
+ TLegend *legc = new TLegend(0.4,0.6,0.89,0.89);
+ //legc->AddEntry(histopassedcuts[source*nbcuts+0],"all","p");
+ //legc->AddEntry(histopassedcuts[source*nbcuts+1],"Partner tracked","p");
+ legc->AddEntry(histopassedcuts[source*nbcuts+2],"Opposite sign","p");
+ legc->AddEntry(histopassedcuts[source*nbcuts+3],"SingleTrackPart","p");
+ //legc->AddEntry(histopassedcuts[source*nbcuts+4],"SharedCluster","p");
+ legc->AddEntry(histopassedcuts[source*nbcuts+5],"PID","p");
+ legc->AddEntry(histopassedcuts[source*nbcuts+6],"DCA","p");
+ //legc->AddEntry(histopassedcuts[source*nbcuts+7],"Chi2Ndf","p");
+ legc->AddEntry(histopassedcuts[source*nbcuts+8],"OpeningAngle","p");
+ legc->AddEntry(histopassedcuts[source*nbcuts+9],"InvMass","p");
+ legc->Draw("same");
+
+ source = 4;
+ if(((source*nbcuts+0)> (nbsources*nbcuts-1)) || ((source*nbcuts+1)> (nbsources*nbcuts-1)) || ((source*nbcuts+2)> (nbsources*nbcuts-1)) || ((source*nbcuts+3)> (nbsources*nbcuts-1)) || ((source*nbcuts+4)> (nbsources*nbcuts-1)) || ((source*nbcuts+5)> (nbsources*nbcuts-1)) || ((source*nbcuts+6)> (nbsources*nbcuts-1)) || ((source*nbcuts+7)> (nbsources*nbcuts-1)) || ((source*nbcuts+8)> (nbsources*nbcuts-1)) || ((source*nbcuts+9)> (nbsources*nbcuts-1))) {
+ delete [] histopassedcuts;
+ delete [] nbEntriesCuts;
+ return;
+ }
+ if((!histopassedcuts[source*nbcuts+0]) || (!histopassedcuts[source*nbcuts+1]) || (!histopassedcuts[source*nbcuts+2]) || (!histopassedcuts[source*nbcuts+3]) || (!histopassedcuts[source*nbcuts+4]) || (!histopassedcuts[source*nbcuts+5]) || (!histopassedcuts[source*nbcuts+6]) || (!histopassedcuts[source*nbcuts+7]) || (!histopassedcuts[source*nbcuts+8]) || (!histopassedcuts[source*nbcuts+9])) {
+ delete [] histopassedcuts;
+ delete [] nbEntriesCuts;
+ return;
+ }
+ chsSparseMCeeff->cd(3);
+ histopassedcuts[source*nbcuts+0]->SetTitle("C");
+ histopassedcuts[source*nbcuts+1]->SetTitle("C");
+ histopassedcuts[source*nbcuts+2]->SetTitle("C");
+ histopassedcuts[source*nbcuts+3]->SetTitle("C");
+ histopassedcuts[source*nbcuts+4]->SetTitle("C");
+ histopassedcuts[source*nbcuts+5]->SetTitle("C");
+ histopassedcuts[source*nbcuts+6]->SetTitle("C");
+ histopassedcuts[source*nbcuts+7]->SetTitle("C");
+ histopassedcuts[source*nbcuts+8]->SetTitle("C");
+ histopassedcuts[source*nbcuts+9]->SetTitle("C");
+ //histopassedcuts[source*nbcuts+0]->SetStats(0);
+ histopassedcuts[source*nbcuts+1]->SetStats(0);
+ histopassedcuts[source*nbcuts+2]->SetStats(0);
+ histopassedcuts[source*nbcuts+3]->SetStats(0);
+ histopassedcuts[source*nbcuts+4]->SetStats(0);
+ histopassedcuts[source*nbcuts+5]->SetStats(0);
+ histopassedcuts[source*nbcuts+6]->SetStats(0);
+ histopassedcuts[source*nbcuts+7]->SetStats(0);
+ histopassedcuts[source*nbcuts+8]->SetStats(0);
+ histopassedcuts[source*nbcuts+9]->SetStats(0);
+ //histopassedcuts[source*nbcuts+0]->Draw();
+ //histopassedcuts[source*nbcuts+1]->Draw();
+ histopassedcuts[source*nbcuts+2]->Draw();
+ histopassedcuts[source*nbcuts+3]->Draw("same");
+ //histopassedcuts[source*nbcuts+4]->Draw("same");
+ histopassedcuts[source*nbcuts+5]->Draw("same");
+ histopassedcuts[source*nbcuts+6]->Draw("same");
+ //histopassedcuts[source*nbcuts+7]->Draw("same");
+ histopassedcuts[source*nbcuts+8]->Draw("same");
+ histopassedcuts[source*nbcuts+9]->Draw("same");
+ TLegend *lege = new TLegend(0.4,0.6,0.89,0.89);
+ //lege->AddEntry(histopassedcuts[source*nbcuts+0],"all","p");
+ //lege->AddEntry(histopassedcuts[source*nbcuts+1],"Partner tracked","p");
+ lege->AddEntry(histopassedcuts[source*nbcuts+2],"Opposite sign","p");
+ lege->AddEntry(histopassedcuts[source*nbcuts+3],"SingleTrackPart","p");
+ //lege->AddEntry(histopassedcuts[source*nbcuts+4],"SharedCluster","p");
+ lege->AddEntry(histopassedcuts[source*nbcuts+5],"PID","p");
+ lege->AddEntry(histopassedcuts[source*nbcuts+6],"DCA","p");
+ //lege->AddEntry(histopassedcuts[source*nbcuts+7],"Chi2Ndf","p");
+ lege->AddEntry(histopassedcuts[source*nbcuts+8],"OpeningAngle","p");
+ lege->AddEntry(histopassedcuts[source*nbcuts+9],"InvMass","p");
+ lege->Draw("same");
+
+ //////////////////////
+ // Input
+ //////////////////////
+
+ TCanvas * chsSparseMCein =new TCanvas("hsSparseMCeinput","hsSparseMCeinput",800,800);
+ chsSparseMCein->cd(1);
+ Double_t nbGamma = 0.0;
+ source = 1;
+ if(((source*nbcuts+0)> (nbsources*nbcuts-1)) || (!histopassedcuts[source*nbcuts+0])) {
+ delete [] histopassedcuts;
+ delete [] nbEntriesCuts;
+ return;
+ }
+ nbGamma = histopassedcuts[source*nbcuts+0]->GetEntries();
+ histopassedcuts[source*nbcuts+0]->SetStats(0);
+ histopassedcuts[source*nbcuts+0]->Draw();
+ TLegend *leginput = new TLegend(0.4,0.6,0.89,0.89);
+ leginput->AddEntry(histopassedcuts[source*nbcuts+0],"#gamma","p");
+ Double_t nbPi0 = 0.0;
+ source = 2;
+ if(((source*nbcuts+0)> (nbsources*nbcuts-1)) || (!histopassedcuts[source*nbcuts+0])) {
+ delete [] histopassedcuts;
+ delete [] nbEntriesCuts;
+ return;
+ }
+ nbPi0 = histopassedcuts[source*nbcuts+0]->GetEntries();
+ histopassedcuts[source*nbcuts+0]->SetStats(0);
+ histopassedcuts[source*nbcuts+0]->Draw("same");
+ leginput->AddEntry(histopassedcuts[source*nbcuts+0],"#pi^{0}","p");
+ Double_t nbEta = 0.0;
+ source = 3;
+ if(((source*nbcuts+0)> (nbsources*nbcuts-1)) || (!histopassedcuts[source*nbcuts+0])) {
+ delete [] histopassedcuts;
+ delete [] nbEntriesCuts;
+ return;
+ }
+ nbEta = histopassedcuts[source*nbcuts+0]->GetEntries();
+ histopassedcuts[source*nbcuts+0]->SetStats(0);
+ histopassedcuts[source*nbcuts+0]->Draw("same");
+ leginput->AddEntry(histopassedcuts[source*nbcuts+0],"#eta","p");
+ Double_t nbC = 0.0;
+ source = 4;
+ if(((source*nbcuts+0)> (nbsources*nbcuts-1)) || (!histopassedcuts[source*nbcuts+0])) {
+ delete [] histopassedcuts;
+ delete [] nbEntriesCuts;
+ return;
+ }
+ nbC = histopassedcuts[source*nbcuts+0]->GetEntries();
+ histopassedcuts[source*nbcuts+0]->SetStats(0);
+ histopassedcuts[source*nbcuts+0]->Draw("same");
+ leginput->AddEntry(histopassedcuts[source*nbcuts+0],"c","p");
+ leginput->Draw("same");
+
+ //printf("Gamma %f, pi^{0} %f and #eta %f, c %f\n",nbGamma,nbPi0,nbEta,nbC);
+
+ //////////////////////
+ // Tracked
+ //////////////////////
+
+ TCanvas * cTracked = new TCanvas("cTracked","cTracked",800,800);
+ cTracked->cd(1);
+ source = 1;
+ if(((source*nbcuts+1)> (nbsources*nbcuts-1)) || (!histopassedcuts[source*nbcuts+1])) {
+ delete [] histopassedcuts;
+ delete [] nbEntriesCuts;
+ return;
+ }
+ histopassedcuts[source*nbcuts+1]->Draw();
+ TLegend *legTracked = new TLegend(0.4,0.6,0.89,0.89);
+ legTracked->AddEntry(histopassedcuts[source*nbcuts+1],"#gamma","p");
+ source = 2;
+ if(((source*nbcuts+1)> (nbsources*nbcuts-1)) || (!histopassedcuts[source*nbcuts+1])) {
+ delete [] histopassedcuts;
+ delete [] nbEntriesCuts;
+ return;
+ }
+ histopassedcuts[source*nbcuts+1]->Draw("same");
+ legTracked->AddEntry(histopassedcuts[source*nbcuts+1],"#pi^{0}","p");
+ legTracked->Draw("same");
+
+ delete [] histopassedcuts;
+ delete [] nbEntriesCuts;
+
}
//_____________________________________________________________________________
Double_t AliHFEelecbackground::BetheBlochElectronITS(const Double_t *x, const Double_t * /*par*/)