//Created by Christine Nattrass, Rebecca Scott, Irakli Martashvili //University of Tennessee at Knoxville // This is a container class for the correction factors for the hadronic // component of transverse energy // It is filled by the output of AliAnalysisTaskHadEt from spinning over Monte // Carlo data (using AliAnalysisHadEtMonteCarlo) //It is used by AliAnalysisTaskHadEt while spinning over reconstructed data // (using AliAnalysisHadEtReconstructed) //Please see https://twiki.cern.ch/twiki/bin/view/ALICE/ETCaloAnalysis #include "AliAnalysisHadEtCorrections.h" #include "TMath.h" #include #include "Rtypes.h" #include "TObjArray.h" #include "AliLog.h" #include "TH1D.h" using namespace std; ClassImp(AliAnalysisHadEtCorrections); AliAnalysisHadEtCorrections::AliAnalysisHadEtCorrections() : TNamed(), fEtaCut(0) ,fAcceptanceCorrectionFull(0) ,fAcceptanceCorrectionEMCAL(0) ,fAcceptanceCorrectionPHOS(0) ,fNeutralCorrection(0) ,fNotHadronicCorrection(0) ,fpTcutCorrectionTPC(0) ,fpTcutCorrectionITS(0) ,fNotIDConstTPC(0) ,fNotIDConstITS(0) ,fNotIDConstTPCNoID(0) ,fNotIDConstITSNoID(0) ,fNeutralCorrectionLow(0) ,fNotHadronicCorrectionLow(0) ,ffpTcutCorrectionTPCLow(0) ,ffpTcutCorrectionITSLow(0) ,fNeutralCorrectionHigh(0) ,fNotHadronicCorrectionHigh(0) ,ffpTcutCorrectionTPCHigh(0) ,ffpTcutCorrectionITSHigh(0) ,fNotIDConstTPCLow(0) ,fNotIDConstITSLow(0) ,fNotIDConstTPCNoIDLow(0) ,fNotIDConstITSNoIDLow(0) ,fNotIDConstTPCHigh(0) ,fNotIDConstITSHigh(0) ,fNotIDConstTPCNoIDHigh(0) ,fNotIDConstITSNoIDHigh(0) ,fnotIDTPC(0) ,fnotIDITS(0) ,fnotIDNoID(0) ,fEfficiencyPionTPC(0) ,fEfficiencyKaonTPC(0) ,fEfficiencyProtonTPC(0) ,fEfficiencyHadronTPC(0) ,fEfficiencyPionITS(0) ,fEfficiencyKaonITS(0) ,fEfficiencyProtonITS(0) ,fEfficiencyHadronITS(0) ,fEfficiencyTPC(0) ,fEfficiencyITS(0) ,fEfficiencyErrorLow(0) ,fEfficiencyErrorHigh(0) ,fBackgroundErrorLow(0) ,fBackgroundErrorHigh(0) ,fBackgroundTPC(0) ,fBackgroundITS(0) ,fIsEMCal(kTRUE) ,fIsData(kFALSE) ,fDataSet(2009) ,fProduction("ProductionName") ,fProductionDescription("Long production description") {//default constructor Init(); } void AliAnalysisHadEtCorrections::Init() { //This seems to solve a compiler error cout<<"Creating new AliAnalysisHadEtCorrections"<Clear(); fnotIDITS->Clear(); fnotIDNoID->Clear(); fEfficiencyPionTPC->Clear(); fEfficiencyKaonTPC->Clear(); fEfficiencyProtonTPC->Clear(); fEfficiencyHadronTPC->Clear(); fEfficiencyPionITS->Clear(); fEfficiencyKaonITS->Clear(); fEfficiencyProtonITS->Clear(); fEfficiencyHadronITS->Clear(); fBackgroundTPC->Clear(); fBackgroundITS->Clear(); delete fnotIDTPC; delete fnotIDITS; delete fnotIDNoID; delete fEfficiencyPionTPC; delete fEfficiencyKaonTPC; delete fEfficiencyProtonTPC; delete fEfficiencyHadronTPC; delete fEfficiencyPionITS; delete fEfficiencyKaonITS; delete fEfficiencyProtonITS; delete fEfficiencyHadronITS; delete fEfficiencyTPC; delete fEfficiencyITS; delete fBackgroundTPC; delete fBackgroundITS; } AliAnalysisHadEtCorrections::AliAnalysisHadEtCorrections(const AliAnalysisHadEtCorrections *g): TNamed(), fEtaCut(g->fEtaCut) ,fAcceptanceCorrectionFull(g->fAcceptanceCorrectionFull) ,fAcceptanceCorrectionEMCAL(g->fAcceptanceCorrectionEMCAL) ,fAcceptanceCorrectionPHOS(g->fAcceptanceCorrectionPHOS) ,fNeutralCorrection(g->fNeutralCorrection) ,fNotHadronicCorrection(g->fNotHadronicCorrection) ,fpTcutCorrectionTPC(g->fpTcutCorrectionTPC) ,fpTcutCorrectionITS(g->fpTcutCorrectionITS) ,fNotIDConstTPC(g->fNotIDConstTPC) ,fNotIDConstITS(g->fNotIDConstITS) ,fNotIDConstTPCNoID(g->fNotIDConstTPCNoID) ,fNotIDConstITSNoID(g->fNotIDConstITSNoID) ,fNeutralCorrectionLow(g->fNeutralCorrectionLow) ,fNotHadronicCorrectionLow(g->fNotHadronicCorrectionLow) ,ffpTcutCorrectionTPCLow(g->ffpTcutCorrectionTPCLow) ,ffpTcutCorrectionITSLow(g->ffpTcutCorrectionITSLow) ,fNeutralCorrectionHigh(g->fNeutralCorrectionHigh) ,fNotHadronicCorrectionHigh(g->fNotHadronicCorrectionHigh) ,ffpTcutCorrectionTPCHigh(g->ffpTcutCorrectionTPCHigh) ,ffpTcutCorrectionITSHigh(g->ffpTcutCorrectionITSHigh) ,fNotIDConstTPCLow(g->fNotIDConstTPCLow) ,fNotIDConstITSLow(g->fNotIDConstITSLow) ,fNotIDConstTPCNoIDLow(g->fNotIDConstTPCNoIDLow) ,fNotIDConstITSNoIDLow(g->fNotIDConstITSNoIDLow) ,fNotIDConstTPCHigh(g->fNotIDConstTPCHigh) ,fNotIDConstITSHigh(g->fNotIDConstITSHigh) ,fNotIDConstTPCNoIDHigh(g->fNotIDConstTPCNoIDHigh) ,fNotIDConstITSNoIDHigh(g->fNotIDConstITSNoIDHigh) ,fnotIDTPC(0) ,fnotIDITS(0) ,fnotIDNoID(0) ,fEfficiencyPionTPC(0) ,fEfficiencyKaonTPC(0) ,fEfficiencyProtonTPC(0) ,fEfficiencyHadronTPC(0) ,fEfficiencyPionITS(0) ,fEfficiencyKaonITS(0) ,fEfficiencyProtonITS(0) ,fEfficiencyHadronITS(0) ,fEfficiencyTPC(0) ,fEfficiencyITS(0) ,fEfficiencyErrorLow(g->fEfficiencyErrorLow) ,fEfficiencyErrorHigh(g->fEfficiencyErrorHigh) ,fBackgroundErrorLow(g->fBackgroundErrorLow) ,fBackgroundErrorHigh(g->fBackgroundErrorHigh) ,fBackgroundTPC(0) ,fBackgroundITS(0) ,fIsEMCal(g->fIsEMCal) ,fIsData(g->fIsData) ,fDataSet(g->fDataSet) ,fProduction(g->fProduction) ,fProductionDescription(g->fProductionDescription) {//copy constructor //SetName(g->GetName()); fnotIDTPC = new TH1D(*(g->fnotIDTPC)); fnotIDITS = new TH1D(*(g->fnotIDITS)); fnotIDNoID = new TH1D(*(g->fnotIDNoID)); fEfficiencyPionTPC = new TH1D(*(g->fEfficiencyPionTPC)); fEfficiencyKaonTPC = new TH1D(*(g->fEfficiencyKaonTPC)); fEfficiencyProtonTPC = new TH1D(*(g->fEfficiencyProtonTPC)); fEfficiencyHadronTPC = new TH1D(*(g->fEfficiencyHadronTPC)); fEfficiencyPionITS = new TH1D(*(g->fEfficiencyPionITS)); fEfficiencyKaonITS = new TH1D(*(g->fEfficiencyKaonITS)); fEfficiencyProtonITS = new TH1D(*(g->fEfficiencyProtonITS)); fEfficiencyHadronITS = new TH1D(*(g->fEfficiencyHadronITS)); fEfficiencyTPC = new TObjArray(*(g->fEfficiencyTPC)); fEfficiencyITS = new TObjArray(*(g->fEfficiencyITS)); fBackgroundTPC = new TH1D(*(g->fBackgroundTPC)); fBackgroundITS = new TH1D(*(g->fBackgroundITS)); } Float_t AliAnalysisHadEtCorrections::GetConstantCorrections(Bool_t totEt, Float_t ptcut, TString type) const {//Get the correction values that are not pt dependent Float_t acceptance = 0.0; Float_t neutral = 0.0; Float_t ptcorr = 0.0; float correction = 0.0; //TString *type = new TString(mytype); if(type.Contains("Full") || type.Contains("PiKP")) acceptance = fAcceptanceCorrectionFull; if(type.Contains("EMCAL")) acceptance = fAcceptanceCorrectionEMCAL; if(type.Contains("PHOS")) acceptance = fAcceptanceCorrectionPHOS; if(type.Contains("PiKP")){ if(ptcut>0.12){ptcorr = fpTcutCorrectionTPC;} else{ptcorr = fpTcutCorrectionITS;} if(type.Contains("High")){ if(ptcut>0.12){ptcorr = ffpTcutCorrectionTPCHigh;} else{ptcorr = ffpTcutCorrectionITSHigh;} } if(type.Contains("Low")){ if(ptcut>0.12){ptcorr = ffpTcutCorrectionTPCLow;} else{ptcorr = ffpTcutCorrectionITSLow;} } } if(type.Contains("High")){//high bound if(totEt) neutral = fNotHadronicCorrectionHigh; else{neutral = fNeutralCorrectionHigh;} if(ptcut>0.12){ptcorr = ffpTcutCorrectionTPCHigh;} else{ptcorr = ffpTcutCorrectionITSHigh;} cout<<"Setting correction factor to "<0.12){ptcorr = ffpTcutCorrectionTPCLow;} else{ptcorr = ffpTcutCorrectionITSLow;} cout<<"Setting correction factor to "<0.12){ptcorr = fpTcutCorrectionTPC;} else{ptcorr = fpTcutCorrectionITS;} correction = acceptance*neutral*ptcorr; cout<<"Setting correction factor for "; if(totEt) cout<<"total et"; else{cout<<"hadronic et";} cout<<" with the pt cut off "<fEtaCut; // fAcceptanceCorrectionFull=g->fAcceptanceCorrectionFull; // fAcceptanceCorrectionEMCAL=g->fAcceptanceCorrectionEMCAL; // fAcceptanceCorrectionPHOS=g->fAcceptanceCorrectionPHOS; // fNeutralCorrection=g->fNeutralCorrection; // fNotHadronicCorrection=g->fNotHadronicCorrection; // fpTcutCorrectionTPC=g->fpTcutCorrectionTPC; // fpTcutCorrectionITS=g->fpTcutCorrectionITS; // fNeutralCorrectionLow=g->fNeutralCorrectionLow; // fNotHadronicCorrectionLow=g->fNotHadronicCorrectionLow; // ffpTcutCorrectionTPCLow=g->ffpTcutCorrectionTPCLow; // ffpTcutCorrectionITSLow=g->ffpTcutCorrectionITSLow; // fNeutralCorrectionHigh=g->fNeutralCorrectionHigh; // fNotHadronicCorrectionHigh=g->fNotHadronicCorrectionHigh; // ffpTcutCorrectionTPCHigh=g->ffpTcutCorrectionTPCHigh; // ffpTcutCorrectionITSHigh=g->ffpTcutCorrectionITSHigh; // fnotIDTPC = g->fnotIDTPC; // fnotIDITS = g->fnotIDITS; // fnotIDNoID = g->fnotIDNoID; // fEfficiencyPionTPC = g->fEfficiencyPionTPC; // fEfficiencyKaonTPC = g->fEfficiencyKaonTPC; // fEfficiencyProtonTPC = g->fEfficiencyProtonTPC; // fEfficiencyHadronTPC = g->fEfficiencyHadronTPC; // fEfficiencyPionITS = g->fEfficiencyPionITS; // fEfficiencyKaonITS = g->fEfficiencyKaonITS; // fEfficiencyProtonITS = g->fEfficiencyProtonITS; // fEfficiencyHadronITS = g->fEfficiencyHadronITS; // fBackgroundTPC = g->fBackgroundTPC; // fBackgroundITS = g->fBackgroundITS; // } TH1D *AliAnalysisHadEtCorrections::GetEfficiencyPionTPC(const int cb){//Get centrality dependent efficiency if(cb==-1){return fEfficiencyPionTPC;} else{return (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyPionTPC%i",cb));} } TH1D *AliAnalysisHadEtCorrections::GetEfficiencyKaonTPC(const int cb){//Get centrality dependent efficiency if(cb==-1){return fEfficiencyKaonTPC;} else{return (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyKaonTPC%i",cb));} } TH1D *AliAnalysisHadEtCorrections::GetEfficiencyProtonTPC(const int cb){//Get centrality dependent efficiency if(cb==-1){return fEfficiencyProtonTPC;} else{return (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyProtonTPC%i",cb));} } TH1D *AliAnalysisHadEtCorrections::GetEfficiencyHadronTPC(const int cb){//Get centrality dependent efficiency if(cb==-1){return fEfficiencyHadronTPC;} else{return (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyHadronTPC%i",cb));} } TH1D *AliAnalysisHadEtCorrections::GetEfficiencyPionITS(const int cb){//Get centrality dependent efficiency if(cb==-1){return fEfficiencyPionITS;} else{return (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyPionITS%i",cb));} } TH1D *AliAnalysisHadEtCorrections::GetEfficiencyKaonITS(const int cb){//Get centrality dependent efficiency if(cb==-1){return fEfficiencyKaonITS;} else{return (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyKaonITS%i",cb));} } TH1D *AliAnalysisHadEtCorrections::GetEfficiencyProtonITS(const int cb){//Get centrality dependent efficiency if(cb==-1){return fEfficiencyProtonITS;} else{return (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyProtonITS%i",cb));} }//Proton TH1D *AliAnalysisHadEtCorrections::GetEfficiencyHadronITS(const int cb){//Get centrality dependent efficiency if(cb==-1){return fEfficiencyHadronITS;} else{return (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyHadronITS%i",cb));} } Float_t AliAnalysisHadEtCorrections::GetTPCEfficiencyCorrectionPion(const float pT, const int cb){//Get the efficiency for reconstructing a pion in the TPC float eff = -1.0; if(cb ==-1){//pp if(!fEfficiencyPionTPC){cerr<<"No histogram fEfficiencyPionTPC!"<GetBinContent(fEfficiencyPionTPC->FindBin(pT)); if(eff<=0.0){AliInfo("Efficiency is zero!"); return 0.0;} } else{ TH1D *fEfficiency = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyPionTPC%i",cb)); if(!fEfficiency){cerr<<"No histogram "<GetBinContent(fEfficiency->FindBin(pT)); if(eff<=0.0){AliInfo(Form("Pion efficiency is zero for centrality bin %i!",cb)); return 0.0;} } return 1.0/eff; } Float_t AliAnalysisHadEtCorrections::GetTPCEfficiencyCorrectionKaon(const float pT, const int cb){//Get the efficiency for reconstructing a kaon in the TPC float eff = -1.0; if(cb ==-1){//pp if(!fEfficiencyKaonTPC){cerr<<"No histogram fEfficiencyKaonTPC!"<GetBinContent(fEfficiencyKaonTPC->FindBin(pT)); if(eff<=0.0){AliInfo("Efficiency is zero!"); return 0.0;} } else{ TH1D *fEfficiency = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyKaonTPC%i",cb)); if(!fEfficiency){cerr<<"No histogram "<GetBinContent(fEfficiency->FindBin(pT)); if(eff<=0.0){AliInfo(Form("Pion efficiency is zero for centrality bin %i!",cb)); return 0.0;} } return 1.0/eff; } Float_t AliAnalysisHadEtCorrections::GetTPCEfficiencyCorrectionProton(const float pT, const int cb){//Get the efficiency for reconstructing a proton in the TPC float eff = -1.0; if(cb ==-1){//pp if(!fEfficiencyProtonTPC){cerr<<"No histogram fEfficiencyProtonTPC!"<GetBinContent(fEfficiencyProtonTPC->FindBin(pT)); if(eff<=0.0){AliInfo("Efficiency is zero!"); return 0.0;} } else{ TH1D *fEfficiency = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyProtonTPC%i",cb)); if(!fEfficiency){cerr<<"No histogram "<GetBinContent(fEfficiency->FindBin(pT)); if(eff<=0.0){AliInfo(Form("Pion efficiency is zero for centrality bin %i!",cb)); return 0.0;} } return 1.0/eff; } Float_t AliAnalysisHadEtCorrections::GetTPCEfficiencyCorrectionHadron(const float pT, const int cb){//Get the efficiency for reconstructing a hadron in the TPC float eff = -1.0; if(cb ==-1){//pp if(!fEfficiencyHadronTPC){cerr<<"No histogram fEfficiencyHadronTPC!"<GetBinContent(fEfficiencyHadronTPC->FindBin(pT)); if(eff<=0.0){AliInfo("Efficiency is zero!"); return 0.0;} } else{ TH1D *fEfficiency = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyHadronTPC%i",cb)); if(!fEfficiency){cerr<<"No histogram "<GetBinContent(fEfficiency->FindBin(pT)); if(eff<=0.0){AliInfo(Form("Pion efficiency is zero for centrality bin %i!",cb)); return 0.0;} } return 1.0/eff; } Float_t AliAnalysisHadEtCorrections::GetITSEfficiencyCorrectionPion(const float pT, const int cb){//Get the efficiency for reconstructing a pion in the ITS float eff = -1.0; if(cb ==-1){//pp if(!fEfficiencyPionITS){cerr<<"No histogram fEfficiencyPionITS!"<GetBinContent(fEfficiencyPionITS->FindBin(pT)); if(eff<=0.0){AliInfo("Efficiency is zero!"); return 0.0;} } else{ TH1D *fEfficiency = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyPionITS%i",cb)); if(!fEfficiency){cerr<<"No histogram "<GetBinContent(fEfficiency->FindBin(pT)); if(eff<=0.0){AliInfo(Form("Pion efficiency is zero for centrality bin %i!",cb)); return 0.0;} } return 1.0/eff; } Float_t AliAnalysisHadEtCorrections::GetITSEfficiencyCorrectionKaon(const float pT, const int cb){//Get the efficiency for reconstructing a kaon in the ITS float eff = -1.0; if(cb ==-1){//pp if(!fEfficiencyKaonITS){cerr<<"No histogram fEfficiencyKaonITS!"<GetBinContent(fEfficiencyKaonITS->FindBin(pT)); if(eff<=0.0){AliInfo("Efficiency is zero!"); return 0.0;} } else{ TH1D *fEfficiency = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyKaonITS%i",cb)); if(!fEfficiency){cerr<<"No histogram "<GetBinContent(fEfficiency->FindBin(pT)); if(eff<=0.0){AliInfo(Form("Pion efficiency is zero for centrality bin %i!",cb)); return 0.0;} } return 1.0/eff; } Float_t AliAnalysisHadEtCorrections::GetITSEfficiencyCorrectionProton(const float pT, const int cb){//Get the efficiency for reconstructing a proton in the ITS float eff = -1.0; if(cb ==-1){//pp if(!fEfficiencyProtonITS){cerr<<"No histogram fEfficiencyProtonITS!"<GetBinContent(fEfficiencyProtonITS->FindBin(pT)); if(eff<=0.0){AliInfo("Efficiency is zero!"); return 0.0;} } else{ TH1D *fEfficiency = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyProtonITS%i",cb)); if(!fEfficiency){cerr<<"No histogram "<GetBinContent(fEfficiency->FindBin(pT)); if(eff<=0.0){AliInfo(Form("Pion efficiency is zero for centrality bin %i!",cb)); return 0.0;} } return 1.0/eff; } Float_t AliAnalysisHadEtCorrections::GetITSEfficiencyCorrectionHadron(const float pT, const int cb){//Get the efficiency for reconstructing a hadron in the ITS float eff = -1.0; if(cb ==-1){//pp if(!fEfficiencyHadronITS){cerr<<"No histogram fEfficiencyHadronITS!"<GetBinContent(fEfficiencyHadronITS->FindBin(pT)); if(eff<=0.0){AliInfo("Efficiency is zero!"); return 0.0;} } else{ TH1D *fEfficiency = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyHadronITS%i",cb)); if(!fEfficiency){cerr<<"No histogram "<GetBinContent(fEfficiency->FindBin(pT)); if(eff<=0.0){AliInfo(Form("Pion efficiency is zero for centrality bin %i!",cb)); return 0.0;} } return 1.0/eff; } void AliAnalysisHadEtCorrections::SetEfficiencyPionTPC(TH1D *histo, const int cb){//Set centrality dependent efficiency for centrality bin cb if(histo){ //first check to see if the histogram exists already TH1D *old = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyPionTPC%i",cb)); if(old){ fEfficiencyTPC->Remove(old); delete old; } //then if the new histogram exists, add it to the array histo->SetName(Form("fEfficiencyPionTPC%i",cb)); fEfficiencyTPC->Add(histo); } else{cerr<<"Histogram does not exist!"<FindObject(Form("fEfficiencyKaonTPC%i",cb)); if(old){ fEfficiencyTPC->Remove(old); delete old; } //then if the new histogram exists, add it to the array histo->SetName(Form("fEfficiencyKaonTPC%i",cb)); fEfficiencyTPC->Add(histo); } else{cerr<<"Histogram does not exist!"<FindObject(Form("fEfficiencyProtonTPC%i",cb)); if(old){ fEfficiencyTPC->Remove(old); delete old; } //then if the new histogram exists, add it to the array histo->SetName(Form("fEfficiencyProtonTPC%i",cb)); fEfficiencyTPC->Add(histo); } else{cerr<<"Histogram does not exist!"<FindObject(Form("fEfficiencyHadronTPC%i",cb)); if(old){ fEfficiencyTPC->Remove(old); delete old; } //then if the new histogram exists, add it to the array histo->SetName(Form("fEfficiencyHadronTPC%i",cb)); fEfficiencyTPC->Add(histo); } else{cerr<<"Histogram does not exist!"<FindObject(Form("fEfficiencyPionITS%i",cb)); if(old){ fEfficiencyITS->Remove(old); delete old; } //then if the new histogram exists, add it to the array histo->SetName(Form("fEfficiencyPionITS%i",cb)); fEfficiencyITS->Add(histo); } else{cerr<<"Histogram does not exist!"<FindObject(Form("fEfficiencyKaonITS%i",cb)); if(old){ fEfficiencyITS->Remove(old); delete old; } //then if the new histogram exists, add it to the array histo->SetName(Form("fEfficiencyKaonITS%i",cb)); fEfficiencyITS->Add(histo); } else{cerr<<"Histogram does not exist!"<FindObject(Form("fEfficiencyProtonITS%i",cb)); if(old){ fEfficiencyITS->Remove(old); delete old; } //then if the new histogram exists, add it to the array histo->SetName(Form("fEfficiencyProtonITS%i",cb)); fEfficiencyITS->Add(histo); } else{cerr<<"Histogram does not exist!"<FindObject(Form("fEfficiencyHadronITS%i",cb)); if(old){ fEfficiencyITS->Remove(old); delete old; } //then if the new histogram exists, add it to the array histo->SetName(Form("fEfficiencyHadronITS%i",cb)); fEfficiencyITS->Add(histo); } else{cerr<<"Histogram does not exist!"<GetBinContent(fnotIDTPC->FindBin(pT)); if(val>0.0) return 1.0/(val); else{return 0.0;} } Float_t AliAnalysisHadEtCorrections::GetNotIDCorrectionITS(const float pT){//Get correction for unidentified particles in the ITS Float_t val = fnotIDITS->GetBinContent(fnotIDITS->FindBin(pT)); if(val>0.0) return 1.0/(val); else{return 0.0;} } Float_t AliAnalysisHadEtCorrections::GetNotIDCorrectionNoPID(const float pT){//Get correction for particles in the case that there is no particle identification Float_t val = fnotIDNoID->GetBinContent(fnotIDNoID->FindBin(pT)); if(val>0.0) return 1.0/(val); else{return 0.0;} } Float_t AliAnalysisHadEtCorrections::GetBackgroundCorrectionTPC(const float pT){//Get background correction for TPC tracks return (1.0-fBackgroundTPC->GetBinContent(fBackgroundTPC->FindBin(pT))); } Float_t AliAnalysisHadEtCorrections::GetBackgroundCorrectionITS(const float pT){//Get background correction for ITS tracks return (1.0-fBackgroundITS->GetBinContent(fBackgroundITS->FindBin(pT))); } void AliAnalysisHadEtCorrections::Report(){//Gives a report on the status of all corrections //This is primarily for cross checking that the results we get from the macro that fills this class, GetCorrections.C, are sane cout<<"======================================================================="<GetEntries()<<" entries"<GetEntries()<<" entries"<GetEntries()<<" entries"<GetEntries()<<" entries"<GetEntries()<<" entries"<GetEntries()<<" entries"<GetEntries()<<" entries"<GetEntries()<<" entries"<GetEntries()<<" entries"<GetEntries()<<" entries"<FindObject(Form("fEfficiencyHadronTPC%i",i)); if(histo) cout<FindObject(Form("fEfficiencyPionTPC%i",i)); if(histo) cout<FindObject(Form("fEfficiencyKaonTPC%i",i)); if(histo) cout<FindObject(Form("fEfficiencyProtonTPC%i",i)); if(histo) cout<FindObject(Form("fEfficiencyHadronITS%i",i)); if(histo) cout<FindObject(Form("fEfficiencyPionITS%i",i)); if(histo) cout<FindObject(Form("fEfficiencyKaonITS%i",i)); if(histo) cout<FindObject(Form("fEfficiencyProtonITS%i",i)); if(histo) cout<GetEntries(); int nbadhistograms = 0; for(int i=0;iAt(i); if(!histo){ cout<<"Warning: Histogram in fEfficiencyTPC at "<GetEntries()<=1e-2){ cout<<"Warning: Histogram "<GetName()<<" in fEfficiencyTPC is empty!"<GetEntries(); nbadhistograms = 0; for(int i=0;iAt(i); if(!histo){ cout<<"Warning: Histogram in fEfficiencyITS at "<GetEntries()<=1e-2){ cout<<"Warning: Histogram "<GetName()<<" in fEfficiencyITS is empty!"<