Adding setting for background and efficiency error, fixing number of centrality bins...
authorcnattras <cnattras@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 24 Mar 2011 02:23:49 +0000 (02:23 +0000)
committercnattras <cnattras@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 24 Mar 2011 02:23:49 +0000 (02:23 +0000)
PWG4/totEt/AliAnalysisHadEtCorrections.cxx
PWG4/totEt/AliAnalysisHadEtCorrections.h

index f365a21..5374beb 100644 (file)
@@ -62,6 +62,10 @@ AliAnalysisHadEtCorrections::AliAnalysisHadEtCorrections() : TNamed(),
                                                           ,fEfficiencyHadronITS(0)
                                                           ,fEfficiencyTPC(0)
                                                           ,fEfficiencyITS(0)
+                                                          ,fEfficiencyErrorLow(0)
+                                                          ,fEfficiencyErrorHigh(0)
+                                                          ,fBackgroundErrorLow(0)
+                                                          ,fBackgroundErrorHigh(0)
                                                           ,fBackgroundTPC(0)
                                                           ,fBackgroundITS(0)
                                                           ,fIsEMCal(kTRUE)
@@ -150,6 +154,10 @@ AliAnalysisHadEtCorrections::AliAnalysisHadEtCorrections(const AliAnalysisHadEtC
                                                                                              ,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)
@@ -216,10 +224,39 @@ Float_t AliAnalysisHadEtCorrections::GetConstantCorrections(Bool_t totEt, Float_
   if(totEt) cout<<"total et";
   else{cout<<"hadronic et";}
   cout<<" with the pt cut off "<<ptcut<<" for "<<type<<" acceptance to "<<correction<<endl;
-  //cout<<"Acceptance "<<acceptance<<" neutral "<<neutral<<" ptcorr "<<ptcorr<<endl;
+  //cout<<" Acceptance "<<acceptance<<" neutral "<<neutral<<" ptcorr "<<ptcorr<<endl;
   return correction;
 
 }
+Float_t AliAnalysisHadEtCorrections::GetSystematicErrorBound(Float_t et,Bool_t isLowBound, Bool_t isHadronic, Bool_t isTPC){
+  //we calculate factors for each value and then multiply them to get the overall bounds
+  //neutral corrections, pt cut, pid, efficiency, background
+  float neutral = 1.0;
+  float ptcut = 1.0;
+  float pid = 1.0;
+  float efficiency = 1.0;
+  float background = 1.0;
+  if(isLowBound){//is lower bound
+    if(isHadronic) neutral= fNeutralCorrectionLow/fNeutralCorrection;
+    else{neutral = fNotHadronicCorrectionLow/fNotHadronicCorrection;}
+    if(isTPC) ptcut = ffpTcutCorrectionTPCLow/fpTcutCorrectionTPC;
+    else{ptcut = ffpTcutCorrectionITSLow/fpTcutCorrectionITS;}
+    pid = fNotIDConstTPCLow/fNotIDConstTPC;
+    efficiency = fEfficiencyErrorLow;
+    background = fBackgroundErrorLow;
+  }
+  else{//is higher bound
+    if(isHadronic) neutral= fNeutralCorrectionHigh/fNeutralCorrection;
+    else{neutral= fNotHadronicCorrectionHigh/fNotHadronicCorrection;}
+    if(isTPC) ptcut = ffpTcutCorrectionTPCHigh/fpTcutCorrectionTPC;
+    else{ptcut = ffpTcutCorrectionITSHigh/fpTcutCorrectionITS;}
+    pid = fNotIDConstTPCHigh/fNotIDConstTPC;
+    efficiency = fEfficiencyErrorHigh;
+    background = fBackgroundErrorHigh;
+  }
+  //cout<<"neutral "<<neutral<<" ptcut "<<ptcut<<" pid "<<pid<<" efficiency "<<efficiency<<" background "<<background<<" overall "<<neutral*ptcut*pid*efficiency*background<<endl;
+  return neutral*ptcut*pid*efficiency*background*et;
+}
 // AliAnalysisHadEtCorrections & operator = (const AliAnalysisHadEtCorrections & g) {
 
 //   fEtaCut=g->fEtaCut;
@@ -253,6 +290,38 @@ Float_t AliAnalysisHadEtCorrections::GetConstantCorrections(Bool_t totEt, Float_
 //   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
@@ -579,49 +648,49 @@ void AliAnalysisHadEtCorrections::Report(){//Gives a report on the status of all
 
   if(fDataSet==20100){//if Pb+Pb
     cout<<"Efficiency histogram for TPC tracks for hadrons is set for centrality bins ";
-    for(int i = 0;i<=20;i++){
+    for(int i = 0;i<=21;i++){
       TH1D *histo = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyHadronTPC%i",i));
       if(histo) cout<<i<<" ";
     }
     cout<<endl;
     cout<<"                                        pions                              ";
-    for(int i = 0;i<=20;i++){
+    for(int i = 0;i<=21;i++){
       TH1D *histo = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyPionTPC%i",i));
       if(histo) cout<<i<<" ";
     }
     cout<<endl;
     cout<<"                                        kaons                              ";
-    for(int i = 0;i<=20;i++){
+    for(int i = 0;i<=21;i++){
       TH1D *histo = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyKaonTPC%i",i));
       if(histo) cout<<i<<" ";
     }
     cout<<endl;
     cout<<"                                        protons                            ";
-    for(int i = 0;i<=20;i++){
+    for(int i = 0;i<=21;i++){
       TH1D *histo = (TH1D*) fEfficiencyTPC->FindObject(Form("fEfficiencyProtonTPC%i",i));
       if(histo) cout<<i<<" ";
     }
     cout<<endl;
     cout<<"                         ITS            hadrons                            ";
-    for(int i = 0;i<=20;i++){
+    for(int i = 0;i<=21;i++){
       TH1D *histo = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyHadronITS%i",i));
       if(histo) cout<<i<<" ";
     }
     cout<<endl;
     cout<<"                                        pions                              ";
-    for(int i = 0;i<=20;i++){
+    for(int i = 0;i<=21;i++){
       TH1D *histo = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyPionITS%i",i));
       if(histo) cout<<i<<" ";
     }
     cout<<endl;
     cout<<"                                        kaons                              ";
-    for(int i = 0;i<=20;i++){
+    for(int i = 0;i<=21;i++){
       TH1D *histo = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyKaonITS%i",i));
       if(histo) cout<<i<<" ";
     }
     cout<<endl;
     cout<<"                                        protons                            ";
-    for(int i = 0;i<=20;i++){
+    for(int i = 0;i<=21;i++){
       TH1D *histo = (TH1D*) fEfficiencyITS->FindObject(Form("fEfficiencyProtonITS%i",i));
       if(histo) cout<<i<<" ";
     }
index be3d92c..aaffc17 100644 (file)
@@ -50,14 +50,14 @@ public:
     TH1D *GetNotIDCorrectionTPC() const {return fnotIDTPC;}
     TH1D *GetNotIDCorrectionITS() const {return fnotIDITS;}
     TH1D *GetNotIDCorrectionNoPID() const {return fnotIDNoID;}
-    TH1D *GetEfficiencyPionTPC() const {return fEfficiencyPionTPC;}
-    TH1D *GetEfficiencyKaonTPC() const {return fEfficiencyKaonTPC;}
-    TH1D *GetEfficiencyProtonTPC() const {return fEfficiencyProtonTPC;}
-    TH1D *GetEfficiencyHadronTPC() const {return fEfficiencyHadronTPC;}
-    TH1D *GetEfficiencyPionITS() const {return fEfficiencyPionITS;}
-    TH1D *GetEfficiencyKaonITS() const {return fEfficiencyKaonITS;}
-    TH1D *GetEfficiencyProtonITS() const {return fEfficiencyProtonITS;}
-    TH1D *GetEfficiencyHadronITS() const {return fEfficiencyHadronITS;}
+    TH1D *GetEfficiencyPionTPC(const int cb = -1);// const {return fEfficiencyPionTPC;}
+    TH1D *GetEfficiencyKaonTPC(const int cb = -1);// const {return fEfficiencyKaonTPC;}
+    TH1D *GetEfficiencyProtonTPC(const int cb = -1);// const {return fEfficiencyProtonTPC;}
+    TH1D *GetEfficiencyHadronTPC(const int cb = -1);// const {return fEfficiencyHadronTPC;}
+    TH1D *GetEfficiencyPionITS(const int cb = -1);// const {return fEfficiencyPionITS;}
+    TH1D *GetEfficiencyKaonITS(const int cb = -1);// const {return fEfficiencyKaonITS;}
+    TH1D *GetEfficiencyProtonITS(const int cb = -1);// const {return fEfficiencyProtonITS;}
+    TH1D *GetEfficiencyHadronITS(const int cb = -1);// const {return fEfficiencyHadronITS;}
     TH1D *GetBackgroundCorrectionTPC() const {return fBackgroundTPC;}
     TH1D *GetBackgroundCorrectionITS() const {return fBackgroundITS;}
 
@@ -128,6 +128,10 @@ public:
     void SetEfficiencyHadronITS(TH1D *histo, const int cb);
     void SetBackgroundCorrectionTPC(const TH1D *histo){fBackgroundTPC=(TH1D*) histo;}
     void SetBackgroundCorrectionITS(const TH1D *histo){fBackgroundITS=(TH1D*) histo;}
+    void SetEfficiencyErrorLowBound(const Float_t val){fEfficiencyErrorLow=val;}
+    void SetEfficiencyErrorHighBound(const Float_t val){fEfficiencyErrorHigh=val;}
+    void SetBackgroundErrorLowBound(const Float_t val){fBackgroundErrorLow=val;}
+    void SetBackgroundErrorHighBound(const Float_t val){fBackgroundErrorHigh=val;}
     void IsEMCal(Bool_t val){fIsEMCal=val;}
     void IsData(Bool_t val){fIsData=val;}
     void SetDataSet(Int_t val){fDataSet=val;}
@@ -137,6 +141,7 @@ public:
 
     //Returns the factor one needs to multiply by to get the corrected et for all constant (not pt dependent) factors
     Float_t GetConstantCorrections(Bool_t totEt, Float_t ptcut, TString type) const;
+    Float_t GetSystematicErrorBound(Float_t et,Bool_t isLowBound, Bool_t isHadronic, Bool_t isTPC);
 
 
     AliAnalysisHadEtCorrections(const AliAnalysisHadEtCorrections *g) ; // cpy ctor
@@ -188,6 +193,10 @@ protected:
     TH1D *fEfficiencyHadronITS;//efficiency correction for unidentified hadrons in the ITS
     TObjArray *fEfficiencyTPC;//TList containing efficiencies for ITS standalone tracks for different centrality bins
     TObjArray *fEfficiencyITS;//TList containing efficiencies for ITS standalone tracks for different centrality bins
+    Float_t fEfficiencyErrorLow;//Relative error on efficiency, lower bound
+    Float_t fEfficiencyErrorHigh;//Relative error on efficiency, upper bound
+    Float_t fBackgroundErrorLow;//Relative error on efficiency, lower bound
+    Float_t fBackgroundErrorHigh;//Relative error on efficiency, upper bound
     TH1D *fBackgroundTPC;//background correction for the TPC
     TH1D *fBackgroundITS;//background correction for the ITS
     Bool_t fIsEMCal;//boolean to keep track of whether this is for EMCal or PHOS acceptance