Corrections/container for antiprotons
authorpchrist <pchrist@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 5 Aug 2008 09:36:51 +0000 (09:36 +0000)
committerpchrist <pchrist@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 5 Aug 2008 09:36:51 +0000 (09:36 +0000)
PWG2/AliProtonCorrectionTask.cxx
PWG2/AliProtonCorrectionTask.h
PWG2/runProtonCorrection.C

index 08f408d..2848262 100644 (file)
@@ -50,7 +50,8 @@ ClassImp(AliProtonCorrectionTask)
 AliProtonCorrectionTask::AliProtonCorrectionTask() :
   fReadTPCTracks(0),
   fReadAODData(0),
-  fCFManager(0x0),
+  fCFManagerProtons(0x0),
+  fCFManagerAntiProtons(0x0),
   fQAHistList(0x0),
   fHistEventsProcessed(0x0)
 {
@@ -63,7 +64,8 @@ AliProtonCorrectionTask::AliProtonCorrectionTask(const Char_t* name) :
   AliAnalysisTaskSE(name),
   fReadTPCTracks(0),
   fReadAODData(0),
-  fCFManager(0x0),
+  fCFManagerProtons(0x0),
+  fCFManagerAntiProtons(0x0),
   fQAHistList(0x0),
   fHistEventsProcessed(0x0) {
   //
@@ -77,7 +79,8 @@ AliProtonCorrectionTask::AliProtonCorrectionTask(const Char_t* name) :
   */
   DefineOutput(1,TH1I::Class());
   DefineOutput(2,AliCFContainer::Class());
-  DefineOutput(3,TList::Class());
+  DefineOutput(3,AliCFContainer::Class());
+  DefineOutput(4,TList::Class());
 }
 
 //___________________________________________________________________________
@@ -89,7 +92,8 @@ AliProtonCorrectionTask& AliProtonCorrectionTask::operator=(const AliProtonCorre
     AliAnalysisTaskSE::operator=(c) ;
     fReadTPCTracks = c.fReadTPCTracks ;
     fReadAODData = c.fReadAODData ;
-    fCFManager  = c.fCFManager;
+    fCFManagerProtons  = c.fCFManagerProtons;
+    fCFManagerAntiProtons  = c.fCFManagerAntiProtons;
     fQAHistList = c.fQAHistList ;
     fHistEventsProcessed = c.fHistEventsProcessed;
   }
@@ -101,7 +105,8 @@ AliProtonCorrectionTask::AliProtonCorrectionTask(const AliProtonCorrectionTask&
   AliAnalysisTaskSE(c),
   fReadTPCTracks(c.fReadTPCTracks),
   fReadAODData(c.fReadAODData),
-  fCFManager(c.fCFManager),
+  fCFManagerProtons(c.fCFManagerProtons),
+  fCFManagerAntiProtons(c.fCFManagerAntiProtons),
   fQAHistList(c.fQAHistList),
   fHistEventsProcessed(c.fHistEventsProcessed) {
   //
@@ -115,7 +120,8 @@ AliProtonCorrectionTask::~AliProtonCorrectionTask() {
   //destructor
   //
   Info("~AliProtonCorrectionTask","Calling Destructor");
-  if (fCFManager)           delete fCFManager ;
+  if (fCFManagerProtons) delete fCFManagerProtons ;
+  if (fCFManagerAntiProtons) delete fCFManagerAntiProtons ;
   if (fHistEventsProcessed) delete fHistEventsProcessed ;
   if (fQAHistList) {fQAHistList->Clear(); delete fQAHistList;}
 }
@@ -138,31 +144,95 @@ void AliProtonCorrectionTask::UserExec(Option_t *) {
   if (!fMCEvent) Error("UserExec","NO MC INFO FOUND");
   
   //pass the MC evt handler to the cuts that need it 
-  fCFManager->SetEventInfo(fMCEvent);
+  fCFManagerProtons->SetEventInfo(fMCEvent);
+  fCFManagerAntiProtons->SetEventInfo(fMCEvent);
 
   // MC-event selection
   Double_t containerInput[2] ;
         
+  //__________________________________________________________//
   //loop on the MC event
   for (Int_t ipart=0; ipart<fMCEvent->GetNumberOfTracks(); ipart++) { 
     AliMCParticle *mcPart  = fMCEvent->GetTrack(ipart);
 
     //check the MC-level cuts
-    if (!fCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,mcPart)) continue;
+    if (!fCFManagerProtons->CheckParticleCuts(AliCFManager::kPartGenCuts,mcPart)) continue;
     
     containerInput[0] = Rapidity(mcPart->Px(),
                                 mcPart->Py(),
                                 mcPart->Pz());
     containerInput[1] = (Float_t)mcPart->Pt();
     //fill the container for Gen-level selection
-    fCFManager->GetParticleContainer()->Fill(containerInput,kStepGenerated);
+    fCFManagerProtons->GetParticleContainer()->Fill(containerInput,kStepGenerated);
 
     //check the Acceptance-level cuts
-    if (!fCFManager->CheckParticleCuts(AliCFManager::kPartAccCuts,mcPart)) continue;
+    if (!fCFManagerProtons->CheckParticleCuts(AliCFManager::kPartAccCuts,mcPart)) continue;
     //fill the container for Acceptance-level selection
-    fCFManager->GetParticleContainer()->Fill(containerInput,kStepReconstructible);
-  }//loop over MC particles
+    fCFManagerProtons->GetParticleContainer()->Fill(containerInput,kStepReconstructible);
+  }//loop over MC particles (protons)
+  //__________________________________________________________//
+  //loop on the MC event
+  for (Int_t ipart=0; ipart<fMCEvent->GetNumberOfTracks(); ipart++) { 
+    AliMCParticle *mcPart  = fMCEvent->GetTrack(ipart);
+
+    //check the MC-level cuts
+    if (!fCFManagerAntiProtons->CheckParticleCuts(AliCFManager::kPartGenCuts,mcPart)) continue;
+    
+    containerInput[0] = Rapidity(mcPart->Px(),
+                                mcPart->Py(),
+                                mcPart->Pz());
+    containerInput[1] = (Float_t)mcPart->Pt();
+    //fill the container for Gen-level selection
+    fCFManagerAntiProtons->GetParticleContainer()->Fill(containerInput,kStepGenerated);
+
+    //check the Acceptance-level cuts
+    if (!fCFManagerAntiProtons->CheckParticleCuts(AliCFManager::kPartAccCuts,mcPart)) continue;
+    //fill the container for Acceptance-level selection
+    fCFManagerAntiProtons->GetParticleContainer()->Fill(containerInput,kStepReconstructible);
+  }//loop over MC particles (antiprotons)
+
+  //__________________________________________________________//
+  //ESD track loop
+  for (Int_t iTrack = 0; iTrack<fEvent->GetNumberOfTracks(); iTrack++) {
+    track = fEvent->GetTrack(iTrack);
+    
+    if (fReadTPCTracks) {
+      if (fReadAODData) {
+       Error("UserExec","TPC-only tracks are not supported with AOD");
+       return ;
+      }
+      AliESDtrack* esdTrack    = (AliESDtrack*) track;
+      AliESDtrack* esdTrackTPC = new AliESDtrack();
+      if (!esdTrack->FillTPCOnlyTrack(*esdTrackTPC)) {
+       Error("UserExec","Could not retrieve TPC info");
+       continue;
+      }
+      track = esdTrackTPC ;
+    }
 
+    if (!fCFManagerProtons->CheckParticleCuts(AliCFManager::kPartRecCuts,track)) continue;
+    
+    // is track associated to particle ?
+    Int_t label = track->GetLabel();
+    if (label<0) continue;
+    AliMCParticle *mcPart  = fMCEvent->GetTrack(label);
+    
+    // check if this track was part of the signal
+    if (!fCFManagerProtons->CheckParticleCuts(AliCFManager::kPartGenCuts,mcPart)) continue; 
+    
+    //fill the container
+    containerInput[0] = Rapidity(track->Px(),
+                                 track->Py(),
+                                 track->Pz());
+    containerInput[1] = track->Pt();
+    fCFManagerProtons->GetParticleContainer()->Fill(containerInput,kStepReconstructed) ;   
+
+    if (!fCFManagerProtons->CheckParticleCuts(AliCFManager::kPartSelCuts,track)) continue ;
+    fCFManagerProtons->GetParticleContainer()->Fill(containerInput,kStepSelected);
+
+    if (fReadTPCTracks) delete track;
+  }
+  //__________________________________________________________//
   //ESD track loop
   for (Int_t iTrack = 0; iTrack<fEvent->GetNumberOfTracks(); iTrack++) {
     track = fEvent->GetTrack(iTrack);
@@ -181,7 +251,7 @@ void AliProtonCorrectionTask::UserExec(Option_t *) {
       track = esdTrackTPC ;
     }
 
-    if (!fCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,track)) continue;
+    if (!fCFManagerAntiProtons->CheckParticleCuts(AliCFManager::kPartRecCuts,track)) continue;
     
     // is track associated to particle ?
     Int_t label = track->GetLabel();
@@ -189,17 +259,17 @@ void AliProtonCorrectionTask::UserExec(Option_t *) {
     AliMCParticle *mcPart  = fMCEvent->GetTrack(label);
     
     // check if this track was part of the signal
-    if (!fCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,mcPart)) continue; 
+    if (!fCFManagerAntiProtons->CheckParticleCuts(AliCFManager::kPartGenCuts,mcPart)) continue; 
     
     //fill the container
     containerInput[0] = Rapidity(track->Px(),
                                  track->Py(),
                                  track->Pz());
     containerInput[1] = track->Pt();
-    fCFManager->GetParticleContainer()->Fill(containerInput,kStepReconstructed) ;   
+    fCFManagerAntiProtons->GetParticleContainer()->Fill(containerInput,kStepReconstructed) ;   
 
-    if (!fCFManager->CheckParticleCuts(AliCFManager::kPartSelCuts,track)) continue ;
-    fCFManager->GetParticleContainer()->Fill(containerInput,kStepSelected);
+    if (!fCFManagerAntiProtons->CheckParticleCuts(AliCFManager::kPartSelCuts,track)) continue ;
+    fCFManagerAntiProtons->GetParticleContainer()->Fill(containerInput,kStepSelected);
 
     if (fReadTPCTracks) delete track;
   }
@@ -208,8 +278,9 @@ void AliProtonCorrectionTask::UserExec(Option_t *) {
 
   /* PostData(0) is taken care of by AliAnalysisTaskSE */
   PostData(1,fHistEventsProcessed) ;
-  PostData(2,fCFManager->GetParticleContainer()) ;
-  PostData(3,fQAHistList) ;
+  PostData(2,fCFManagerProtons->GetParticleContainer()) ;
+  PostData(3,fCFManagerAntiProtons->GetParticleContainer()) ;
+  PostData(4,fQAHistList) ;
 }
 
 
@@ -236,48 +307,17 @@ void AliProtonCorrectionTask::Terminate(Option_t*) {
   TH1D* h12 =   cont->ShowProjection(1,2) ;
   TH1D* h13 =   cont->ShowProjection(1,3) ;
 
-  //Double_t max1 = h00->GetMaximum();
-  //Double_t max2 = h10->GetMaximum();
-
-  /*h00->GetYaxis()->SetRangeUser(0,max1*1.2);
-  h01->GetYaxis()->SetRangeUser(0,max1*1.2);
-  h02->GetYaxis()->SetRangeUser(0,max1*1.2);
-  h03->GetYaxis()->SetRangeUser(0,max1*1.2);
-
-  h10->GetYaxis()->SetRangeUser(0,max2*1.2);
-  h11->GetYaxis()->SetRangeUser(0,max2*1.2);
-  h12->GetYaxis()->SetRangeUser(0,max2*1.2);
-  h13->GetYaxis()->SetRangeUser(0,max2*1.2);
-
-  h00->SetMarkerStyle(23) ;
-  h01->SetMarkerStyle(24) ;
-  h02->SetMarkerStyle(25) ;
-  h03->SetMarkerStyle(26) ;
-
-  h10->SetMarkerStyle(23) ;
-  h11->SetMarkerStyle(24) ;
-  h12->SetMarkerStyle(25) ;
-  h13->SetMarkerStyle(26) ;*/
-
   TCanvas * c =new TCanvas("c","",1400,800);
   c->Divide(4,2);
 
-  c->cd(1);
-  h00->Draw("p");
-  c->cd(2);
-  h01->Draw("p");
-  c->cd(3);
-  h02->Draw("p");
-  c->cd(4);
-  h03->Draw("p");
-  c->cd(5);
-  h10->Draw("p");
-  c->cd(6);
-  h11->Draw("p");
-  c->cd(7);
-  h12->Draw("p");
-  c->cd(8);
-  h13->Draw("p");
+  c->cd(1); h00->Draw("p");
+  c->cd(2); h01->Draw("p");
+  c->cd(3); h02->Draw("p");
+  c->cd(4); h03->Draw("p");
+  c->cd(5); h10->Draw("p");
+  c->cd(6); h11->Draw("p");
+  c->cd(7); h12->Draw("p");
+  c->cd(8); h13->Draw("p");
 
   c->SaveAs("plots.eps");
 }
index f860013..d18ab66 100644 (file)
@@ -52,8 +52,10 @@ class AliProtonCorrectionTask : public AliAnalysisTaskSE {
   void     Terminate(Option_t *);
   
   // CORRECTION FRAMEWORK RELATED FUNCTIONS
-  void           SetCFManager(AliCFManager* io) {fCFManager = io;}   // global correction manager
-  AliCFManager * GetCFManager() const {return fCFManager;}           // 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
@@ -65,10 +67,11 @@ class AliProtonCorrectionTask : public AliAnalysisTaskSE {
  protected:
   Double_t Rapidity(Double_t px, Double_t py, Double_t pz);
 
-  Bool_t          fReadTPCTracks ; // flag to loop on TPC tracks only
-  Bool_t          fReadAODData ;   // flag for AOD/ESD input files
-  AliCFManager   *fCFManager    ;  // pointer to the CF manager
-  TList          *fQAHistList   ;  // list of QA histograms
+  Bool_t          fReadTPCTracks;         // flag to loop on TPC tracks only
+  Bool_t          fReadAODData;           // flag for AOD/ESD input files
+  AliCFManager   *fCFManagerProtons;      // pointer to the CF manager
+  AliCFManager   *fCFManagerAntiProtons;  // pointer to the CF manager
+  TList          *fQAHistList;            // list of QA histograms
 
   // Histograms
   //Number of events
index a4d7d43..57d5209 100755 (executable)
@@ -69,11 +69,18 @@ Bool_t runProtonCorrection(Int_t stats = 0, const char* dataset = 0x0) {
   //values for bin lower bounds
   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; 
-  //one "container" for MC
-  AliCFContainer* container = new AliCFContainer("container","container for tracks",nstep,nvar,iBin);
+  //CF container for protons
+  AliCFContainer* containerProtons = new AliCFContainer("containerProtons","container for protons",
+                                                       nstep,nvar,iBin);
   //setting the bin limits
-  container -> SetBinLimits(iy,binLim1);
-  container -> SetBinLimits(ipT,binLim2);
+  containerProtons->SetBinLimits(iy,binLim1);
+  containerProtons->SetBinLimits(ipT,binLim2);
+ //CF container for protons
+  AliCFContainer* containerAntiProtons = new AliCFContainer("containerAntiProtons","container for antiprotons",
+                                                           nstep,nvar,iBin);
+  //setting the bin limits
+  containerAntiProtons->SetBinLimits(iy,binLim1);
+  containerAntiProtons->SetBinLimits(ipT,binLim2);
 
   //________________________________________//
   // SET TLIST FOR QA HISTOS
@@ -81,8 +88,10 @@ Bool_t runProtonCorrection(Int_t stats = 0, const char* dataset = 0x0) {
   //Cuts
   const Int_t    mintrackrefsTPC = 2;
   const Int_t    mintrackrefsITS = 3;
-  const Int_t    charge  = 1;
-  const Int_t    PDG = 2212; 
+  const Int_t    chargeProtons  = 1;
+  const Int_t    PDGProtons = 2212; 
+  const Int_t    chargeAntiProtons  = -1;
+  const Int_t    PDGAntiProtons = -2212; 
 
   const Int_t    minclustersTPC = 50;
   const Float_t  maxChi2PerTPCCluster = 3.5;
@@ -97,32 +106,51 @@ Bool_t runProtonCorrection(Int_t stats = 0, const char* dataset = 0x0) {
   const Float_t  maxSigmaToVertex = 2.5;
 
   // Gen-Level kinematic cuts
-  AliCFTrackKineCuts *mcKineCuts = new AliCFTrackKineCuts("mcKineCuts","MC-level kinematic cuts");
-  mcKineCuts->SetPtRange(ptmin,ptmax);
-  mcKineCuts->SetRapidityRange(ymin,ymax);
-  mcKineCuts->SetChargeMC(charge);
-  mcKineCuts->SetQAOn(qaList);
+  AliCFTrackKineCuts *mcKineCutsProtons = new AliCFTrackKineCuts("mcKineCutsProtons",
+                                                                "MC-level kinematic cuts");
+  mcKineCutsProtons->SetPtRange(ptmin,ptmax);
+  mcKineCutsProtons->SetRapidityRange(ymin,ymax);
+  mcKineCutsProtons->SetChargeMC(chargeProtons);
+  mcKineCutsProtons->SetQAOn(qaList);
+
+  AliCFTrackKineCuts *mcKineCutsAntiProtons = new AliCFTrackKineCuts("mcKineCutsAntiProtons",
+                                                                    "MC-level kinematic cuts");
+  mcKineCutsAntiProtons->SetPtRange(ptmin,ptmax);
+  mcKineCutsAntiProtons->SetRapidityRange(ymin,ymax);
+  mcKineCutsAntiProtons->SetChargeMC(chargeAntiProtons);
+  mcKineCutsAntiProtons->SetQAOn(qaList);
 
   //Particle-Level cuts:  
-  AliCFParticleGenCuts* mcGenCuts = new AliCFParticleGenCuts("mcGenCuts","MC particle generation cuts");
+  AliCFParticleGenCuts* mcGenCuts = new AliCFParticleGenCuts("mcGenCuts",
+                                                            "MC particle generation cuts");
   mcGenCuts->SetRequireIsPrimary();
-  mcGenCuts->SetRequirePdgCode(PDG);
+  mcGenCuts->SetRequirePdgCode(PDGProtons);
   mcGenCuts->SetQAOn(qaList);
 
   //Acceptance Cuts
-  AliCFAcceptanceCuts *mcAccCuts = new AliCFAcceptanceCuts("mcAccCuts","MC acceptance cuts");
+  AliCFAcceptanceCuts *mcAccCuts = new AliCFAcceptanceCuts("mcAccCuts",
+                                                          "MC acceptance cuts");
   mcAccCuts->SetMinNHitITS(mintrackrefsITS);
   mcAccCuts->SetMinNHitTPC(mintrackrefsTPC);
   mcAccCuts->SetQAOn(qaList);
 
   // Rec-Level kinematic cuts
-  AliCFTrackKineCuts *recKineCuts = new AliCFTrackKineCuts("recKineCuts","rec-level kine cuts");
-  recKineCuts->SetPtRange(ptmin,ptmax);
-  recKineCuts->SetRapidityRange(ymin,ymax);
-  recKineCuts->SetChargeRec(charge);
-  recKineCuts->SetQAOn(qaList);
+  AliCFTrackKineCuts *recKineCutsProtons = new AliCFTrackKineCuts("recKineCutsProtons",
+                                                                 "rec-level kine cuts");
+  recKineCutsProtons->SetPtRange(ptmin,ptmax);
+  recKineCutsProtons->SetRapidityRange(ymin,ymax);
+  recKineCutsProtons->SetChargeRec(chargeProtons);
+  recKineCutsProtons->SetQAOn(qaList);
+
+  AliCFTrackKineCuts *recKineCutsAntiProtons = new AliCFTrackKineCuts("recKineCutsAntiProtons",
+                                                                     "rec-level kine cuts");
+  recKineCutsAntiProtons->SetPtRange(ptmin,ptmax);
+  recKineCutsAntiProtons->SetRapidityRange(ymin,ymax);
+  recKineCutsAntiProtons->SetChargeRec(chargeAntiProtons);
+  recKineCutsAntiProtons->SetQAOn(qaList);
 
-  AliCFTrackQualityCuts *recQualityCuts = new AliCFTrackQualityCuts("recQualityCuts","rec-level quality cuts");
+  AliCFTrackQualityCuts *recQualityCuts = new AliCFTrackQualityCuts("recQualityCuts",
+                                                                   "rec-level quality cuts");
   recQualityCuts->SetMinNClusterTPC(minclustersTPC);
   recQualityCuts->SetMaxChi2PerClusterTPC(maxChi2PerTPCCluster);
   recQualityCuts->SetMaxCovDiagonalElements(maxCov11,maxCov22,maxCov33,maxCov44,maxCov55);
@@ -131,7 +159,8 @@ Bool_t runProtonCorrection(Int_t stats = 0, const char* dataset = 0x0) {
   //recQualityCuts->SetRequireITSRefit(kTRUE);
   recQualityCuts->SetQAOn(qaList);
 
-  AliCFTrackIsPrimaryCuts *recIsPrimaryCuts = new AliCFTrackIsPrimaryCuts("recIsPrimaryCuts","rec-level isPrimary cuts");
+  AliCFTrackIsPrimaryCuts *recIsPrimaryCuts = new AliCFTrackIsPrimaryCuts("recIsPrimaryCuts",
+                                                                         "rec-level isPrimary cuts");
   recIsPrimaryCuts->SetMaxNSigmaToVertex(maxSigmaToVertex);
   recIsPrimaryCuts->SetQAOn(qaList);
 
@@ -152,19 +181,26 @@ Bool_t runProtonCorrection(Int_t stats = 0, const char* dataset = 0x0) {
   cutPID->SetQAOn(qaList);
 
   //________________________________________// 
-  TObjArray* mcList = new TObjArray(0);
-  mcList->AddLast(mcKineCuts);
-  mcList->AddLast(mcGenCuts);
+  TObjArray* mcListProtons = new TObjArray(0);
+  mcListProtons->AddLast(mcKineCutsProtons);
+  mcListProtons->AddLast(mcGenCuts);
+  TObjArray* mcListAntiProtons = new TObjArray(0);
+  mcListAntiProtons->AddLast(mcKineCutsAntiProtons);
+  mcListAntiProtons->AddLast(mcGenCuts);
 
   printf("CREATE ACCEPTANCE CUTS\n");
   TObjArray* accList = new TObjArray(0);
   accList->AddLast(mcAccCuts);
 
   printf("CREATE RECONSTRUCTION CUTS\n");
-  TObjArray* recList = new TObjArray(0);
-  recList->AddLast(recKineCuts);
-  recList->AddLast(recQualityCuts);
-  recList->AddLast(recIsPrimaryCuts);
+  TObjArray* recListProtons = new TObjArray(0);
+  recListProtons->AddLast(recKineCutsProtons);
+  recListProtons->AddLast(recQualityCuts);
+  recListProtons->AddLast(recIsPrimaryCuts);
+  TObjArray* recListAntiProtons = new TObjArray(0);
+  recListAntiProtons->AddLast(recKineCutsAntiProtons);
+  recListAntiProtons->AddLast(recQualityCuts);
+  recListAntiProtons->AddLast(recIsPrimaryCuts);
 
   printf("CREATE PID CUTS\n");
   TObjArray* fPIDCutList = new TObjArray(0);
@@ -172,17 +208,25 @@ Bool_t runProtonCorrection(Int_t stats = 0, const char* dataset = 0x0) {
 
   //________________________________________// 
   //CREATE THE INTERFACE TO CORRECTION FRAMEWORK USED IN THE TASK
-  AliCFManager* man = new AliCFManager();
-  man->SetParticleContainer(container);
-  man->SetParticleCutsList(AliCFManager::kPartGenCuts,mcList);
-  man->SetParticleCutsList(AliCFManager::kPartAccCuts,accList);
-  man->SetParticleCutsList(AliCFManager::kPartRecCuts,recList);
-  man->SetParticleCutsList(AliCFManager::kPartSelCuts,fPIDCutList);
+  AliCFManager* manProtons = new AliCFManager();
+  manProtons->SetParticleContainer(containerProtons);
+  manProtons->SetParticleCutsList(AliCFManager::kPartGenCuts,mcListProtons);
+  manProtons->SetParticleCutsList(AliCFManager::kPartAccCuts,accList);
+  manProtons->SetParticleCutsList(AliCFManager::kPartRecCuts,recListProtons);
+  manProtons->SetParticleCutsList(AliCFManager::kPartSelCuts,fPIDCutList);
+
+  AliCFManager* manAntiProtons = new AliCFManager();
+  manAntiProtons->SetParticleContainer(containerAntiProtons);
+  manAntiProtons->SetParticleCutsList(AliCFManager::kPartGenCuts,mcListAntiProtons);
+  manAntiProtons->SetParticleCutsList(AliCFManager::kPartAccCuts,accList);
+  manAntiProtons->SetParticleCutsList(AliCFManager::kPartRecCuts,recListAntiProtons);
+  manAntiProtons->SetParticleCutsList(AliCFManager::kPartSelCuts,fPIDCutList);
 
   //________________________________________// 
   //CREATE THE TASK
   AliProtonCorrectionTask *task = new AliProtonCorrectionTask("AliProtonCorrectionTask");
-  task->SetCFManager(man); //here is set the CF manager
+  task->SetCFManagerProtons(manProtons); //here is set the CF manager
+  task->SetCFManagerAntiProtons(manAntiProtons); //here is set the CF manager
   task->SetQAList(qaList);
 
   //SETUP THE ANALYSIS MANAGER TO READ INPUT CHAIN AND WRITE DESIRED OUTPUTS
@@ -200,13 +244,23 @@ Bool_t runProtonCorrection(Int_t stats = 0, const char* dataset = 0x0) {
 
   // ----- output data -----
   //slot 0 : default output tree (by default handled by AliAnalysisTaskSE)
-  AliAnalysisDataContainer *coutput0 = mgr->CreateContainer("ctree0", TTree::Class(),AliAnalysisManager::kOutputContainer,"output.root");
+  AliAnalysisDataContainer *coutput0 = mgr->CreateContainer("ctree0", TTree::Class(),
+                                                           AliAnalysisManager::kOutputContainer,"corrections.root");
   // output TH1I for event counting
-  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("chist0", TH1I::Class(),AliAnalysisManager::kOutputContainer,"output.root");
+  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("chist0", TH1I::Class(),
+                                                           AliAnalysisManager::kOutputContainer,"corrections.root");
+  // output Correction Framework Container (for acceptance & efficiency calculations)
+  AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("ccontainer0", 
+                                                           AliCFContainer::Class(),
+                                                           AliAnalysisManager::kOutputContainer,"corrections.root");
   // output Correction Framework Container (for acceptance & efficiency calculations)
-  AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("ccontainer0", AliCFContainer::Class(),AliAnalysisManager::kOutputContainer,"output.root");
+  AliAnalysisDataContainer *coutput3 = mgr->CreateContainer("ccontainer1", 
+                                                           AliCFContainer::Class(),
+                                                           AliAnalysisManager::kOutputContainer,"corrections.root");
   // output QA histograms 
-  AliAnalysisDataContainer *coutput3 = mgr->CreateContainer("clist0", TList::Class(),AliAnalysisManager::kOutputContainer,"output.root");
+  AliAnalysisDataContainer *coutput4 = mgr->CreateContainer("clist0", 
+                                                           TList::Class(),
+                                                           AliAnalysisManager::kOutputContainer,"corrections.root");
   
   mgr->AddTask(task);
   mgr->ConnectInput(task,0,cinput0);
@@ -214,6 +268,7 @@ Bool_t runProtonCorrection(Int_t stats = 0, const char* dataset = 0x0) {
   mgr->ConnectOutput(task,1,coutput1);
   mgr->ConnectOutput(task,2,coutput2);
   mgr->ConnectOutput(task,3,coutput3);
+  mgr->ConnectOutput(task,4,coutput4);
 
   //________________________________________// 
   if (mgr->InitAnalysis()) {