implementing option for 2.5% wide centrality bins
authorcnattras <saccharomyces.cerevisae@gmail.com>
Sat, 19 Jul 2014 18:18:48 +0000 (14:18 -0400)
committercnattras <saccharomyces.cerevisae@gmail.com>
Sat, 19 Jul 2014 18:18:48 +0000 (14:18 -0400)
PWGLF/totEt/AliAnalysisHadEt.cxx
PWGLF/totEt/AliAnalysisHadEt.h
PWGLF/totEt/AliAnalysisHadEtMonteCarlo.cxx
PWGLF/totEt/AliAnalysisHadEtReconstructed.cxx

index b0d5a26..4ab23e1 100644 (file)
@@ -29,6 +29,7 @@
 #include "AliInputEventHandler.h"
 #include "AliAnalysisManager.h"
 #include "AliLog.h"
+#include "AliCentrality.h"
 
 using namespace std;
 
@@ -317,3 +318,18 @@ Float_t AliAnalysisHadEt::TrueP(float pTrec) const {
   if(pTrec>1.0) return pTrec;
   return pTrec/(1-599.334*pTrec+7285.15*pTrec*pTrec)+pTrec;
 }
+
+Int_t AliAnalysisHadEt::GetCentralityBin(Int_t numberofbins,AliCentrality *centrality){
+  Int_t centralitybin = -1;
+  if(numberofbins<21) centralitybin= centrality->GetCentralityClass10(fCentralityMethod);
+  else{
+    if(numberofbins<41) centralitybin= centrality->GetCentralityClass5(fCentralityMethod);
+    else{
+      Float_t centpercent = centrality->GetCentralityPercentile(fCentralityMethod);
+      centralitybin= centrality->GetCentralityClass5(fCentralityMethod);
+      if(centralitybin>0) centralitybin =(Int_t) centpercent/2.5;
+    }
+  }
+  //cout<<" centrality bin "<<centralitybin<<endl;
+  return centralitybin;
+}
index c80491b..5d563d2 100644 (file)
@@ -21,6 +21,7 @@ class TParticle;
 class TDatabasePDG;
 class AliAnalysisEtCuts;
 class AliPIDResponse;
+class AliCentrality;
 
 class AliAnalysisHadEt : public AliAnalysisEtCommon
 {
@@ -73,6 +74,7 @@ public:
     void SetHistoList(const TList *mylist){fhistoList = (TList *) mylist;}
 
     AliPIDResponse *fPIDResponse;
+    Int_t GetCentralityBin(Int_t numberofbins,AliCentrality *centrality);//number of bins is 11 (10%), 21 (5%), or 41 (2.5%).  Number of bins includes a bin for those events with no centrality bin determined
 
 protected:   
     
index 42a510e..eef5cc3 100644 (file)
@@ -108,9 +108,12 @@ Int_t AliAnalysisHadEtMonteCarlo::AnalyseEvent(AliVEvent* ev,AliVEvent* ev2)
   fCentBin= -1;
   fGoodEvent = kTRUE;//for p+p collisions if we made it this far we have a good event
   if(fDataSet==20100 ||fDataSet==2011 ){//If this is Pb+Pb
-    AliCentrality *centrality = realEvent->GetCentrality();
-    if(fNCentBins<21) fCentBin= centrality->GetCentralityClass10(fCentralityMethod);
-    else{ fCentBin= centrality->GetCentralityClass5(fCentralityMethod);}
+//     AliCentrality *centrality2 = realEvent->GetCentrality();
+//     if(fNCentBins<21) fCentBin= centrality2->GetCentralityClass10(fCentralityMethod);
+//     else{ fCentBin= centrality2->GetCentralityClass5(fCentralityMethod);}
+//     cout<<"centrality "<<fCentBin<<endl;
+    AliCentrality *centrality =  realEvent->GetCentrality();
+    fCentBin = GetCentralityBin(fNCentBins, centrality);
     if(fCentBin ==-1) fGoodEvent = kFALSE;//but for Pb+Pb events we don't want to count events where we did not find a centrality
   }
   AnalyseEvent(ev);
index 0fd6d08..35304ca 100644 (file)
@@ -116,9 +116,11 @@ Int_t AliAnalysisHadEtReconstructed::AnalyseEvent(AliVEvent* ev, Int_t eventtype
   fCentBin= -1;
   fGoodEvent = kTRUE;//for p+p collisions if we made it this far we have a good event
   if(fDataSet==20100||fDataSet==2011){//If this is Pb+Pb or pPb
-    AliCentrality *centrality = realEvent->GetCentrality();
-    if(fNCentBins<21) fCentBin= centrality->GetCentralityClass10(fCentralityMethod);
-    else{ fCentBin= centrality->GetCentralityClass5(fCentralityMethod);}
+//     AliCentrality *centrality = realEvent->GetCentrality();
+//     if(fNCentBins<21) fCentBin= centrality->GetCentralityClass10(fCentralityMethod);
+//     else{ fCentBin= centrality->GetCentralityClass5(fCentralityMethod);}
+    AliCentrality *centrality =  realEvent->GetCentrality();
+    fCentBin = GetCentralityBin(fNCentBins, centrality);
     if(fCentBin ==-1){
       if(fDataSet==2013){
        fCentBin = 19;//For pPb we don't want to throw these events out but there is no CB 19
@@ -626,6 +628,7 @@ void AliAnalysisHadEtReconstructed::ResetEventValues(){//resetting event by even
   }
 }
 void AliAnalysisHadEtReconstructed::CreateHistograms(){//Creating histograms and adding them to the output TList
+  Float_t maxCentbinRange = fNCentBins+0.5;
 
   AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
   if (!man) {
@@ -837,15 +840,15 @@ void AliAnalysisHadEtReconstructed::CreateHistograms(){//Creating histograms and
 
   //Cross checks that corrections are applied correctly
   if(fDataSet==20100 || fDataSet==2011){
-    CreateHisto2D("fbkgdVsCentralityBin","f_{bkgd} vs centrality bin","centrality bin","f_{bkgd}",21,-1.5,19.5,200,0.7,1.05);//
-    CreateHisto2D("feffPionVsCentralityBin","Pion efficiency vs centrality bin","centrality bin","pion efficiency",21,-1.5,19.5,200,0,1.2);//
-    CreateHisto2D("feffHadronVsCentralityBin","Hadron efficiency vs centrality bin","centrality bin","hadron efficiency",21,-1.5,19.5,200,0,1.2);//
-    CreateHisto2D("feffKaonVsCentralityBin","Kaon efficiency vs centrality bin","centrality bin","kaon efficiency",21,-1.5,19.5,200,0,1.2);//
-    CreateHisto2D("feffProtonVsCentralityBin","Proton efficiency vs centrality bin","centrality bin","proton efficiency",21,-1.5,19.5,200,0,1.2);//
-    CreateHisto2D("fnotIDVsCentralityBin","f_{notID} vs centrality bin","centrality bin","f_{notID}",21,-1.5,19.5,50,0.95,1.05);//
-    CreateHisto2D("fpTcutVsCentralityBin","f_{pTcut} vs centrality bin","centrality bin","f_{pTcut}",21,-1.5,19.5,50,0.95,1.05);
-    CreateHisto2D("fneutralVsCentralityBin","f_{neutral} vs centrality bin","centrality bin","f_{neutral}",21,-1.5,19.5,50,0.5,1.00);
-    CreateHisto2D("ConstantCorrectionsVsCentralityBin","constant corrections vs centrality bin","centrality bin","constant corrections",21,-1.5,19.5,50,0.5,1.00);
+    CreateHisto2D("fbkgdVsCentralityBin","f_{bkgd} vs centrality bin","centrality bin","f_{bkgd}",fNCentBins,-1.5,maxCentbinRange,200,0.7,1.05);//
+    CreateHisto2D("feffPionVsCentralityBin","Pion efficiency vs centrality bin","centrality bin","pion efficiency",fNCentBins,-1.5,maxCentbinRange,200,0,1.2);//
+    CreateHisto2D("feffHadronVsCentralityBin","Hadron efficiency vs centrality bin","centrality bin","hadron efficiency",fNCentBins,-1.5,maxCentbinRange,200,0,1.2);//
+    CreateHisto2D("feffKaonVsCentralityBin","Kaon efficiency vs centrality bin","centrality bin","kaon efficiency",fNCentBins,-1.5,maxCentbinRange,200,0,1.2);//
+    CreateHisto2D("feffProtonVsCentralityBin","Proton efficiency vs centrality bin","centrality bin","proton efficiency",fNCentBins,-1.5,maxCentbinRange,200,0,1.2);//
+    CreateHisto2D("fnotIDVsCentralityBin","f_{notID} vs centrality bin","centrality bin","f_{notID}",fNCentBins,-1.5,maxCentbinRange,50,0.95,1.05);//
+    CreateHisto2D("fpTcutVsCentralityBin","f_{pTcut} vs centrality bin","centrality bin","f_{pTcut}",fNCentBins,-1.5,maxCentbinRange,50,0.95,1.05);
+    CreateHisto2D("fneutralVsCentralityBin","f_{neutral} vs centrality bin","centrality bin","f_{neutral}",fNCentBins,-1.5,maxCentbinRange,50,0.5,1.00);
+    CreateHisto2D("ConstantCorrectionsVsCentralityBin","constant corrections vs centrality bin","centrality bin","constant corrections",fNCentBins,-1.5,maxCentbinRange,50,0.5,1.00);
   }
 
   delete sTPC;