more methods use the correction framework
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 5 Aug 2008 14:06:59 +0000 (14:06 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 5 Aug 2008 14:06:59 +0000 (14:06 +0000)
PWG2/FLOW/AliAnalysisTaskLYZEventPlane.cxx
PWG2/FLOW/AliAnalysisTaskLYZEventPlane.h
PWG2/FLOW/AliAnalysisTaskMCEventPlane.cxx
PWG2/FLOW/AliAnalysisTaskMCEventPlane.h
PWG2/FLOW/AliFlowAnalysisWithLYZEventPlane.cxx
PWG2/FLOW/AliFlowAnalysisWithLYZEventPlane.h
PWG2/FLOW/AliFlowAnalysisWithMCEventPlane.cxx
PWG2/FLOW/AliFlowAnalysisWithMCEventPlane.h
PWG2/FLOW/AliFlowLYZEventPlane.cxx
PWG2/FLOW/AliFlowLYZEventPlane.h
PWG2/FLOW/macros/runAliAnalysisTaskFlow.C

index 1e44199..c5a53fa 100644 (file)
@@ -17,6 +17,7 @@
 #include "TChain.h"
 #include "TTree.h"
 #include "TFile.h"
+#include "TList.h"
 
 class AliAnalysisTask;
 #include "AliAnalysisManager.h"
@@ -30,6 +31,8 @@ class AliAnalysisTask;
 #include "AliMCEventHandler.h"
 #include "AliMCEvent.h"
 
+#include "../../CORRFW/AliCFManager.h"
+
 #include "AliAnalysisTaskLYZEventPlane.h"
 #include "AliFlowEventSimpleMaker.h"
 #include "AliFlowLYZEventPlane.h"
@@ -52,7 +55,9 @@ AliAnalysisTaskLYZEventPlane::AliAnalysisTaskLYZEventPlane(const char *name) :
   fLyzEp(NULL),
   fLyz(NULL),
   fEventMaker(NULL),
-  fFirstRunFile(NULL),
+  fCFManager1(NULL),
+  fCFManager2(NULL),
+  fListHistos(NULL),
   fSecondRunFile(NULL)
 {
   // Constructor
@@ -62,12 +67,36 @@ AliAnalysisTaskLYZEventPlane::AliAnalysisTaskLYZEventPlane(const char *name) :
   // Input slot #0 works with a TChain
   DefineInput(0, TChain::Class());
   DefineInput(1, TList::Class());
-  DefineInput(2, TList::Class());
   // Output slot #0 writes into a TList container
   DefineOutput(0, TList::Class());  
 }
 
 //________________________________________________________________________
+AliAnalysisTaskLYZEventPlane::AliAnalysisTaskLYZEventPlane() : 
+  fESD(NULL), 
+  fAOD(NULL),
+  fAnalysisType("ESD"), 
+  fLyzEp(NULL),
+  fLyz(NULL),
+  fEventMaker(NULL),
+  fCFManager1(NULL),
+  fCFManager2(NULL),
+  fListHistos(NULL),
+  fSecondRunFile(NULL)
+{
+  // Constructor
+  cout<<"AliAnalysisTaskLYZEventPlane::AliAnalysisTaskLYZEventPlane()"<<endl;
+}
+
+
+//________________________________________________________________________
+AliAnalysisTaskLYZEventPlane::~AliAnalysisTaskLYZEventPlane() 
+{
+  //destructor
+
+}
+
+//________________________________________________________________________
 void AliAnalysisTaskLYZEventPlane::ConnectInputData(Option_t *) 
 {
   // Connect ESD or AOD here
@@ -137,29 +166,24 @@ void AliAnalysisTaskLYZEventPlane::CreateOutputObjects()
   fLyzEp = new AliFlowLYZEventPlane() ;
   //Analyser
   fLyz = new AliFlowAnalysisWithLYZEventPlane() ;
-
-  //output file
-  TString outputName = "outputFromLYZEventPlaneAnalysis" ;
-  outputName += fAnalysisType.Data() ;
-  outputName += ".root" ;
-  fLyz->SetOutFileName( outputName.Data() );
      
-  // Get data from input slot 1 and 2
-  fFirstRunFile = (TFile*)GetInputData(1);
-  cerr<<"fFirstRunFile ("<<fFirstRunFile<<")"<<endl;
-  if (fFirstRunFile) cerr<<"fFirstRunFile -> IsOpen() = "<<fFirstRunFile -> IsOpen()<<endl;
-  fSecondRunFile = (TFile*)GetInputData(2);
+  // Get data from input slot
+  fSecondRunFile = (TFile*)GetInputData(1);
   cerr<<"fSecondRunFile ("<<fSecondRunFile<<")"<<endl;
   if (fSecondRunFile) cerr<<"fSecondRunFile -> IsOpen() = "<<fSecondRunFile -> IsOpen()<<endl;
-  
-  fLyzEp -> SetFirstRunFile(fFirstRunFile);
   fLyzEp -> SetSecondRunFile(fSecondRunFile);
-  fLyz -> SetFirstRunFile(fFirstRunFile);
   fLyz -> SetSecondRunFile(fSecondRunFile);
 
   fLyzEp-> Init();
   fLyz-> Init();
 
+  if (fLyz->GetHistList()) {
+    fListHistos = fLyz->GetHistList();
+    fListHistos->Print();
+  }
+  else { cout<<"ERROR: Could not retrieve histogram list"<<endl;}
+
 
 }
 
@@ -168,6 +192,7 @@ void AliAnalysisTaskLYZEventPlane::Exec(Option_t *)
 {
   // Main loop
   // Called for each event
+
   if (fAnalysisType == "MC") {
     // Process MC truth, therefore we receive the AliAnalysisManager and ask it for the AliMCEventHandler
     // This handler can return the current MC event
@@ -184,10 +209,13 @@ void AliAnalysisTaskLYZEventPlane::Exec(Option_t *)
       return;
     }
 
+    fCFManager1->SetEventInfo(mcEvent);
+    fCFManager2->SetEventInfo(mcEvent);
+
     Printf("MC particles: %d", mcEvent->GetNumberOfTracks());
 
     //lee yang zeros analysis 
-    AliFlowEventSimple* fEvent = fEventMaker->FillTracks(mcEvent);
+    AliFlowEventSimple* fEvent = fEventMaker->FillTracks(mcEvent,fCFManager1,fCFManager2);
     fLyz->Make(fEvent,fLyzEp);
 
     delete fEvent;
@@ -200,11 +228,11 @@ void AliAnalysisTaskLYZEventPlane::Exec(Option_t *)
     Printf("There are %d tracks in this event", fESD->GetNumberOfTracks());
     
     //lee yang zeros analysis 
-    AliFlowEventSimple* fEvent = fEventMaker->FillTracks(fESD);
+    AliFlowEventSimple* fEvent = fEventMaker->FillTracks(fESD,fCFManager1,fCFManager2);
     fLyz->Make(fEvent,fLyzEp);
     delete fEvent;
   }
-  else if (fAnalysisType == "ESDMC0") {
+  else if (fAnalysisType == "ESDMC0" || fAnalysisType == "ESDMC1") {
     if (!fESD) {
       Printf("ERROR: fESD not available");
       return;
@@ -223,37 +251,22 @@ void AliAnalysisTaskLYZEventPlane::Exec(Option_t *)
       return;
     }
 
-    //lee yang zeros analysis 
-    AliFlowEventSimple* fEvent = fEventMaker->FillTracks(fESD,mcEvent,0); //0 = kine from ESD, 1 = kine from MC
-    fLyz->Make(fEvent,fLyzEp);
-    delete fEvent;
-    //delete mcEvent;
-  }
-  else if (fAnalysisType == "ESDMC1") {
-    if (!fESD) {
-      Printf("ERROR: fESD not available");
-      return;
-    }
-    Printf("There are %d tracks in this event", fESD->GetNumberOfTracks());
-    
-    AliMCEventHandler* eventHandler = dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
-    if (!eventHandler) {
-      Printf("ERROR: Could not retrieve MC event handler");
-      return;
-    }
+    fCFManager1->SetEventInfo(mcEvent);
+    fCFManager2->SetEventInfo(mcEvent);
 
-    AliMCEvent* mcEvent = eventHandler->MCEvent();
-    if (!mcEvent) {
-      Printf("ERROR: Could not retrieve MC event");
-      return;
+    //lee yang zeros analysis 
+    AliFlowEventSimple* fEvent = NULL;
+    if (fAnalysisType == "ESDMC0") {
+      fEvent = fEventMaker->FillTracks(fESD, mcEvent,fCFManager1, fCFManager2,0);  //0 = kine from ESD, 1 = kine from MC
+    } else if (fAnalysisType == "ESDMC1") {
+      fEvent = fEventMaker->FillTracks(fESD, mcEvent,fCFManager1, fCFManager2,0);  //0 = kine from ESD, 1 = kine from MC
     }
 
-    //lee yang zeros analysis 
-    AliFlowEventSimple* fEvent = fEventMaker->FillTracks(fESD,mcEvent,1); //0 = kine from ESD, 1 = kine from MC
     fLyz->Make(fEvent,fLyzEp);
     delete fEvent;
     //delete mcEvent;
   }
+  
   else if (fAnalysisType == "AOD") {
     if (!fAOD) {
       Printf("ERROR: fAOD not available");
@@ -262,12 +275,14 @@ void AliAnalysisTaskLYZEventPlane::Exec(Option_t *)
     Printf("There are %d tracks in this event", fAOD->GetNumberOfTracks());
 
     //lee yang zeros analysis 
+    //for the moment don't use CF
+    //AliFlowEventSimple* fEvent = fEventMaker->FillTracks(fAOD,fCFManager1,fCFManager2);
     AliFlowEventSimple* fEvent = fEventMaker->FillTracks(fAOD);
     fLyz->Make(fEvent,fLyzEp);
     delete fEvent;
   }
   
-  PostData(0,fLyz->GetOutFile());
+  PostData(0,fListHistos);
 }      
 
 //________________________________________________________________________
@@ -276,9 +291,13 @@ void AliAnalysisTaskLYZEventPlane::Terminate(Option_t *)
   // Called once at the end of the query
   fLyz->Finish();
 
-  delete fLyz;
-  delete fLyzEp;
-  delete fEventMaker;
+  TList* fOutHistos = (TList*)GetOutputData(0);
+  if (fOutHistos) { fOutHistos->Print(); }
+  else { cout<<"hostogram list pointer in Terminate is empty"<<endl; }
+
+  //delete fLyz;
+  //delete fLyzEp;
+  //delete fEventMaker;
 }
 
 
index b019e02..99d0aab 100644 (file)
 
 class AliESDEvent;
 class AliAODEvent;
+class AliCFManager;
 class AliFlowLYZEventPlane;
 class AliFlowAnalysisWithLYZEventPlane;
 class AliFlowEventSimpleMaker;
 class TFile;
+class TList;
 
+#include "TString.h"
 #include "AliAnalysisTask.h"
 
 class AliAnalysisTaskLYZEventPlane : public AliAnalysisTask {
  public:
-  AliAnalysisTaskLYZEventPlane(const char *name = "AliAnalysisTaskLYZEventPlane");
-  virtual ~AliAnalysisTaskLYZEventPlane() {}
+  AliAnalysisTaskLYZEventPlane();
+  AliAnalysisTaskLYZEventPlane(const char *name);
+  virtual ~AliAnalysisTaskLYZEventPlane();
   
   virtual void   ConnectInputData(Option_t *);
   virtual void   CreateOutputObjects();
@@ -31,6 +35,12 @@ class AliAnalysisTaskLYZEventPlane : public AliAnalysisTask {
   virtual void   Terminate(Option_t *);
   
   void           SetAnalysisType(TString type) {this->fAnalysisType = type ; }
+  TString        GetAnalysisType() const       {return this->fAnalysisType; }
+
+  void           SetCFManager1(AliCFManager* cfmgr) {this->fCFManager1 = cfmgr; }
+  AliCFManager*  GetCFManager1() const         {return this->fCFManager1; }
+  void           SetCFManager2(AliCFManager* cfmgr) {this->fCFManager2 = cfmgr; }
+  AliCFManager*  GetCFManager2() const         {return this->fCFManager2; }
 
  private:
  
@@ -43,9 +53,10 @@ class AliAnalysisTaskLYZEventPlane : public AliAnalysisTask {
   AliFlowLYZEventPlane* fLyzEp;           //LYZ EP object
   AliFlowAnalysisWithLYZEventPlane* fLyz; //LYZ EP analysis object
   AliFlowEventSimpleMaker* fEventMaker;   //FlowEventSimple maker object
-
-  TFile* fFirstRunFile;                   //! output from the first LYZ loop
-  TFile* fSecondRunFile;                  //! output from the second LYZ loop
+  AliCFManager* fCFManager1;              //Correction framework manager
+  AliCFManager* fCFManager2;              //Correction framework manager
+  TList* fListHistos;                     //collection of output hists
+  TFile* fSecondRunFile;                  //output from the second LYZ loop
     
   ClassDef(AliAnalysisTaskLYZEventPlane, 1); // example of analysis
 };
index 72c2b6f..ac9e515 100644 (file)
@@ -32,6 +32,8 @@ class AliAnalysisTask;
 #include "AliMCEventHandler.h"
 #include "AliMCEvent.h"
 
+#include "../../CORRFW/AliCFManager.h"
+
 #include "AliGenCocktailEventHeader.h"
 #include "AliGenHijingEventHeader.h"
 
@@ -52,9 +54,12 @@ AliAnalysisTaskMCEventPlane::AliAnalysisTaskMCEventPlane(const char *name) :
   AliAnalysisTask(name, ""), 
   fESD(0),
   fAOD(0),
+  fAnalysisType("MC"),
+  fCFManager1(NULL),
+  fCFManager2(NULL),
   fMc(0),
   fEventMaker(0),
-  fAnalysisType("MC")
+  fListHistos(NULL)
 {
   // Constructor
   cout<<"AliAnalysisTaskMCEventPlane::AliAnalysisTaskMCEventPlane(const char *name)"<<endl;
@@ -67,6 +72,30 @@ AliAnalysisTaskMCEventPlane::AliAnalysisTaskMCEventPlane(const char *name) :
 }
 
 //________________________________________________________________________
+AliAnalysisTaskMCEventPlane::AliAnalysisTaskMCEventPlane() : 
+  fESD(0),
+  fAOD(0),
+  fAnalysisType("MC"),
+  fCFManager1(NULL),
+  fCFManager2(NULL),
+  fMc(0),
+  fEventMaker(0),
+  fListHistos(NULL)
+{
+  // Constructor
+  cout<<"AliAnalysisTaskMCEventPlane::AliAnalysisTaskMCEventPlane()"<<endl;
+
+}
+
+//________________________________________________________________________
+AliAnalysisTaskMCEventPlane::~AliAnalysisTaskMCEventPlane()
+{
+
+  //destructor
+
+}
+
+//________________________________________________________________________
 void AliAnalysisTaskMCEventPlane::ConnectInputData(Option_t *) 
 {
   // Connect ESD or AOD here
@@ -140,15 +169,15 @@ void AliAnalysisTaskMCEventPlane::CreateOutputObjects()
   fEventMaker = new AliFlowEventSimpleMaker();
   //Analyser
   fMc  = new AliFlowAnalysisWithMCEventPlane() ;
-
-  //output file
-  TString outputName = "outputFromMCEventPlaneAnalysis" ;
-  outputName += fAnalysisType.Data() ;
-  outputName += ".root" ;
-  fMc->SetHistFileName( outputName.Data() );
-    
+      
   fMc-> Init();
 
+  if (fMc->GetHistList()) {
+       fMc->GetHistList()->Print();
+       fListHistos = fMc->GetHistList();
+       fListHistos->Print();
+  }
+  else {Printf("ERROR: Could not retrieve histogram list"); }
 
 }
 
@@ -174,6 +203,9 @@ void AliAnalysisTaskMCEventPlane::Exec(Option_t *)
     return;
   }
 
+  fCFManager1->SetEventInfo(mcEvent);
+  fCFManager2->SetEventInfo(mcEvent);
+
   Printf("MC particles: %d", mcEvent->GetNumberOfTracks());
   
   AliGenCocktailEventHeader *header = dynamic_cast<AliGenCocktailEventHeader *> (mcEvent-> GenEventHeader()); 
@@ -199,9 +231,9 @@ void AliAnalysisTaskMCEventPlane::Exec(Option_t *)
   
   if (fAnalysisType == "MC") {
     // analysis 
-    AliFlowEventSimple* fEvent = fEventMaker->FillTracks(mcEvent);
+    //AliFlowEventSimple* fEvent = fEventMaker->FillTracks(mcEvent);
+    AliFlowEventSimple* fEvent = fEventMaker->FillTracks(mcEvent,fCFManager1,fCFManager2);
     fMc->Make(fEvent,fRP);
-
     delete fEvent;
   }
 
@@ -213,7 +245,8 @@ void AliAnalysisTaskMCEventPlane::Exec(Option_t *)
     Printf("There are %d tracks in this event", fESD->GetNumberOfTracks());
     
     // analysis 
-    AliFlowEventSimple* fEvent = fEventMaker->FillTracks(fESD);
+    //AliFlowEventSimple* fEvent = fEventMaker->FillTracks(fESD);
+    AliFlowEventSimple* fEvent = fEventMaker->FillTracks(fESD,fCFManager1,fCFManager2);
     fMc->Make(fEvent,fRP);
     delete fEvent;
   }
@@ -226,7 +259,8 @@ void AliAnalysisTaskMCEventPlane::Exec(Option_t *)
     Printf("There are %d tracks in this event", fESD->GetNumberOfTracks());
 
     // analysis 
-    AliFlowEventSimple* fEvent = fEventMaker->FillTracks(fESD,mcEvent,0); //0 = kine from ESD, 1 = kine from MC
+    //AliFlowEventSimple* fEvent = fEventMaker->FillTracks(fESD,mcEvent,0); //0 = kine from ESD, 1 = kine from MC
+    AliFlowEventSimple* fEvent = fEventMaker->FillTracks(fESD, mcEvent, fCFManager1, fCFManager2, 0);
     fMc->Make(fEvent,fRP);
     delete fEvent;
   }
@@ -239,7 +273,8 @@ void AliAnalysisTaskMCEventPlane::Exec(Option_t *)
     Printf("There are %d tracks in this event", fESD->GetNumberOfTracks());
 
     // analysis 
-    AliFlowEventSimple* fEvent = fEventMaker->FillTracks(fESD,mcEvent,1); //0 = kine from ESD, 1 = kine from MC
+    //AliFlowEventSimple* fEvent = fEventMaker->FillTracks(fESD,mcEvent,1); //0 = kine from ESD, 1 = kine from MC
+    AliFlowEventSimple* fEvent = fEventMaker->FillTracks(fESD, mcEvent, fCFManager1, fCFManager2, 1);
     fMc->Make(fEvent,fRP);
     delete fEvent;
   }
@@ -252,11 +287,13 @@ void AliAnalysisTaskMCEventPlane::Exec(Option_t *)
     Printf("There are %d tracks in this event", fAOD->GetNumberOfTracks());
 
     // analysis 
-    AliFlowEventSimple* fEvent = fEventMaker->FillTracks(fAOD);
+    AliFlowEventSimple* fEvent = fEventMaker->FillTracks(fAOD);  //no CF yet!
     fMc->Make(fEvent,fRP);
     delete fEvent;
   }
 
+  //PostData(0,fListHistos); //here for CAF
+
 }      
 
 //________________________________________________________________________
@@ -264,8 +301,8 @@ void AliAnalysisTaskMCEventPlane::Terminate(Option_t *)
 {
   // Called once at the end of the query
   fMc->Finish();
-  PostData(0,fMc->GetHistFile());
+  PostData(0,fListHistos);
 
-  delete fMc;
-  delete fEventMaker;
+  //delete fMc;
+  //delete fEventMaker;
 }
index 3642587..70d8474 100644 (file)
 
 class AliESDEvent;
 class AliAODEvent;
+class AliCFManager;
 class AliFlowAnalysisWithMCEventPlane;
 class AliFlowEventSimpleMaker;
+class TList;
 
 #include "TString.h"
 #include "AliAnalysisTask.h"
 
 class AliAnalysisTaskMCEventPlane : public AliAnalysisTask {
  public:
-  AliAnalysisTaskMCEventPlane(const char *name = "AliAnalysisTaskMCEventPlane");
-  virtual ~AliAnalysisTaskMCEventPlane() {}
+
+  AliAnalysisTaskMCEventPlane();
+  AliAnalysisTaskMCEventPlane(const char *name);
+  virtual ~AliAnalysisTaskMCEventPlane();
   
   virtual void   ConnectInputData(Option_t *);
   virtual void   CreateOutputObjects();
@@ -32,6 +36,11 @@ class AliAnalysisTaskMCEventPlane : public AliAnalysisTask {
   void SetAnalysisType(TString type) { this->fAnalysisType = type; }
   TString GetAnalysisType() const    { return this->fAnalysisType; }
   
+  void           SetCFManager1(AliCFManager* cfmgr) {this->fCFManager1 = cfmgr; } 
+  AliCFManager*  GetCFManager1()               {return this->fCFManager1; }
+  void           SetCFManager2(AliCFManager* cfmgr) {this->fCFManager2 = cfmgr; } 
+  AliCFManager*  GetCFManager2()               {return this->fCFManager2; }
+
  private:
  
   AliAnalysisTaskMCEventPlane(const AliAnalysisTaskMCEventPlane& aAnalysis);
@@ -39,9 +48,13 @@ class AliAnalysisTaskMCEventPlane : public AliAnalysisTask {
   
   AliESDEvent *fESD;                      // ESD object
   AliAODEvent *fAOD;                      // AOD object
+  TString fAnalysisType;                  // can be MC, ESD or AOD
+  AliCFManager*    fCFManager1;           // correction framework manager
+  AliCFManager*    fCFManager2;           // correction framework manager
   AliFlowAnalysisWithMCEventPlane* fMc;   // MC EP analysis object
   AliFlowEventSimpleMaker* fEventMaker;   // FlowEventSimple maker object
-  TString fAnalysisType;                  // can be MC, ESD or AOD
+  
+  TList*           fListHistos;           // collection of output
 
   ClassDef(AliAnalysisTaskMCEventPlane, 1); // example of analysis
 };
index 94e2abb..457cf2e 100644 (file)
@@ -22,6 +22,7 @@ $Log$
 #include "Riostream.h"  //needed as include
 
 #include "TFile.h"
+#include "TList.h"
 #include "TComplex.h"   //needed as include
 #include "TCanvas.h"   //needed as include
 #include "TLegend.h"   //needed as include
@@ -52,33 +53,27 @@ ClassImp(AliFlowAnalysisWithLYZEventPlane)
   //-----------------------------------------------------------------------
  
  AliFlowAnalysisWithLYZEventPlane::AliFlowAnalysisWithLYZEventPlane():
-  fOutFile(0), 
-  fFirstRunFile(0),
   fSecondRunFile(0),
-  fFirstRunFileName(0),
   fSecondRunFileName(0),
-  fOutFileName(0),
-  fSecondReDtheta(0),
-  fSecondImDtheta(0),
-  fFirstr0theta(0),
-  fSecondVPt(0),
-  fHistProFlow(0),
-  fHistProFlow2(0),
-  fHistProWr(0),
-  fHistProWrCorr(0),
-  fHistFlow(0),
-  fHistDeltaPhi(0),
-  fHistDeltaPhi2(0),
-  fHistDeltaPhihere(0),
-  fHistPhiEP(0),
-  fHistPhiEPhere(0),
-  fHistPhiLYZ(0),
-  fHistPhiLYZ2(0),
-  fHistProR0theta(0),
-  fHistProReDtheta(0),
-  fHistProImDtheta(0),
-  fCommonHists(0),
-  fCommonHistsRes(0),
+  fHistList(NULL),
+  fSecondReDtheta(NULL),
+  fSecondImDtheta(NULL),
+  fFirstr0theta(NULL),
+  fSecondVPt(NULL),
+  fHistProFlow(NULL),
+  fHistProFlow2(NULL),
+  fHistProWr(NULL),
+  fHistProWrCorr(NULL),
+  fHistFlow(NULL),
+  fHistDeltaPhi(NULL),
+  fHistDeltaPhi2(NULL),
+  fHistDeltaPhihere(NULL),
+  fHistPhiEP(NULL),
+  fHistPhiEPhere(NULL),
+  fHistPhiLYZ(NULL),
+  fHistPhiLYZ2(NULL),
+  fCommonHists(NULL),
+  fCommonHistsRes(NULL),
   fEventNumber(0),
   fQsum(NULL),
   fQ2sum(0)
@@ -86,6 +81,8 @@ ClassImp(AliFlowAnalysisWithLYZEventPlane)
 
   // Constructor.
   fQsum = new TVector2();        // flow vector sum
+
+  fHistList = new TList();
 }
 
  
@@ -97,6 +94,7 @@ ClassImp(AliFlowAnalysisWithLYZEventPlane)
  {
    //destructor
    delete fQsum;
+   delete fHistList;
  }
  
 
@@ -108,72 +106,71 @@ void AliFlowAnalysisWithLYZEventPlane::Init() {
 
   //input histograms
   if (fSecondRunFile->IsZombie()){ //check if file exists
-    cout << "Error opening file, run first with fFirstrun = kTRUE" << endl;
+    cout << "Error opening file, no input file from LYZ analysis" << endl;
     exit(-1);
   } else if (fSecondRunFile->IsOpen()){
     cout<<"----secondRunFile is open----"<<endl;
-    fSecondVPt = (TProfile*)fSecondRunFile->Get("Flow_Differential_Pt_LYZ"); //to compare to
-  }
-
-  if (fFirstRunFile->IsZombie()){ //check if file exists
-    cout << "Error opening file, run first with fFirstrun = kTRUE" << endl;
-    exit(-1);
-  } else if (fFirstRunFile->IsOpen()){
-    cout<<"----firstRunFile is open----"<<endl<<endl;
-    fFirstr0theta = (TProfile*)fFirstRunFile->Get("First_FlowPro_r0theta_LYZ");
+    //get List
+    TList* list   = (TList*)fSecondRunFile->Get("cobj1");
+    fSecondVPt    = (TProfile*)list->FindObject("Flow_Differential_Pt_LYZ"); //to compare to
+    fSecondReDtheta = (TProfile*)list->FindObject("Second_FlowPro_ReDtheta_LYZ");
+    fHistList->Add(fSecondReDtheta);
+    fSecondImDtheta = (TProfile*)list->FindObject("Second_FlowPro_ImDtheta_LYZ");
+    fHistList->Add(fSecondImDtheta);
+    fFirstr0theta = (TProfile*)list->FindObject("First_FlowPro_r0theta_LYZ");
+    fHistList->Add(fFirstr0theta);
   }
 
 
-  //output file
-  // ********make output file 
-  // analysis file (output)
-  fOutFile = new TFile(fOutFileName.Data(),"RECREATE") ;
-
   fCommonHists = new AliFlowCommonHist("LYZEP");
-  fCommonHistsRes = new AliFlowCommonHistResults("LYZEP");
+  fHistList->Add(fCommonHists->GetHistMultOrig());
+  fHistList->Add(fCommonHists->GetHistMultInt());
+  fHistList->Add(fCommonHists->GetHistMultDiff());
+  fHistList->Add(fCommonHists->GetHistPtInt());
+  fHistList->Add(fCommonHists->GetHistPtDiff());
+  fHistList->Add(fCommonHists->GetHistPhiInt());
+  fHistList->Add(fCommonHists->GetHistPhiDiff());
+  fHistList->Add(fCommonHists->GetHistEtaInt());
+  fHistList->Add(fCommonHists->GetHistEtaDiff());
+  fHistList->Add(fCommonHists->GetHistProMeanPtperBin());
+  fHistList->Add(fCommonHists->GetHistQ());
+
+  fCommonHistsRes = new AliFlowCommonHistResults("LYZEP"); 
+  fHistList->Add(fCommonHistsRes->GetHistDiffFlow()); 
+  fHistList->Add(fCommonHistsRes->GetHistChi()); 
+  fHistList->Add(fCommonHistsRes->GetHistIntFlow()); 
+
   
-  // output histograms
-  Int_t iNtheta = AliFlowLYZConstants::kTheta;
   Int_t iNbinsPt = AliFlowCommonConstants::GetNbinsPt();
   Double_t  dPtMin = AliFlowCommonConstants::GetPtMin();            
   Double_t  dPtMax = AliFlowCommonConstants::GetPtMax();
 
-
   fHistProFlow = new TProfile("FlowPro_VPt_LYZEP","FlowPro_VPt_LYZEP",iNbinsPt,dPtMin,dPtMax);
   fHistProFlow->SetXTitle("Pt");
   fHistProFlow->SetYTitle("v2 (%)");
+  fHistList->Add(fHistProFlow);
   
   fHistProWr = new TProfile("FlowPro_Wr_LYZEP","FlowPro_Wr_LYZEP",100,0.,0.25);
   fHistProWr->SetXTitle("Q");
   fHistProWr->SetYTitle("Wr");
+  fHistList->Add(fHistProWr);
 
   fHistDeltaPhi = new TH1F("Flow_DeltaPhi_LYZEP","Flow_DeltaPhi_LYZEP",100,0.,3.14);
   fHistDeltaPhi->SetXTitle("DeltaPhi");
   fHistDeltaPhi->SetYTitle("Counts");
+  fHistList->Add(fHistDeltaPhi);
 
   fHistPhiLYZ = new TH1F("Flow_PhiLYZ_LYZEP","Flow_PhiLYZ_LYZEP",100,0.,3.14);
   fHistPhiLYZ->SetXTitle("Phi from LYZ");
   fHistPhiLYZ->SetYTitle("Counts");
+  fHistList->Add(fHistPhiLYZ);
 
   fHistPhiEP = new TH1F("Flow_PhiEP_LYZEP","Flow_PhiEP_LYZEP",100,0.,3.14);
   fHistPhiEP->SetXTitle("Phi from EP");
   fHistPhiEP->SetYTitle("Counts");
-
-  
-  fHistProR0theta  = new TProfile("FlowPro_r0theta_LYZEP","FlowPro_r0theta_LYZEP",iNtheta,-0.5,iNtheta-0.5);
-  fHistProR0theta->SetXTitle("#theta");
-  fHistProR0theta->SetYTitle("r_{0}^{#theta}");
-
-  fHistProReDtheta = new TProfile("FlowPro_ReDtheta_LYZEP","FlowPro_ReDtheta_LYZEP",iNtheta, -0.5, iNtheta-0.5);
-  fHistProReDtheta->SetXTitle("#theta");
-  fHistProReDtheta->SetYTitle("Re(D^{#theta})");
-
-  fHistProImDtheta = new TProfile("FlowPro_ImDtheta_LYZEP","FlowPro_ImDtheta_LYZEP",iNtheta, -0.5, iNtheta-0.5);
-  fHistProImDtheta->SetXTitle("#theta");
-  fHistProImDtheta->SetYTitle("Im(D^{#theta})");
+  fHistList->Add(fHistPhiEP);
 
   fEventNumber = 0;  //set number of events to zero
-
       
 } 
  
@@ -197,6 +194,7 @@ void AliFlowAnalysisWithLYZEventPlane::Make(AliFlowEventSimple* anEvent, AliFlow
       dQY = vQ.Y()/vQ.GetMult();
     } else {cerr<<"vQ.GetMult() is zero!"<<endl; }
     vQ.Set(dQX,dQY);
+
     //for chi calculation:
     *fQsum += vQ;
     fQ2sum += vQ.Mod2();
@@ -281,12 +279,13 @@ void AliFlowAnalysisWithLYZEventPlane::Finish() {
   Double_t  dChi= 0;
   if (fEventNumber!=0) {
     *fQsum /= fEventNumber;
-    //cerr<<"fQsum.X() = "<<fQsum.X()<<endl;
-    //cerr<<"fQsum.Y() = "<<fQsum.Y()<<endl;
+    cerr<<"fQsum->X() = "<<fQsum->X()<<endl;
+    cerr<<"fQsum->Y() = "<<fQsum->Y()<<endl;
     fQ2sum /= fEventNumber;
     cerr<<"fEventNumber = "<<fEventNumber<<endl;
     cerr<<"fQ2sum = "<<fQ2sum<<endl;
     dSigma2 = fQ2sum - TMath::Power(fQsum->X(),2.) - TMath::Power(fQsum->Y(),2.) - TMath::Power(dV,2.);  //BP eq. 62
+    cerr<<"dSigma2"<<dSigma2<<endl;
     if (dSigma2>0) dChi = dV/TMath::Sqrt(dSigma2);
     else dChi = -1.;
     fCommonHistsRes->FillChi(dChi);
@@ -335,8 +334,6 @@ void AliFlowAnalysisWithLYZEventPlane::Finish() {
     
   } //loop over b
 
-  // write to file
-  fOutFile->Write();
 
   cout<<"Making some plots to check the results:"<<endl<<endl;
 
index 082c4b8..d53c42d 100644 (file)
@@ -17,6 +17,8 @@ class TFile;
 class TProfile;
 class TH1F;
 class TH1D;
+class TList;
+class Riostream;
 
 // AliFlowAnalysisWithLYZEventPlane:
 // Class to do flow analysis with the event plane from the LYZ method
@@ -24,37 +26,23 @@ class TH1D;
 
 
 class AliFlowAnalysisWithLYZEventPlane {
+
  public:
-  AliFlowAnalysisWithLYZEventPlane();
-  virtual ~AliFlowAnalysisWithLYZEventPlane();
+
+  AliFlowAnalysisWithLYZEventPlane();                 //default constructor
+  virtual ~AliFlowAnalysisWithLYZEventPlane();        //destructor
   
   virtual void   Init();
   virtual void   Make(AliFlowEventSimple* fEvent, AliFlowLYZEventPlane* fLYZEP);
-  //  virtual void   Make(AliFlowEventSimple* anEvent);
   virtual void   Finish();
 
   // input files
-  void    SetFirstRunFileName(TString name)    
-    { this->fFirstRunFileName = name ; }      // Sets input file name
-  TString  GetFirstRunFileName() const         
-    { return this->fFirstRunFileName ; }      // Gets output file name
-  void     SetFirstRunFile(TFile* file)         
-    { this->fFirstRunFile = file ; }          // Sets first run file
-
-  void    SetSecondRunFileName(TString name)   
-    { this->fSecondRunFileName = name ; }     // Sets input file name
-  TString  GetSecondRunFileName() const                
-    { return this->fSecondRunFileName ; }     // Gets output file name
-  void     SetSecondRunFile(TFile* file)         
-    { this->fSecondRunFile = file ; }         // Sets first run file
-
-  // Output 
-  void    SetOutFileName(TString name)    { this->fOutFileName = name ; } 
-  // Sets output file name
-  TString  GetOutFileName() const         { return this->fOutFileName ; } 
-  // Gets output file name
-  TFile*   GetOutFile() const              { return this->fOutFile ; }     
-  // Gets output file
+  void    SetSecondRunFileName(TString name)  { this->fSecondRunFileName = name ; }     // Sets input file name
+  TString  GetSecondRunFileName() const               { return this->fSecondRunFileName ; }     // Gets output file name
+  void     SetSecondRunFile(TFile* file)       { this->fSecondRunFile = file ; }         // Sets first run file
+
+  //output
+  TList* GetHistList() const                   {return this->fHistList; }
 
 
  private:
@@ -62,14 +50,11 @@ class AliFlowAnalysisWithLYZEventPlane {
   AliFlowAnalysisWithLYZEventPlane(const AliFlowAnalysisWithLYZEventPlane& aAnalysis);             // copy constructor
   AliFlowAnalysisWithLYZEventPlane& operator=(const AliFlowAnalysisWithLYZEventPlane& aAnalysis);  // assignment operator
 
-  TFile*             fOutFile;                //! 
-  TFile*             fFirstRunFile ;          //! pointer to file from first run
-  TFile*             fSecondRunFile ;         //! pointer to file from second run
-  TString            fFirstRunFileName;       //!
-  TString            fSecondRunFileName;      //!
-  TString            fOutFileName;            //!
+  TFile*             fSecondRunFile ;         // pointer to file from second run
+  TString            fSecondRunFileName;    
 
   //histograms
+  TList*     fHistList;                       //list ro hold all histograms
   //input
   TProfile*  fSecondReDtheta;                 // input profile
   TProfile*  fSecondImDtheta;                 // input profile
@@ -88,17 +73,14 @@ class AliFlowAnalysisWithLYZEventPlane {
   TH1F*      fHistPhiEPhere;                  //
   TH1F*      fHistPhiLYZ;                     //
   TH1F*      fHistPhiLYZ2;                    //
-  TProfile*  fHistProR0theta;                 //
-  TProfile*  fHistProReDtheta;                //
-  TProfile*  fHistProImDtheta;                //
   
   AliFlowCommonHist* fCommonHists;            //
   AliFlowCommonHistResults* fCommonHistsRes;  //
 
   Int_t     fEventNumber;                     // event counter
 
-  TVector2  *fQsum;         // flow vector sum
-  Double_t  fQ2sum;        // flow vector sum squared
+  TVector2  *fQsum;                           // flow vector sum
+  Double_t  fQ2sum;                           // flow vector sum squared
      
 
   ClassDef(AliFlowAnalysisWithLYZEventPlane, 0);          // lyz analysis 
index f4b8cb6..654813b 100644 (file)
@@ -19,6 +19,7 @@
 #include "TFile.h"      //needed as include
 #include "TProfile.h"   //needed as include
 #include "TComplex.h"   //needed as include
+#include "TList.h"
 
 class TH1F;
 
@@ -46,8 +47,7 @@ ClassImp(AliFlowAnalysisWithMCEventPlane)
    fQ2sum(0),
    fEventNumber(0),
    fDebug(kFALSE),
-   fHistFileName(0),
-   fHistFile(0),
+   fHistList(NULL),
    fCommonHists(NULL),
    fCommonHistsRes(NULL),
    fHistProFlow(NULL),
@@ -56,6 +56,8 @@ ClassImp(AliFlowAnalysisWithMCEventPlane)
 {
 
   // Constructor.
+  fHistList = new TList();
+
   fQsum = new TVector2;        // flow vector sum
 }
 
@@ -66,6 +68,7 @@ ClassImp(AliFlowAnalysisWithMCEventPlane)
  AliFlowAnalysisWithMCEventPlane::~AliFlowAnalysisWithMCEventPlane() 
  {
    //destructor
+   delete fHistList;
    delete fQsum;
  }
  
@@ -80,19 +83,32 @@ void AliFlowAnalysisWithMCEventPlane::Init() {
   Double_t  dPtMin = AliFlowCommonConstants::GetPtMin();            
   Double_t  dPtMax = AliFlowCommonConstants::GetPtMax();
 
-  // analysis file (output)
-  fHistFile = new TFile(fHistFileName.Data(),"RECREATE") ;
-
   fCommonHists = new AliFlowCommonHist("MC");
+  fHistList->Add(fCommonHists->GetHistMultOrig());
+  fHistList->Add(fCommonHists->GetHistMultInt());
+  fHistList->Add(fCommonHists->GetHistMultDiff());
+  fHistList->Add(fCommonHists->GetHistPtInt());
+  fHistList->Add(fCommonHists->GetHistPtDiff());
+  fHistList->Add(fCommonHists->GetHistPhiInt());
+  fHistList->Add(fCommonHists->GetHistPhiDiff());
+  fHistList->Add(fCommonHists->GetHistEtaInt());
+  fHistList->Add(fCommonHists->GetHistEtaDiff());
+  fHistList->Add(fCommonHists->GetHistProMeanPtperBin());
+  fHistList->Add(fCommonHists->GetHistQ());
   fCommonHistsRes = new AliFlowCommonHistResults("MC");
+  fHistList->Add(fCommonHistsRes->GetHistDiffFlow()); 
+  fHistList->Add(fCommonHistsRes->GetHistChi()); 
+  fHistList->Add(fCommonHistsRes->GetHistIntFlow()); 
 
   fHistProFlow = new TProfile("FlowPro_VPt_MC","FlowPro_VPt_MC",iNbinsPt,dPtMin,dPtMax);
   fHistProFlow->SetXTitle("Pt");
   fHistProFlow->SetYTitle("v2 (%)");
+  fHistList->Add(fHistProFlow);
 
   fHistRP = new TH1F("Flow_RP_MC","Flow_RP_MC",100,0.,3.14);
   fHistRP->SetXTitle("Reaction Plane Angle");
   fHistRP->SetYTitle("Counts");
+  fHistList->Add(fHistRP);
 
  
   fEventNumber = 0;  //set number of events to zero
@@ -179,10 +195,7 @@ void AliFlowAnalysisWithMCEventPlane::Finish() {
   dErrV = TMath::Sqrt(dErrV);
   cout<<"dV is "<<dV<<" +- "<<dErrV<<endl;
   fCommonHistsRes->FillIntegratedFlow(dV,dErrV); 
-
-  // write to file
-  fHistFile->Write();
-         
+         
   cout<<".....finished"<<endl;
  }
 
index 594acf5..db4497a 100644 (file)
@@ -22,6 +22,7 @@ class TProfile;
 class TProfile2D;
 class TObjArray;
 class TFile;
+class TList;
 class TComplex;
 class Riostream;
 
@@ -35,8 +36,7 @@ class AliFlowAnalysisWithMCEventPlane {
 
  public:
  
-   AliFlowAnalysisWithMCEventPlane();   //default constructor
+   AliFlowAnalysisWithMCEventPlane();            //default constructor
    virtual  ~AliFlowAnalysisWithMCEventPlane();  //destructor
  
    void    Init();                             //defines variables and histograms
@@ -48,9 +48,7 @@ class AliFlowAnalysisWithMCEventPlane {
 
 
    // Output 
-   void            SetHistFileName(TString name)       { this->fHistFileName = name ; } // Sets output file name
-   TString  GetHistFileName() const            { return this->fHistFileName ; } // Gets output file name
-   TFile*   GetHistFile() const                 { return this->fHistFile ; }     // Gets output file
+   TList*   GetHistList() const                  { return this->fHistList ; }  
   
    
  private:
@@ -67,8 +65,7 @@ class AliFlowAnalysisWithMCEventPlane {
    Int_t        fEventNumber;       // event counter
    Bool_t       fDebug ;            //! flag for lyz analysis: more print statements
 
-   TString      fHistFileName;      //!
-   TFile*       fHistFile;          //!
+   TList*       fHistList;          //list to hold all output histograms  
     
    AliFlowCommonHist* fCommonHists;              //
    AliFlowCommonHistResults* fCommonHistsRes;    //
index 349d471..f4426d6 100644 (file)
@@ -38,9 +38,7 @@ ClassImp(AliFlowLYZEventPlane)
   //-----------------------------------------------------------------------
   
 AliFlowLYZEventPlane::AliFlowLYZEventPlane():
-  fFirstRunFile(0),
   fSecondRunFile(0),
-  fFirstRunFileName("noname.ESD"),
   fSecondRunFileName("noname.ESD"),
   fWR(0),            
   fPsi(0),
@@ -73,15 +71,11 @@ void AliFlowLYZEventPlane::Init()
     exit(-1);
   } else if (fSecondRunFile->IsOpen()){
     cout<<"----secondRunFile is open----"<<endl;
-    fSecondReDtheta = ( TProfile*)fSecondRunFile->Get("Second_FlowPro_ReDtheta_LYZ");
-    fSecondImDtheta = ( TProfile*)fSecondRunFile->Get("Second_FlowPro_ImDtheta_LYZ");
-  }
-  if (fFirstRunFile->IsZombie()){ //check if file exists
-    cout << "Error opening file, run first regular LYZ first run" << endl;
-    exit(-1);
-  } else if (fFirstRunFile->IsOpen()){
-    cout<<"----firstRunFile is open----"<<endl<<endl;
-    fFirstr0theta = (TProfile*)fFirstRunFile->Get("First_FlowPro_r0theta_LYZ");
+    //get List
+    TList* list = (TList*)fSecondRunFile->Get("cobj1");
+    fSecondReDtheta = ( TProfile*)list->FindObject("Second_FlowPro_ReDtheta_LYZ");
+    fSecondImDtheta = ( TProfile*)list->FindObject("Second_FlowPro_ImDtheta_LYZ");
+    fFirstr0theta   = ( TProfile*)list->FindObject("First_FlowPro_r0theta_LYZ");
   }
 
 }
index 22cd3f0..b56b7da 100644 (file)
@@ -27,14 +27,7 @@ class AliFlowLYZEventPlane {
   Double_t GetWR() const  {return this->fWR; }
   Double_t GetPsi() const {return this->fPsi; }
   
-  // input files
-  void    SetFirstRunFileName(TString name)    
-    { this->fFirstRunFileName = name ; }      // Sets input file name
-  TString  GetFirstRunFileName() const         
-    { return this->fFirstRunFileName ; }      // Gets output file name
-  void     SetFirstRunFile(TFile* file)         
-    { this->fFirstRunFile = file ; }          // Sets first run file
-
+  // input file
   void    SetSecondRunFileName(TString name)   
     { this->fSecondRunFileName = name ; }     // Sets input file name
   TString  GetSecondRunFileName() const                
@@ -43,15 +36,12 @@ class AliFlowLYZEventPlane {
     { this->fSecondRunFile = file ; }         // Sets second run file
 
 
-
  private:
   
   AliFlowLYZEventPlane(const AliFlowLYZEventPlane& aAnalysis);             // copy constructor
   AliFlowLYZEventPlane& operator=(const AliFlowLYZEventPlane& aAnalysis);  // assignment operator
   
-  TFile*   fFirstRunFile ;          //! pointer to file from first run
   TFile*   fSecondRunFile ;         //! pointer to file from second run
-  TString  fFirstRunFileName;       //!
   TString  fSecondRunFileName;      //!
 
   Double_t fWR;            // event weight
index e4db58e..e67b8ee 100644 (file)
@@ -10,11 +10,12 @@ void LookupWrite(TChain* chain, const char* target) ;
 // LYZ2  = Lee Yang Zeroes second run
 // LYZEP = Lee Yang Zeroes Event Plane
 // CUM   = Cumulants
-const TString method = "SP";
+// MCEP  = Flow calculated from the real MC event plane (only for simulated data)
+const TString method = "MCEP";
 
 //Type of analysis can be:
 // ESD, AOD, MC, ESDMC0, ESDMC1
-const TString type = "ESDMC1";
+const TString type = "ESD";
 
 
 //SETTING THE CUTS
@@ -199,16 +200,27 @@ void runAliAnalysisTaskFlow(Int_t nRuns = 10, const Char_t* dataDir="/data/alice
 
  
   if (method == "LYZ2"){  
-    // read the input files from the first run 
-    TString firstRunFileName = "outputLYZ1analysis" ;
-    firstRunFileName += type;
-    firstRunFileName += "_firstrun.root";
-    cout<<"The input file is "<<firstRunFileName.Data()<<endl;
-    TFile* fFirstRunFile = new TFile(firstRunFileName.Data(),"READ");
-    if(!fFirstRunFile || fFirstRunFile->IsZombie()) { cerr << " ERROR: NO First Run file... " << endl ; }
-    cout<<"input files read..."<<endl;
+    // read the input file from the first run 
+    TString inputFileName = "outputLYZ1analysis" ;
+    inputFileName += type;
+    inputFileName += "_firstrun.root";
+    cout<<"The input file is "<<inputFileName.Data()<<endl;
+    TFile* fInputFile = new TFile(inputFileName.Data(),"READ");
+    if(!fInputFile || fInputFile->IsZombie()) { cerr << " ERROR: NO First Run file... " << endl ; }
+    cout<<"input file read..."<<endl;
   }
 
+  if (method == "LYZEP") {
+    // read the input file from the second LYZ run
+    TString inputFileName = "outputLYZ2analysis" ;
+    inputFileName += type;
+    inputFileName += "_secondrun.root";
+    cout<<"The input file is "<<inputFileName.Data()<<endl;
+    TFile* fInputFile = new TFile(inputFileName.Data(),"READ");
+    if(!fInputFile || fInputFile->IsZombie()) { cerr << " ERROR: NO First Run file... " << endl ; }
+    cout<<"input file read..."<<endl;
+  }
+    
 
   //____________________________________________//
   // Make the analysis manager
@@ -216,11 +228,17 @@ void runAliAnalysisTaskFlow(Int_t nRuns = 10, const Char_t* dataDir="/data/alice
   
   if (type == "ESD"){
     AliVEventHandler* esdH = new AliESDInputHandler;
-    mgr->SetInputEventHandler(esdH); }
+    mgr->SetInputEventHandler(esdH); 
+    if (method == "MCEP") {
+      AliMCEventHandler *mc = new AliMCEventHandler();
+      mgr->SetMCtruthEventHandler(mc);}  }
    
   if (type == "AOD"){
     AliVEventHandler* aodH = new AliAODInputHandler;
-    mgr->SetInputEventHandler(aodH); }
+    mgr->SetInputEventHandler(aodH);
+    if (method == "MCEP") {
+      AliMCEventHandler *mc = new AliMCEventHandler();
+      mgr->SetMCtruthEventHandler(mc);}  }
   
   if (type == "MC" || type == "ESDMC0" || type == "ESDMC1"){
     AliVEventHandler* esdH = new AliESDInputHandler;
@@ -259,8 +277,8 @@ void runAliAnalysisTaskFlow(Int_t nRuns = 10, const Char_t* dataDir="/data/alice
   else if (method == "LYZEP"){
     AliAnalysisTaskLYZEventPlane *task1 = new AliAnalysisTaskLYZEventPlane("TaskLYZEventPlane");
     task1->SetAnalysisType(type);
-    //task1->SetCFManager1(cfmgr1);
-    //task1->SetCFManager2(cfmgr2);
+    task1->SetCFManager1(cfmgr1);
+    task1->SetCFManager2(cfmgr2);
     mgr->AddTask(task1);
   }
   else if (method == "CUM"){
@@ -270,13 +288,21 @@ void runAliAnalysisTaskFlow(Int_t nRuns = 10, const Char_t* dataDir="/data/alice
     //task1->SetCFManager2(cfmgr2);
     mgr->AddTask(task1);
   }
+  else if (method == "MCEP"){
+    AliAnalysisTaskMCEventPlane *task1 = new AliAnalysisTaskMCEventPlane("TaskMCEventPlane");
+    task1->SetAnalysisType(type);
+    task1->SetCFManager1(cfmgr1);
+    task1->SetCFManager2(cfmgr2);
+    mgr->AddTask(task1);
+  }
 
 
   // Create containers for input/output
   AliAnalysisDataContainer *cinput1 = 
     mgr->CreateContainer("cchain1",TChain::Class(),AliAnalysisManager::kInputContainer);
 
-  if (method == "LYZ2"){ AliAnalysisDataContainer *cinput2 = 
+  if (method == "LYZ2" || method == "LYZEP"){ 
+    AliAnalysisDataContainer *cinput2 = 
                    mgr->CreateContainer("cobj2",TList::Class(),AliAnalysisManager::kInputContainer); } 
 
 
@@ -290,12 +316,15 @@ void runAliAnalysisTaskFlow(Int_t nRuns = 10, const Char_t* dataDir="/data/alice
   AliAnalysisDataContainer *coutput1 = 
     mgr->CreateContainer("cobj1", TList::Class(),AliAnalysisManager::kOutputContainer,outputName);
 
+
   //____________________________________________//
   mgr->ConnectInput(task1,0,cinput1);
-  if (method == "LYZ2") { mgr->ConnectInput(task1,1,cinput2); }
+  if (method == "LYZ2" || method == "LYZEP") { 
+    mgr->ConnectInput(task1,1,cinput2); }
   mgr->ConnectOutput(task1,0,coutput1);
 
-  if (method == "LYZ2"){ cinput2->SetData(fFirstRunFile);}
+  if (method == "LYZ2" || method == "LYZEP"){ 
+    cinput2->SetData(fInputFile);}
 
   if (!mgr->InitAnalysis()) return;
   mgr->PrintStatus();