]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Moving to the AliCFContainer classes as input containers for protons and antiprotons
authorpchrist <pchrist@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 13 Aug 2008 17:18:20 +0000 (17:18 +0000)
committerpchrist <pchrist@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 13 Aug 2008 17:18:20 +0000 (17:18 +0000)
PWG2/AliAnalysisTaskProtons.cxx
PWG2/AliProtonCorrectionTask.h
PWG2/SPECTRA/AliProtonAnalysis.cxx
PWG2/SPECTRA/AliProtonAnalysis.h
PWG2/runProtonAnalysis.C
PWG2/runProtonCorrection.C

index 028c140e176f525892309db25e75be7de9784336..9ccf81ebc95f22920fbe7b7769f077dadfce4f58 100644 (file)
@@ -18,6 +18,7 @@
 #include "AliMCEventHandler.h"
 #include "AliMCEvent.h"
 #include "AliStack.h"
+#include "AliCFContainer.h"
 
 #include "PWG2spectra/SPECTRA/AliProtonAnalysis.h"
 #include "AliAnalysisTaskProtons.h"
@@ -104,10 +105,10 @@ void AliAnalysisTaskProtons::CreateOutputObjects() {
   
   //proton analysis object
   fAnalysis = new AliProtonAnalysis();
-  fAnalysis->InitHistograms(10,-1.0,1.0,30,0.1,3.1);
+  fAnalysis->InitAnalysisHistograms(10,-1.0,1.0,26,0.5,3.1);
 
   if(fAnalysisType == "ESD") {
-    //Use of TPConly tracks                                                                                                                                                      
+    //Use of TPConly tracks
     fAnalysis->UseTPCOnly();
 
     //TPC related cuts       
@@ -121,9 +122,9 @@ void AliAnalysisTaskProtons::CreateOutputObjects() {
     fAnalysis->SetMaxSigmaToVertex(2.5);
     fAnalysis->SetTPCRefit();
 
-    //ITS related cuts - to be used in the case of the analysis of global tracks                                                                                                
-    //fAnalysis->SetMinITSClusters(5);                                                                                                                                          
-    //fAnalysis->SetITSRefit();                                                                                                                                                  
+    //ITS related cuts - to be used for the analysis of global tracking 
+    //fAnalysis->SetMinITSClusters(5);
+    //fAnalysis->SetITSRefit();
   }
 
   if(fFunctionUsed)
@@ -139,6 +140,8 @@ void AliAnalysisTaskProtons::CreateOutputObjects() {
   fList->Add(fAnalysis->GetProtonYPtHistogram());
   fList->Add(fAnalysis->GetAntiProtonYPtHistogram());
   fList->Add(fAnalysis->GetEventHistogram());
+  fList->Add(fAnalysis->GetProtonContainer());
+  fList->Add(fAnalysis->GetAntiProtonContainer());
 }
 
 //________________________________________________________________________
index d18ab660fb796992890140422e41c3d0db41fcdd..d5c8e7700c32c1fe91536310a06e8786d8718c37 100644 (file)
@@ -52,10 +52,12 @@ class AliProtonCorrectionTask : public AliAnalysisTaskSE {
   void     Terminate(Option_t *);
   
   // CORRECTION FRAMEWORK RELATED FUNCTIONS
-  void           SetCFManagerProtons(AliCFManager* io) {fCFManagerProtons = io;}   // global correction manager
-  AliCFManager * GetCFManagerProtons() const {return fCFManagerProtons;}           // get corr manager
-  void           SetCFManagerAntiProtons(AliCFManager* io) {fCFManagerAntiProtons = io;} // global correction manager
-  AliCFManager * GetCFManagerAntiProtons() const {return fCFManagerAntiProtons;}         // get corr manager
+  void  SetCFManagerProtons(AliCFManager* io) {fCFManagerProtons = io;}  
+  // global correction manager
+  AliCFManager * GetCFManagerProtons() const {return fCFManagerProtons;}
+  // get corr manager
+  void SetCFManagerAntiProtons(AliCFManager* io) {fCFManagerAntiProtons = io;} // global correction manager
+  AliCFManager * GetCFManagerAntiProtons() const {return fCFManagerAntiProtons;}// get corr manager
   void           SetQAList(TList* list) {fQAHistList = list;}
 
   // Data types
index 2347aa1539dbb3319605ad188ce34d54858d4746..fc5c5e43b29a96af777b2efa8821f1b6fe6d55ea 100644 (file)
@@ -22,7 +22,7 @@
 #include <TFile.h>
 #include <TSystem.h>
 #include <TF1.h>
-#include <TH2F.h>
+#include <TH2D.h>
 #include <TH1D.h>
 #include <TH1I.h>
 #include <TParticle.h>
@@ -37,7 +37,7 @@
 #include <AliStack.h>
 #include <AliCFContainer.h>
 #include <AliCFEffGrid.h>
-#include <AliCFEffGrid.h>
+#include <AliCFDataGrid.h>
 
 ClassImp(AliProtonAnalysis)
 
@@ -69,9 +69,14 @@ AliProtonAnalysis::AliProtonAnalysis() :
   fFunctionProbabilityFlag(kFALSE), 
   fElectronFunction(0), fMuonFunction(0),
   fPionFunction(0), fKaonFunction(0), fProtonFunction(0),
-  fUseTPCOnly(kFALSE), fHistEvents(0), fHistYPtProtons(0), fHistYPtAntiProtons(0),
-  fCorrectionListProtons2D(0), fEfficiencyListProtons1D(0), fCorrectionListProtons1D(0),
-  fCorrectionListAntiProtons2D(0), fEfficiencyListAntiProtons1D(0), fCorrectionListAntiProtons1D(0) {
+  fUseTPCOnly(kFALSE), 
+  fProtonContainer(0), fAntiProtonContainer(0),
+  fHistEvents(0), fHistYPtProtons(0), fHistYPtAntiProtons(0),
+  fEffGridListProtons(0), fCorrectionListProtons2D(0), 
+  fEfficiencyListProtons1D(0), fCorrectionListProtons1D(0),
+  fEffGridListAntiProtons(0), fCorrectionListAntiProtons2D(0), 
+  fEfficiencyListAntiProtons1D(0), fCorrectionListAntiProtons1D(0),
+  fCorrectProtons(0), fCorrectAntiProtons(0) {
   //Default constructor
   for(Int_t i = 0; i < 5; i++) fPartFrac[i] = 0.0;
 }
@@ -104,24 +109,52 @@ AliProtonAnalysis::AliProtonAnalysis(Int_t nbinsY, Float_t fLowY, Float_t fHighY
   fFunctionProbabilityFlag(kFALSE), 
   fElectronFunction(0), fMuonFunction(0),
   fPionFunction(0), fKaonFunction(0), fProtonFunction(0),
-  fUseTPCOnly(kFALSE), fHistEvents(0), fHistYPtProtons(0), fHistYPtAntiProtons(0),
-  fCorrectionListProtons2D(0), fEfficiencyListProtons1D(0), fCorrectionListProtons1D(0),
-  fCorrectionListAntiProtons2D(0), fEfficiencyListAntiProtons1D(0), fCorrectionListAntiProtons1D(0) {
+  fUseTPCOnly(kFALSE),   
+  fProtonContainer(0), fAntiProtonContainer(0),
+  fHistEvents(0), fHistYPtProtons(0), fHistYPtAntiProtons(0),
+  fEffGridListProtons(0), fCorrectionListProtons2D(0), 
+  fEfficiencyListProtons1D(0), fCorrectionListProtons1D(0),
+  fEffGridListAntiProtons(0), fCorrectionListAntiProtons2D(0), 
+  fEfficiencyListAntiProtons1D(0), fCorrectionListAntiProtons1D(0),
+  fCorrectProtons(0), fCorrectAntiProtons(0){
   //Default constructor
 
   fHistEvents = new TH1I("fHistEvents","Analyzed events",1,0,1);
 
-  fHistYPtProtons = new TH2F("fHistYPtProtons","y-Pt Protons",fNBinsY,fMinY,fMaxY,fNBinsPt,fMinPt,fMaxPt);
+  fHistYPtProtons = new TH2D("fHistYPtProtons","y-Pt Protons",fNBinsY,fMinY,fMaxY,fNBinsPt,fMinPt,fMaxPt);
   fHistYPtProtons->SetStats(kTRUE);
   fHistYPtProtons->GetYaxis()->SetTitle("P_{T} [GeV]");
   fHistYPtProtons->GetXaxis()->SetTitle("y");
   fHistYPtProtons->GetXaxis()->SetTitleColor(1);
 
-  fHistYPtAntiProtons = new TH2F("fHistYPtAntiProtons","y-Pt Antiprotons",fNBinsY,fMinY,fMaxY,fNBinsPt,fMinPt,fMaxPt);
+  fHistYPtAntiProtons = new TH2D("fHistYPtAntiProtons","y-Pt Antiprotons",fNBinsY,fMinY,fMaxY,fNBinsPt,fMinPt,fMaxPt);
   fHistYPtAntiProtons->SetStats(kTRUE);
   fHistYPtAntiProtons->GetYaxis()->SetTitle("P_{T} [GeV]");
   fHistYPtAntiProtons->GetXaxis()->SetTitle("y");
   fHistYPtAntiProtons->GetXaxis()->SetTitleColor(1);
+
+  //setting up the containers
+  Int_t iBin[2];
+  iBin[0] = nbinsY;
+  iBin[1] = nbinsPt;
+  Double_t *binLimY = new Double_t[nbinsY+1];
+  Double_t *binLimPt = new Double_t[nbinsPt+1];
+  //values for bin lower bounds
+  for(Int_t i = 0; i <= nbinsY; i++) 
+    binLimY[i]=(Double_t)fLowY  + (fHighY - fLowY)  /nbinsY*(Double_t)i;
+  for(Int_t i = 0; i <= nbinsPt; i++) 
+    binLimPt[i]=(Double_t)fLowPt  + (fHighPt - fLowPt)  /nbinsPt*(Double_t)i;
+
+  fProtonContainer = new AliCFContainer("containerProtons",
+                                       "container for protons",
+                                       1,2,iBin);
+  fProtonContainer->SetBinLimits(0,binLimY); //rapidity
+  fProtonContainer->SetBinLimits(1,binLimPt); //pT
+  fAntiProtonContainer = new AliCFContainer("containerAntiProtons",
+                                           "container for antiprotons",
+                                           1,2,iBin);
+  fAntiProtonContainer->SetBinLimits(0,binLimY); //rapidity
+  fAntiProtonContainer->SetBinLimits(1,binLimPt); //pT
 } 
 
 //____________________________________________________________________//
@@ -130,27 +163,41 @@ AliProtonAnalysis::~AliProtonAnalysis() {
   if(fHistEvents) delete fHistEvents;
   if(fHistYPtProtons) delete fHistYPtProtons;
   if(fHistYPtAntiProtons) delete fHistYPtAntiProtons;
+  if(fProtonContainer) delete fProtonContainer;
+  if(fAntiProtonContainer) delete fAntiProtonContainer;
+
   if(fGlobalQAList) delete fGlobalQAList;
   if(fQA2DList) delete fQA2DList;
   if(fQAPrimaryProtonsAcceptedList) delete fQAPrimaryProtonsAcceptedList;
   if(fQAPrimaryProtonsRejectedList) delete fQAPrimaryProtonsRejectedList;
   if(fQASecondaryProtonsAcceptedList) delete fQASecondaryProtonsAcceptedList;
   if(fQASecondaryProtonsRejectedList) delete fQASecondaryProtonsRejectedList;
-  if(fQAPrimaryAntiProtonsAcceptedList) delete fQAPrimaryAntiProtonsAcceptedList;
-  if(fQAPrimaryAntiProtonsRejectedList) delete fQAPrimaryAntiProtonsRejectedList;
-  if(fQASecondaryAntiProtonsAcceptedList) delete fQASecondaryAntiProtonsAcceptedList;
-  if(fQASecondaryAntiProtonsRejectedList) delete fQASecondaryAntiProtonsRejectedList; 
+  if(fQAPrimaryAntiProtonsAcceptedList) 
+    delete fQAPrimaryAntiProtonsAcceptedList;
+  if(fQAPrimaryAntiProtonsRejectedList) 
+    delete fQAPrimaryAntiProtonsRejectedList;
+  if(fQASecondaryAntiProtonsAcceptedList) 
+    delete fQASecondaryAntiProtonsAcceptedList;
+  if(fQASecondaryAntiProtonsRejectedList) 
+    delete fQASecondaryAntiProtonsRejectedList; 
+
+  if(fEffGridListProtons) delete fEffGridListProtons;
   if(fCorrectionListProtons2D) delete fCorrectionListProtons2D;
   if(fEfficiencyListProtons1D) delete fEfficiencyListProtons1D;
   if(fCorrectionListProtons1D) delete fCorrectionListProtons1D;
+  if(fEffGridListAntiProtons) delete fEffGridListAntiProtons;
   if(fCorrectionListAntiProtons2D) delete fCorrectionListAntiProtons2D;
   if(fEfficiencyListAntiProtons1D) delete fEfficiencyListAntiProtons1D;
   if(fCorrectionListAntiProtons1D) delete fCorrectionListAntiProtons1D;
+  if(fCorrectProtons) delete fCorrectProtons;
+  if(fCorrectAntiProtons) delete fCorrectAntiProtons;
 }
 
 //____________________________________________________________________//
-void AliProtonAnalysis::InitAnalysisHistograms(Int_t nbinsY, Float_t fLowY, Float_t fHighY, 
-                                              Int_t nbinsPt, Float_t fLowPt, Float_t fHighPt) {
+void AliProtonAnalysis::InitAnalysisHistograms(Int_t nbinsY, 
+                                              Float_t fLowY, Float_t fHighY, 
+                                              Int_t nbinsPt, 
+                                              Float_t fLowPt, Float_t fHighPt) {
   fNBinsY = nbinsY;
   fMinY = fLowY;
   fMaxY = fHighY;
@@ -160,17 +207,42 @@ void AliProtonAnalysis::InitAnalysisHistograms(Int_t nbinsY, Float_t fLowY, Floa
 
   fHistEvents = new TH1I("fHistEvents","Anallyzed events",1,0,1);
 
-  fHistYPtProtons = new TH2F("fHistYPtProtons","y-Pt Protons",fNBinsY,fMinY,fMaxY,fNBinsPt,fMinPt,fMaxPt);
+  fHistYPtProtons = new TH2D("fHistYPtProtons","y-Pt Protons",
+                            fNBinsY,fMinY,fMaxY,fNBinsPt,fMinPt,fMaxPt);
   fHistYPtProtons->SetStats(kTRUE);
   fHistYPtProtons->GetYaxis()->SetTitle("P_{T} [GeV]");
   fHistYPtProtons->GetXaxis()->SetTitle("y");
   fHistYPtProtons->GetXaxis()->SetTitleColor(1);
 
-  fHistYPtAntiProtons = new TH2F("fHistYPtAntiProtons","y-Pt Antiprotons",fNBinsY,fMinY,fMaxY,fNBinsPt,fMinPt,fMaxPt);
+  fHistYPtAntiProtons = new TH2D("fHistYPtAntiProtons","y-Pt Antiprotons",
+                                fNBinsY,fMinY,fMaxY,fNBinsPt,fMinPt,fMaxPt);
   fHistYPtAntiProtons->SetStats(kTRUE);
   fHistYPtAntiProtons->GetYaxis()->SetTitle("P_{T} [GeV]");
   fHistYPtAntiProtons->GetXaxis()->SetTitle("y");
   fHistYPtAntiProtons->GetXaxis()->SetTitleColor(1);
+
+  //setting up the containers
+  Int_t iBin[2];
+  iBin[0] = nbinsY;
+  iBin[1] = nbinsPt;
+  Double_t *binLimY = new Double_t[nbinsY+1];
+  Double_t *binLimPt = new Double_t[nbinsPt+1];
+  //values for bin lower bounds
+  for(Int_t i = 0; i <= nbinsY; i++) 
+    binLimY[i]=(Double_t)fLowY  + (fHighY - fLowY)  /nbinsY*(Double_t)i;
+  for(Int_t i = 0; i <= nbinsPt; i++) 
+    binLimPt[i]=(Double_t)fLowPt  + (fHighPt - fLowPt)  /nbinsPt*(Double_t)i;
+
+  fProtonContainer = new AliCFContainer("containerProtons",
+                                       "container for protons",
+                                       1,2,iBin);
+  fProtonContainer->SetBinLimits(0,binLimY); //rapidity
+  fProtonContainer->SetBinLimits(1,binLimPt); //pT
+  fAntiProtonContainer = new AliCFContainer("containerAntiProtons",
+                                           "container for antiprotons",
+                                           1,2,iBin);
+  fAntiProtonContainer->SetBinLimits(0,binLimY); //rapidity
+  fAntiProtonContainer->SetBinLimits(1,binLimPt); //pT
 }
 
 //____________________________________________________________________//
@@ -186,23 +258,30 @@ Bool_t AliProtonAnalysis::ReadFromFile(const char* filename) {
   TList *list = (TList *)file->Get("outputList1");
   if(list) {
     cout<<"Retrieving objects from the list "<<list->GetName()<<"..."<<endl; 
-    fHistYPtProtons = (TH2F *)list->At(0);
-    fHistYPtAntiProtons = (TH2F *)list->At(1);
+    fHistYPtProtons = (TH2D *)list->At(0);
+    fHistYPtAntiProtons = (TH2D *)list->At(1);
     fHistEvents = (TH1I *)list->At(2);
+    fProtonContainer = (AliCFContainer *)list->At(3);
+    fAntiProtonContainer = (AliCFContainer *)list->At(4);
   }
   else if(!list) {
     cout<<"Retrieving objects from the file... "<<endl;
-    fHistYPtProtons = (TH2F *)file->Get("fHistYPtProtons");
-    fHistYPtAntiProtons = (TH2F *)file->Get("fHistYPtAntiProtons");
+    fHistYPtProtons = (TH2D *)file->Get("fHistYPtProtons");
+    fHistYPtAntiProtons = (TH2D *)file->Get("fHistYPtAntiProtons");
     fHistEvents = (TH1I *)file->Get("fHistEvents");
+    fProtonContainer = (AliCFContainer *)file->Get("containerProtons");
+    fAntiProtonContainer = (AliCFContainer *)file->Get("containerAntiProtons");
   }
-  if((!fHistYPtProtons)||(!fHistYPtAntiProtons)||(!fHistEvents)) {
+  if((!fHistYPtProtons)||(!fHistYPtAntiProtons)||(!fHistEvents)
+     ||(!fProtonContainer)||(!fAntiProtonContainer)) {
     cout<<"Input containers were not found!!!"<<endl;
     status = kFALSE;
   }
   else {
-    fHistYPtProtons->Sumw2();
-    fHistYPtAntiProtons->Sumw2();
+    fHistYPtProtons = fProtonContainer->ShowProjection(0,1,0);
+    fHistYPtAntiProtons = fAntiProtonContainer->ShowProjection(0,1,0);
+    //fHistYPtProtons->Sumw2();
+    //fHistYPtAntiProtons->Sumw2();
   }
 
   return status;
@@ -211,22 +290,27 @@ Bool_t AliProtonAnalysis::ReadFromFile(const char* filename) {
 //____________________________________________________________________//
 TH1D *AliProtonAnalysis::GetProtonYHistogram() {
   Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
-  TH1D *fYProtons = (TH1D *)fHistYPtProtons->ProjectionX("fYProtons",0,fHistYPtProtons->GetYaxis()->GetNbins(),"e"); 
+
+  //TH1D *fYProtons = (TH1D *)fHistYPtProtons->ProjectionX("fYProtons",0,fHistYPtProtons->GetYaxis()->GetNbins(),"e");
+  TH1D *fYProtons = fProtonContainer->ShowProjection(0,0); //variable-step
+   
   fYProtons->SetStats(kFALSE);
   fYProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dy)");
   fYProtons->SetTitle("dN/dy protons");
   fYProtons->SetMarkerStyle(kFullCircle);
   fYProtons->SetMarkerColor(4);
   if(nAnalyzedEvents > 0)
-    fYProtons->Scale(1./nAnalyzedEvents);
-
+  fYProtons->Scale(1./nAnalyzedEvents);
+  
   return fYProtons;
 }
 
 //____________________________________________________________________//
 TH1D *AliProtonAnalysis::GetAntiProtonYHistogram() {
   Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
-  TH1D *fYAntiProtons = (TH1D *)fHistYPtAntiProtons->ProjectionX("fYAntiProtons",0,fHistYPtAntiProtons->GetYaxis()->GetNbins(),"e"); 
+  //TH1D *fYAntiProtons = (TH1D *)fHistYPtAntiProtons->ProjectionX("fYAntiProtons",0,fHistYPtAntiProtons->GetYaxis()->GetNbins(),"e");
+  TH1D *fYAntiProtons = fAntiProtonContainer->ShowProjection(0,0);//variable-step 
   fYAntiProtons->SetStats(kFALSE);
   fYAntiProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dy)");
   fYAntiProtons->SetTitle("dN/dy antiprotons");
@@ -241,7 +325,9 @@ TH1D *AliProtonAnalysis::GetAntiProtonYHistogram() {
 //____________________________________________________________________//
 TH1D *AliProtonAnalysis::GetProtonPtHistogram() {
   Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
-  TH1D *fPtProtons = (TH1D *)fHistYPtProtons->ProjectionY("fPtProtons",0,fHistYPtProtons->GetXaxis()->GetNbins(),"e"); 
+  //TH1D *fPtProtons = (TH1D *)fHistYPtProtons->ProjectionY("fPtProtons",0,fHistYPtProtons->GetXaxis()->GetNbins(),"e"); 
+  TH1D *fPtProtons = fProtonContainer->ShowProjection(1,0); //variable-step
+
   fPtProtons->SetStats(kFALSE);
   fPtProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dP_{T})");
   fPtProtons->SetTitle("dN/dPt protons");
@@ -256,7 +342,9 @@ TH1D *AliProtonAnalysis::GetProtonPtHistogram() {
 //____________________________________________________________________//
 TH1D *AliProtonAnalysis::GetAntiProtonPtHistogram() {
   Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
-  TH1D *fPtAntiProtons = (TH1D *)fHistYPtAntiProtons->ProjectionY("fPtAntiProtons",0,fHistYPtProtons->GetXaxis()->GetNbins(),"e"); 
+  //TH1D *fPtAntiProtons = (TH1D *)fHistYPtAntiProtons->ProjectionY("fPtAntiProtons",0,fHistYPtProtons->GetXaxis()->GetNbins(),"e"); 
+  TH1D *fPtAntiProtons = fAntiProtonContainer->ShowProjection(1,0); //variable-step
+
   fPtAntiProtons->SetStats(kFALSE);
   fPtAntiProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dP_{T})");
   fPtAntiProtons->SetTitle("dN/dPt antiprotons");
@@ -268,6 +356,78 @@ TH1D *AliProtonAnalysis::GetAntiProtonPtHistogram() {
   return fPtAntiProtons;
 }
 
+//____________________________________________________________________//
+TH1D *AliProtonAnalysis::GetProtonCorrectedYHistogram() {
+  Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
+
+  TH1D *fYProtons = fCorrectProtons->Project(0); //0: rapidity
+   
+  fYProtons->SetStats(kFALSE);
+  fYProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dy)");
+  fYProtons->GetXaxis()->SetTitle("y");
+  fYProtons->SetTitle("dN/dy protons");
+  fYProtons->SetMarkerStyle(kFullCircle);
+  fYProtons->SetMarkerColor(4);
+  if(nAnalyzedEvents > 0)
+    fYProtons->Scale(1./nAnalyzedEvents);
+  
+  return fYProtons;
+}
+
+//____________________________________________________________________//
+TH1D *AliProtonAnalysis::GetAntiProtonCorrectedYHistogram() {
+  Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
+
+  TH1D *fYAntiProtons = fCorrectAntiProtons->Project(0); //0: rapidity
+   
+  fYAntiProtons->SetStats(kFALSE);
+  fYAntiProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dy)");
+  fYAntiProtons->GetXaxis()->SetTitle("y");
+  fYAntiProtons->SetTitle("dN/dy protons");
+  fYAntiProtons->SetMarkerStyle(kFullCircle);
+  fYAntiProtons->SetMarkerColor(4);
+  if(nAnalyzedEvents > 0)
+    fYAntiProtons->Scale(1./nAnalyzedEvents);
+  
+  return fYAntiProtons;
+}
+
+//____________________________________________________________________//
+TH1D *AliProtonAnalysis::GetProtonCorrectedPtHistogram() {
+  Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
+
+  TH1D *fPtProtons = fCorrectProtons->Project(0); //0: rapidity
+   
+  fPtProtons->SetStats(kFALSE);
+  fPtProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dP_{T})");
+  fPtProtons->GetXaxis()->SetTitle("P_{T} [GeV/c]");
+  fPtProtons->SetTitle("dN/dPt protons");
+  fPtProtons->SetMarkerStyle(kFullCircle);
+  fPtProtons->SetMarkerColor(4);
+  if(nAnalyzedEvents > 0)
+    fPtProtons->Scale(1./nAnalyzedEvents);
+  
+  return fPtProtons;
+}
+
+//____________________________________________________________________//
+TH1D *AliProtonAnalysis::GetAntiProtonCorrectedPtHistogram() {
+  Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
+
+  TH1D *fPtAntiProtons = fCorrectAntiProtons->Project(0); //0: rapidity
+   
+  fPtAntiProtons->SetStats(kFALSE);
+  fPtAntiProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dP_{T})");
+  fPtAntiProtons->GetXaxis()->SetTitle("P_{T} [GeV/c]");
+  fPtAntiProtons->SetTitle("dN/dPt antiprotons");
+  fPtAntiProtons->SetMarkerStyle(kFullCircle);
+  fPtAntiProtons->SetMarkerColor(4);
+  if(nAnalyzedEvents > 0)
+    fPtAntiProtons->Scale(1./nAnalyzedEvents);
+  
+  return fPtAntiProtons;
+}
+
 //____________________________________________________________________//
 TH1D *AliProtonAnalysis::GetYRatioHistogram() {
   TH1D *fYProtons = GetProtonYHistogram();
@@ -371,6 +531,7 @@ Double_t AliProtonAnalysis::GetParticleFraction(Int_t i, Double_t p) {
 void AliProtonAnalysis::Analyze(AliESDEvent* fESD) {
   //Main analysis part - ESD
   fHistEvents->Fill(0); //number of analyzed events
+  Double_t containerInput[2] ;
   Double_t Pt = 0.0, P = 0.0;
   Int_t nGoodTracks = fESD->GetNumberOfTracks();
   for(Int_t iTracks = 0; iTracks < nGoodTracks; iTracks++) {
@@ -395,10 +556,30 @@ void AliProtonAnalysis::Analyze(AliESDEvent* fESD) {
          w[i] = probability[i]*GetParticleFraction(i,P)/rcc;
        Long64_t fParticleType = TMath::LocMax(AliPID::kSPECIES,w);
        if(fParticleType == 4) {
-         if(tpcTrack->Charge() > 0) 
-           fHistYPtProtons->Fill(Rapidity(tpcTrack->Px(),tpcTrack->Py(),tpcTrack->Pz()),Pt);
-         else if(tpcTrack->Charge() < 0) 
-           fHistYPtAntiProtons->Fill(Rapidity(tpcTrack->Px(),tpcTrack->Py(),tpcTrack->Pz()),Pt);
+         if(tpcTrack->Charge() > 0) {
+           fHistYPtProtons->Fill(Rapidity(tpcTrack->Px(),
+                                          tpcTrack->Py(),
+                                          tpcTrack->Pz()),
+                                 Pt);
+           //fill the container
+           containerInput[0] = Rapidity(tpcTrack->Px(),
+                                        tpcTrack->Py(),
+                                        tpcTrack->Pz());
+           containerInput[1] = Pt;
+           fProtonContainer->Fill(containerInput,0);   
+         }//protons
+         else if(tpcTrack->Charge() < 0) {
+           fHistYPtAntiProtons->Fill(Rapidity(tpcTrack->Px(),
+                                              tpcTrack->Py(),
+                                              tpcTrack->Pz()),
+                                     Pt);
+           //fill the container
+           containerInput[0] = Rapidity(tpcTrack->Px(),
+                                        tpcTrack->Py(),
+                                        tpcTrack->Pz());
+           containerInput[1] = Pt;
+           fAntiProtonContainer->Fill(containerInput,0);
+         }//antiprotons   
        }//proton check
       }//TPC only tracks
       else if(!fUseTPCOnly) {
@@ -417,10 +598,30 @@ void AliProtonAnalysis::Analyze(AliESDEvent* fESD) {
        Long64_t fParticleType = TMath::LocMax(AliPID::kSPECIES,w);
        if(fParticleType == 4) {
          //cout<<"(Anti)protons found..."<<endl;
-         if(track->Charge() > 0) 
-           fHistYPtProtons->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
-         else if(track->Charge() < 0) 
-           fHistYPtAntiProtons->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
+         if(track->Charge() > 0) {
+           fHistYPtProtons->Fill(Rapidity(track->Px(),
+                                          track->Py(),
+                                          track->Pz()),
+                                 Pt);
+           //fill the container
+           containerInput[0] = Rapidity(track->Px(),
+                                        track->Py(),
+                                        track->Pz());
+           containerInput[1] = Pt;
+           fProtonContainer->Fill(containerInput,0);   
+         }//protons
+         else if(track->Charge() < 0) {
+           fHistYPtAntiProtons->Fill(Rapidity(track->Px(),
+                                              track->Py(),
+                                              track->Pz()),
+                                     Pt);
+           //fill the container
+           containerInput[0] = Rapidity(track->Px(),
+                                        track->Py(),
+                                        track->Pz());
+           containerInput[1] = Pt;
+           fAntiProtonContainer->Fill(containerInput,0);   
+         }//antiprotons
        }//proton check 
       }//combined tracking
     }//cuts
@@ -447,8 +648,10 @@ void AliProtonAnalysis::Analyze(AliAODEvent* fAOD) {
     for(Int_t i = 0; i < AliPID::kSPECIESN; i++) w[i] = probability[i]*GetParticleFraction(i,P)/rcc;
     Long64_t fParticleType = TMath::LocMax(AliPID::kSPECIESN,w);
     if(fParticleType == 4) {
-      if(track->Charge() > 0) fHistYPtProtons->Fill(track->Y(fParticleType),Pt);
-      else if(track->Charge() < 0) fHistYPtAntiProtons->Fill(track->Y(fParticleType),Pt);
+      if(track->Charge() > 0) 
+       fHistYPtProtons->Fill(track->Y(fParticleType),Pt);
+      else if(track->Charge() < 0) 
+       fHistYPtAntiProtons->Fill(track->Y(fParticleType),Pt);
     }//proton check
   }//track loop 
 }
@@ -470,7 +673,7 @@ void AliProtonAnalysis::Analyze(AliStack* stack) {
                                                            particle->Py(),
                                                            particle->Pz()),
                                                   particle->Pt());
-  }//particle loop                                                                  
+  }//particle loop
 }
 
 //____________________________________________________________________//
@@ -542,7 +745,8 @@ Bool_t AliProtonAnalysis::IsAccepted(AliESDtrack* track) {
     if ((track->GetStatus() & AliESDtrack::kTPCpid) == 0) return kFALSE;
 
   if((Pt < fMinPt) || (Pt > fMaxPt)) return kFALSE;
-  if((Rapidity(Px,Py,Pz) < fMinY) || (Rapidity(Px,Py,Pz) > fMaxY)) return kFALSE;
+  if((Rapidity(Px,Py,Pz) < fMinY) || (Rapidity(Px,Py,Pz) > fMaxY)) 
+    return kFALSE;
 
   return kTRUE;
 }
@@ -1210,6 +1414,20 @@ Bool_t AliProtonAnalysis::PrintYields(TH1 *hist, Double_t edge) {
   return 0;
 }
 
+//____________________________________________________________________//
+void AliProtonAnalysis::Correct(Int_t step) {
+  //Applies the correction maps to the initial containers
+  fCorrectProtons = new AliCFDataGrid("correctProtons",
+                                     "corrected data",
+                                     *fProtonContainer);
+  fCorrectProtons->ApplyEffCorrection(*(AliCFEffGrid *)fEffGridListProtons->At(step));
+
+  fCorrectAntiProtons = new AliCFDataGrid("correctAntiProtons",
+                                         "corrected data",
+                                         *fAntiProtonContainer);
+  fCorrectAntiProtons->ApplyEffCorrection(*(AliCFEffGrid *)fEffGridListAntiProtons->At(step));
+}
+
 //____________________________________________________________________//
 Bool_t AliProtonAnalysis::ReadCorrectionContainer(const char* filename) {
   // Reads the outout of the correction framework task
@@ -1225,6 +1443,7 @@ Bool_t AliProtonAnalysis::ReadCorrectionContainer(const char* filename) {
 
   //________________________________________//
   //Protons
+  fEffGridListProtons = new TList();
   fCorrectionListProtons2D = new TList(); 
   fEfficiencyListProtons1D = new TList(); 
   fCorrectionListProtons1D = new TList();
@@ -1244,6 +1463,7 @@ Bool_t AliProtonAnalysis::ReadCorrectionContainer(const char* filename) {
                                         "effProtonsStep0Step1",
                                         *corrfwContainerProtons);
   effProtonsStep0Step1->CalculateEfficiency(1,0); //eff= step1/step0
+  fEffGridListProtons->Add(effProtonsStep0Step1);
   gYPt[0] = effProtonsStep0Step1->Project(iRap,iPt);
   fCorrectionListProtons2D->Add(gYPt[0]);
   
@@ -1251,6 +1471,7 @@ Bool_t AliProtonAnalysis::ReadCorrectionContainer(const char* filename) {
                                         "effProtonsStep0Step2",
                                         *corrfwContainerProtons);
   effProtonsStep0Step2->CalculateEfficiency(2,0); //eff= step2/step0
+  fEffGridListProtons->Add(effProtonsStep0Step2);
   gYPt[1] = effProtonsStep0Step2->Project(iRap,iPt);
   fCorrectionListProtons2D->Add(gYPt[1]);
 
@@ -1258,6 +1479,7 @@ Bool_t AliProtonAnalysis::ReadCorrectionContainer(const char* filename) {
                                         "effProtonsStep0Step3",
                                         *corrfwContainerProtons);
   effProtonsStep0Step3->CalculateEfficiency(3,0); //eff= step1/step0
+  fEffGridListProtons->Add(effProtonsStep0Step3);
   gYPt[2] = effProtonsStep0Step3->Project(iRap,iPt);
   fCorrectionListProtons2D->Add(gYPt[2]);
 
@@ -1324,6 +1546,7 @@ Bool_t AliProtonAnalysis::ReadCorrectionContainer(const char* filename) {
 
   //________________________________________//
   //AntiProtons
+  fEffGridListAntiProtons = new TList();
   fCorrectionListAntiProtons2D = new TList(); 
   fEfficiencyListAntiProtons1D = new TList(); 
   fCorrectionListAntiProtons1D = new TList();
@@ -1341,6 +1564,7 @@ Bool_t AliProtonAnalysis::ReadCorrectionContainer(const char* filename) {
                                         "effAntiProtonsStep0Step1",
                                         *corrfwContainerAntiProtons);
   effAntiProtonsStep0Step1->CalculateEfficiency(1,0); //eff= step1/step0
+  fEffGridListAntiProtons->Add(effAntiProtonsStep0Step1);
   gYPt[0] = effAntiProtonsStep0Step1->Project(iRap,iPt);
   fCorrectionListAntiProtons2D->Add(gYPt[0]);
   
@@ -1348,6 +1572,7 @@ Bool_t AliProtonAnalysis::ReadCorrectionContainer(const char* filename) {
                                         "effAntiProtonsStep0Step2",
                                         *corrfwContainerAntiProtons);
   effAntiProtonsStep0Step2->CalculateEfficiency(2,0); //eff= step2/step0
+  fEffGridListAntiProtons->Add(effAntiProtonsStep0Step2);
   gYPt[1] = effAntiProtonsStep0Step2->Project(iRap,iPt);
   fCorrectionListAntiProtons2D->Add(gYPt[1]);
 
@@ -1355,6 +1580,7 @@ Bool_t AliProtonAnalysis::ReadCorrectionContainer(const char* filename) {
                                         "effAntiProtonsStep0Step3",
                                         *corrfwContainerAntiProtons);
   effAntiProtonsStep0Step3->CalculateEfficiency(3,0); //eff= step1/step0
+  fEffGridListAntiProtons->Add(effAntiProtonsStep0Step3);
   gYPt[2] = effAntiProtonsStep0Step3->Project(iRap,iPt);
   fCorrectionListAntiProtons2D->Add(gYPt[2]);
 
@@ -1427,28 +1653,28 @@ void AliProtonAnalysis::InitQA() {
   //2D histograms
   TDirectory *dir2D = gDirectory->mkdir("2D");
   fGlobalQAList->Add(dir2D); dir2D->cd();
-  TH2F *gHistYPtPrimaryProtonsPass = new TH2F("gHistYPtPrimaryProtonsPass",
+  TH2D *gHistYPtPrimaryProtonsPass = new TH2D("gHistYPtPrimaryProtonsPass",
                                              ";y;P_{T} [GeV/c]",
                                              fNBinsY,fMinY,fMaxY,
                                              fNBinsPt,fMinPt,fMaxPt);
   gHistYPtPrimaryProtonsPass->SetStats(kTRUE);
   gHistYPtPrimaryProtonsPass->GetXaxis()->SetTitleColor(1);
   fQA2DList->Add(gHistYPtPrimaryProtonsPass);
-  TH2F *gHistYPtPrimaryAntiProtonsPass = new TH2F("gHistYPtAntiPrimaryProtonsPass",
+  TH2D *gHistYPtPrimaryAntiProtonsPass = new TH2D("gHistYPtAntiPrimaryProtonsPass",
                                                  ";y;P_{T} [GeV/c]",
                                                  fNBinsY,fMinY,fMaxY,
                                                  fNBinsPt,fMinPt,fMaxPt);
   gHistYPtPrimaryAntiProtonsPass->SetStats(kTRUE);
   gHistYPtPrimaryAntiProtonsPass->GetXaxis()->SetTitleColor(1);
   fQA2DList->Add(gHistYPtPrimaryAntiProtonsPass);
-  TH2F *gHistYPtSecondaryProtonsPass = new TH2F("gHistYPtSecondaryAntiProtonsPass",
+  TH2D *gHistYPtSecondaryProtonsPass = new TH2D("gHistYPtSecondaryAntiProtonsPass",
                                                ";y;P_{T} [GeV/c]",
                                                fNBinsY,fMinY,fMaxY,
                                                fNBinsPt,fMinPt,fMaxPt);
   gHistYPtSecondaryProtonsPass->SetStats(kTRUE);
   gHistYPtSecondaryProtonsPass->GetXaxis()->SetTitleColor(1);
   fQA2DList->Add(gHistYPtSecondaryProtonsPass);
-  TH2F *gHistYPtSecondaryAntiAntiProtonsPass = new TH2F("gHistYPtAntiSecondaryAntiProtonsPass",
+  TH2D *gHistYPtSecondaryAntiAntiProtonsPass = new TH2D("gHistYPtAntiSecondaryAntiProtonsPass",
                                                        ";y;P_{T} [GeV/c]",
                                                        fNBinsY,fMinY,fMaxY,
                                                        fNBinsPt,fMinPt,fMaxPt);
@@ -2008,15 +2234,15 @@ void AliProtonAnalysis::RunQA(AliStack *stack, AliESDEvent *fESD) {
        if(IsAccepted(track, stack)) {
          if(label <= stack->GetNprimary()) {
             if(track->Charge() > 0)
-              ((TH2F *)(fQA2DList->At(0)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
+              ((TH2D *)(fQA2DList->At(0)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
             else if(track->Charge() < 0)
-              ((TH2F *)(fQA2DList->At(1)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
+              ((TH2D *)(fQA2DList->At(1)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
           }//primary particles
           else if(label > stack->GetNprimary()) {
             if(track->Charge() > 0)
-              ((TH2F *)(fQA2DList->At(2)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
+              ((TH2D *)(fQA2DList->At(2)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
             else if(track->Charge() < 0)
-              ((TH2F *)(fQA2DList->At(3)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
+              ((TH2D *)(fQA2DList->At(3)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
           }//secondary particles
        }//cuts
       }//proton check
@@ -2039,15 +2265,15 @@ void AliProtonAnalysis::RunQA(AliStack *stack, AliESDEvent *fESD) {
        if(IsAccepted(track, stack)) {
          if(label <= stack->GetNprimary()) {
            if(track->Charge() > 0)
-             ((TH2F *)(fQA2DList->At(0)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
+             ((TH2D *)(fQA2DList->At(0)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
            else if(track->Charge() < 0)
-             ((TH2F *)(fQA2DList->At(1)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
+             ((TH2D *)(fQA2DList->At(1)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
          }//primary particles
          else if(label > stack->GetNprimary()) {
            if(track->Charge() > 0)
-             ((TH2F *)(fQA2DList->At(2)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
+             ((TH2D *)(fQA2DList->At(2)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
            else if(track->Charge() < 0)
-             ((TH2F *)(fQA2DList->At(3)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
+             ((TH2D *)(fQA2DList->At(3)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
          }//secondary particles
        }//cuts
       }//proton check
index 1874804f6038c3fee0fb40b92452e42c0fb78a64..95621d860d4842ce85d57a02fed845965f8ce473 100644 (file)
 //    Origin: Panos Christakoglou, UOA-CERN, Panos.Christakoglou@cern.ch
 //-------------------------------------------------------------------------
 
-#include <TObject.h>
+#include "TObject.h"
 #include "TH1I.h"
 #include "TList.h"
 
 #include "AliPID.h"
 
 class TF1;
-class TH2F;
-class TH1D;
+class TH2D;
+class TH1F;
 
+class AliCFDataGrid;
+class AliCFContainer;
 class AliAODEvent;
 class AliAODtrack;
 class AliESDEvent;
@@ -46,18 +48,25 @@ class AliProtonAnalysis : public TObject {
   void Analyze(AliAODEvent *fAOD);
   void Analyze(AliStack *stack);
   
-  TH2F *GetProtonYPtHistogram() {return fHistYPtProtons;}
-  TH2F *GetAntiProtonYPtHistogram() {return fHistYPtAntiProtons;}
+  AliCFContainer *GetProtonContainer() {return fProtonContainer;}
+  AliCFContainer *GetAntiProtonContainer() {return fAntiProtonContainer;}
+
+  TH2D *GetProtonYPtHistogram() {return fHistYPtProtons;}
+  TH2D *GetAntiProtonYPtHistogram() {return fHistYPtAntiProtons;}
   TH1D *GetProtonYHistogram();
   TH1D *GetAntiProtonYHistogram();
   TH1D *GetProtonPtHistogram();
   TH1D *GetAntiProtonPtHistogram();
+  TH1D *GetProtonCorrectedYHistogram();
+  TH1D *GetAntiProtonCorrectedYHistogram();
+  TH1D *GetProtonCorrectedPtHistogram();
+  TH1D *GetAntiProtonCorrectedPtHistogram();
   TH1D *GetYRatioHistogram();
   TH1D *GetPtRatioHistogram();
   TH1D *GetYAsymmetryHistogram();
   TH1D *GetPtAsymmetryHistogram();
 
-  TH1I *GetEvenHtistogram() {return fHistEvents;}
+  TH1I *GetEventHistogram() {return fHistEvents;}
 
   Int_t   GetNumberOfAnalyzedEvents() {return (Int_t)fHistEvents->GetEntries();} 
   Bool_t  PrintMean(TH1 *hist, Double_t edge);
@@ -80,11 +89,16 @@ class AliProtonAnalysis : public TObject {
     fMaxChi2PerTPCCluster = maxChi2PerTPCCluster;
     fMaxChi2PerTPCClusterFlag = kTRUE;
   }
-  void    SetMaxCov11(Double_t maxCov11) {fMaxCov11 = maxCov11; fMaxCov11Flag = kTRUE;}
-  void    SetMaxCov22(Double_t maxCov22) {fMaxCov22 = maxCov22; fMaxCov22Flag = kTRUE;}
-  void    SetMaxCov33(Double_t maxCov33) {fMaxCov33 = maxCov33; fMaxCov33Flag = kTRUE;}
-  void    SetMaxCov44(Double_t maxCov44) {fMaxCov44 = maxCov44; fMaxCov44Flag = kTRUE;}
-  void    SetMaxCov55(Double_t maxCov55) {fMaxCov55 = maxCov55; fMaxCov55Flag = kTRUE;}
+  void    SetMaxCov11(Double_t maxCov11) {
+    fMaxCov11 = maxCov11; fMaxCov11Flag = kTRUE;}
+  void    SetMaxCov22(Double_t maxCov22) {
+    fMaxCov22 = maxCov22; fMaxCov22Flag = kTRUE;}
+  void    SetMaxCov33(Double_t maxCov33) {
+    fMaxCov33 = maxCov33; fMaxCov33Flag = kTRUE;}
+  void    SetMaxCov44(Double_t maxCov44) {
+    fMaxCov44 = maxCov44; fMaxCov44Flag = kTRUE;}
+  void    SetMaxCov55(Double_t maxCov55) {
+    fMaxCov55 = maxCov55; fMaxCov55Flag = kTRUE;}
   void    SetMaxSigmaToVertex(Double_t maxSigmaToVertex) {
     fMaxSigmaToVertex = maxSigmaToVertex;
     fMaxSigmaToVertexFlag = kTRUE;
@@ -114,17 +128,18 @@ class AliProtonAnalysis : public TObject {
   }
   void SetQAYPtBins(Int_t nbinsY, Double_t minY, Double_t maxY,
                    Int_t nbinsPt, Double_t minPt, Double_t maxPt) {
-      fNBinsY = nbinsY;
-      fMinY = minY; fMaxY = maxY;
-      fNBinsPt = nbinsPt;
-      fMinPt = minPt; fMaxPt = maxPt;
-    }
+    fNBinsY = nbinsY;
+    fMinY = minY; fMaxY = maxY;
+    fNBinsPt = nbinsPt;
+    fMinPt = minPt; fMaxPt = maxPt;
+  }
   void InitQA();
   void RunQA(AliStack *stack, AliESDEvent *esd);
   TList *GetGlobalQAList() {return fGlobalQAList;}
 
   //Prior probabilities
-  void SetPriorProbabilities(Double_t *partFrac) {for(Int_t i = 0; i < AliPID::kSPECIESN; i++) fPartFrac[i] = partFrac[i];} 
+  void SetPriorProbabilities(Double_t *partFrac) {
+    for(Int_t i = 0; i < AliPID::kSPECIESN; i++) fPartFrac[i] = partFrac[i];} 
   void SetPriorProbabilityFunctions(TF1 *felectron, TF1 *fmuon, TF1 *fpion, TF1 *fkaon, TF1 *fproton) {
     fFunctionProbabilityFlag = kTRUE;
     fElectronFunction = felectron; 
@@ -136,6 +151,7 @@ class AliProtonAnalysis : public TObject {
   Double_t GetParticleFraction(Int_t i, Double_t p);
 
   //interface to the correction framework
+  void Correct(Int_t step);
   Bool_t ReadCorrectionContainer(const char* filename);
   TList *GetCorrectionListProtons2D() {return fCorrectionListProtons2D;} 
   TList *GetEfficiencyListProtons1D() {return fEfficiencyListProtons1D;} 
@@ -197,18 +213,25 @@ class AliProtonAnalysis : public TObject {
   //Detectors
   Bool_t fUseTPCOnly; //kTRUE if TPC only information is used
 
+  //Analysis containers
+  AliCFContainer *fProtonContainer; //container for protons
+  AliCFContainer *fAntiProtonContainer; //container for antiprotons
   TH1I *fHistEvents; //event counter
-  TH2F *fHistYPtProtons; //Y-Pt of Protons
-  TH2F *fHistYPtAntiProtons; // Y-Pt of Antiprotons
+  TH2D *fHistYPtProtons; //Y-Pt of Protons
+  TH2D *fHistYPtAntiProtons; // Y-Pt of Antiprotons
 
   //Corrections
+  TList *fEffGridListProtons; //list for the efficiency grid - protons 
   TList *fCorrectionListProtons2D; //list for the 2d corrections 
   TList *fEfficiencyListProtons1D; //list for the 1d efficiencies
   TList *fCorrectionListProtons1D; //list for the 1d corrections 
+  TList *fEffGridListAntiProtons; //list for the efficiency grid - antiprotons 
   TList *fCorrectionListAntiProtons2D; //list for the 2d corrections 
   TList *fEfficiencyListAntiProtons1D; //list for the 1d efficiencies
   TList *fCorrectionListAntiProtons1D; //list for the 1d corrections 
-  
+  AliCFDataGrid *fCorrectProtons; //corrected data grid for protons
+  AliCFDataGrid *fCorrectAntiProtons; //corrected data grid for antiprotons
+
   ClassDef(AliProtonAnalysis,0);
 };
 
index d0fea9d7ed14387201ed0aa98c128843490f1746..561db1a3872a9334c548623f1c7c83e599fea7c3 100644 (file)
@@ -49,6 +49,12 @@ void runLocal() {
   setupPar("ANALYSISalice");
   gSystem->Load("libANALYSISalice.so");
 
+  //__________________________________________________//
+  //___________Setting up CORRFW.par__________________//
+  //__________________________________________________//
+  gProof->UploadPackage("CORRFW.par");
+  gProof->EnablePackage("CORRFW");
+
   //____________________________________________________________//
   //_____________Setting up PWG2spectra.par_____________________//
   //____________________________________________________________//
@@ -93,9 +99,11 @@ void runLocal() {
 
   // Create containers for input/output                                                                              
   AliAnalysisDataContainer *cinput1 = mgr->CreateContainer("dataChain",
-                                                           TChain::Class(),AliAnalysisManager::kInputContainer);
+                                                           TChain::Class(),
+                                                          AliAnalysisManager::kInputContainer);
   AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("outputList1",
-                                                            TList::Class(),AliAnalysisManager::kOutputCont
+                                                            TList::Class(),
+                                                           AliAnalysisManager::kOutputCont
                                                             "Protons.ESD.root");
 
   //____________________________________________//
@@ -149,6 +157,12 @@ void runInteractive() {
   setupPar("ANALYSISalice");
   gSystem->Load("libANALYSISalice.so");
 
+  //__________________________________________________//
+  //___________Setting up CORRFW.par__________________//
+  //__________________________________________________//
+  gProof->UploadPackage("CORRFW.par");
+  gProof->EnablePackage("CORRFW");
+
   //____________________________________________________________//
   //_____________Setting up PWG2spectra.par_____________________//
   //____________________________________________________________//
@@ -196,9 +210,11 @@ void runInteractive() {
 
   // Create containers for input/output                                                                               
   AliAnalysisDataContainer *cinput1 = mgr->CreateContainer("dataChain",
-                                                           TChain::Class(),AliAnalysisManager::kInputContainer);
+                                                           TChain::Class(),
+                                                          AliAnalysisManager::kInputContainer);
   AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("outputList1",
-                                                            TList::Class(),AliAnalysisManager::kOutputCont
+                                                            TList::Class(),
+                                                           AliAnalysisManager::kOutputCont
                                                             "Protons.ESD.root");
   
   //____________________________________________//
@@ -309,7 +325,9 @@ void runBatch() {
 }
 
 //_________________________________________________//
-void runProof(const char* mode = "ESD", Int_t stats = 0, const char* dataset = 0x0) {
+void runProof(const char* mode = "ESD", 
+             Int_t stats = 0, 
+             const char* dataset = 0x0) {
   TStopwatch timer;
   timer.Start();
   
@@ -332,6 +350,8 @@ void runProof(const char* mode = "ESD", Int_t stats = 0, const char* dataset = 0
   gProof->EnablePackage("ANALYSIS");
   gProof->UploadPackage("ANALYSISalice.par");
   gProof->EnablePackage("ANALYSISalice");
+  gProof->UploadPackage("CORRFW.par");
+  gProof->EnablePackage("CORRFW");
   gProof->UploadPackage("PWG2spectra.par");
   gProof->EnablePackage("PWG2spectra");
   
@@ -365,9 +385,11 @@ void runProof(const char* mode = "ESD", Int_t stats = 0, const char* dataset = 0
 
   // Create containers for input/output
   AliAnalysisDataContainer *cinput1 = mgr->CreateContainer("dataChain",
-                                                          TChain::Class(),AliAnalysisManager::kInputContainer);
+                                                          TChain::Class(),
+                                                          AliAnalysisManager::kInputContainer);
   AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("outputList1", 
-                                                           TList::Class(),AliAnalysisManager::kOutputContainer,
+                                                           TList::Class(),
+                                                           AliAnalysisManager::kOutputContainer,
                                                            outputFilename.Data());
 
   //____________________________________________//
index 57d5209a71f86ab8ca6b50ffe9f747df92621227..881cfe23d030b4792bd4a1d14e23341fc0bc7064 100755 (executable)
@@ -70,14 +70,12 @@ Bool_t runProtonCorrection(Int_t stats = 0, const char* dataset = 0x0) {
   for(Int_t i=0; i<=nbin1; i++) binLim1[i]=(Double_t)ymin  + (ymax-ymin)  /nbin1*(Double_t)i;
   for(Int_t i=0; i<=nbin2; i++) binLim2[i]=(Double_t)ptmin + (ptmax-ptmin)/nbin2*(Double_t)i; 
   //CF container for protons
-  AliCFContainer* containerProtons = new AliCFContainer("containerProtons","container for protons",
-                                                       nstep,nvar,iBin);
+  AliCFContainer* containerProtons = new AliCFContainer("containerProtons","container for protons",nstep,nvar,iBin);
   //setting the bin limits
   containerProtons->SetBinLimits(iy,binLim1);
   containerProtons->SetBinLimits(ipT,binLim2);
- //CF container for protons
-  AliCFContainer* containerAntiProtons = new AliCFContainer("containerAntiProtons","container for antiprotons",
-                                                           nstep,nvar,iBin);
+ //CF container for antiprotons
+  AliCFContainer* containerAntiProtons = new AliCFContainer("containerAntiProtons","container for antiprotons",nstep,nvar,iBin);
   //setting the bin limits
   containerAntiProtons->SetBinLimits(iy,binLim1);
   containerAntiProtons->SetBinLimits(ipT,binLim2);