FMD and ITS additions
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 5 Jul 2010 17:12:25 +0000 (17:12 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 5 Jul 2010 17:12:25 +0000 (17:12 +0000)
13 files changed:
PWG2/FLOW/AliFlowCommon/AliFlowCommonHist.cxx
PWG2/FLOW/AliFlowCommon/AliFlowCommonHist.h
PWG2/FLOW/AliFlowCommon/AliFlowEventSimple.cxx
PWG2/FLOW/AliFlowCommon/AliFlowTrackSimple.cxx
PWG2/FLOW/AliFlowCommon/AliFlowTrackSimple.h
PWG2/FLOW/AliFlowTasks/AliAnalysisTaskFlowEvent.cxx
PWG2/FLOW/AliFlowTasks/AliAnalysisTaskFlowEvent.h
PWG2/FLOW/AliFlowTasks/AliFlowEvent.cxx
PWG2/FLOW/AliFlowTasks/AliFlowEvent.h
PWG2/FLOW/AliFlowTasks/AliFlowTrack.cxx
PWG2/FLOW/AliFlowTasks/AliFlowTrack.h
PWG2/FLOW/macros/AddTaskFlow.C
PWG2/FLOW/macros/runFlowTask.C

index a57f2e6..6f91cf9 100644 (file)
@@ -23,6 +23,7 @@
 #include "TProfile.h"
 #include "TMath.h"   //needed as include
 #include "TList.h"
+#include "TH2F.h"
 #include "AliFlowVector.h"
 #include "TBrowser.h"
 
@@ -40,16 +41,25 @@ ClassImp(AliFlowCommonHist)
 
 //-----------------------------------------------------------------------
 
-AliFlowCommonHist::AliFlowCommonHist():TNamed(),
+AliFlowCommonHist::AliFlowCommonHist():
+  TNamed(),
   fHistMultOrig(NULL),
   fHistMultRP(NULL),
   fHistMultPOI(NULL),
   fHistPtRP(NULL),
   fHistPtPOI(NULL),
+  fHistPtSub0(NULL),
+  fHistPtSub1(NULL),
   fHistPhiRP(NULL),
   fHistPhiPOI(NULL),
+  fHistPhiSub0(NULL),
+  fHistPhiSub1(NULL),
   fHistEtaRP(NULL),
   fHistEtaPOI(NULL),
+  fHistEtaSub0(NULL),
+  fHistEtaSub1(NULL),
+  fHistPhiEtaRP(NULL),
+  fHistPhiEtaPOI(NULL),
   fHistProMeanPtperBin(NULL),
   fHistQ(NULL),
   fHarmonic(NULL),
@@ -67,10 +77,18 @@ AliFlowCommonHist::AliFlowCommonHist(const AliFlowCommonHist& a):
   fHistMultPOI(new TH1F(*a.fHistMultPOI)),
   fHistPtRP(new TH1F(*a.fHistPtRP)),
   fHistPtPOI(new TH1F(*a.fHistPtPOI)),
+  fHistPtSub0(new TH1F(*a.fHistPtSub0)),
+  fHistPtSub1(new TH1F(*a.fHistPtSub1)),
   fHistPhiRP(new TH1F(*a.fHistPhiRP)),
   fHistPhiPOI(new TH1F(*a.fHistPhiPOI)),
+  fHistPhiSub0(new TH1F(*a.fHistPhiSub0)),
+  fHistPhiSub1(new TH1F(*a.fHistPhiSub1)),
   fHistEtaRP(new TH1F(*a.fHistEtaRP)),
   fHistEtaPOI(new TH1F(*a.fHistEtaPOI)),
+  fHistEtaSub0(new TH1F(*a.fHistEtaSub0)),
+  fHistEtaSub1(new TH1F(*a.fHistEtaSub1)),
+  fHistPhiEtaRP(new TH2F(*a.fHistPhiEtaRP)),
+  fHistPhiEtaPOI(new TH2F(*a.fHistPhiEtaPOI)),
   fHistProMeanPtperBin(new TProfile(*a.fHistProMeanPtperBin)),
   fHistQ(new TH1F(*a.fHistQ)),
   fHarmonic(new TProfile(*a.fHarmonic)),
@@ -83,11 +101,19 @@ AliFlowCommonHist::AliFlowCommonHist(const AliFlowCommonHist& a):
   fHistList-> Add(fHistMultRP);        
   fHistList-> Add(fHistMultPOI);       
   fHistList-> Add(fHistPtRP);          
-  fHistList-> Add(fHistPtPOI);         
+  fHistList-> Add(fHistPtPOI);
+  fHistList-> Add(fHistPtSub0);
+  fHistList-> Add(fHistPtSub1);
   fHistList-> Add(fHistPhiRP);          
-  fHistList-> Add(fHistPhiPOI);         
+  fHistList-> Add(fHistPhiPOI);
+  fHistList-> Add(fHistPhiSub0);
+  fHistList-> Add(fHistPhiSub1);    
   fHistList-> Add(fHistEtaRP);          
-  fHistList-> Add(fHistEtaPOI);         
+  fHistList-> Add(fHistEtaPOI); 
+  fHistList-> Add(fHistEtaSub0);
+  fHistList-> Add(fHistEtaSub1);
+  fHistList-> Add(fHistPhiEtaRP);
+  fHistList-> Add(fHistPhiEtaPOI);
   fHistList-> Add(fHistProMeanPtperBin); 
   fHistList-> Add(fHarmonic);  
   fHistList-> Add(fHistQ);           
@@ -116,21 +142,30 @@ AliFlowCommonHist::AliFlowCommonHist(const AliFlowCommonHist& a):
 
 //-----------------------------------------------------------------------
 
-  AliFlowCommonHist::AliFlowCommonHist(const char *anInput,const char *title):TNamed(anInput,title),
-   fHistMultOrig(NULL),
-   fHistMultRP(NULL),
-   fHistMultPOI(NULL),
-   fHistPtRP(NULL),
-   fHistPtPOI(NULL),
-   fHistPhiRP(NULL),
-   fHistPhiPOI(NULL),
-   fHistEtaRP(NULL),
-   fHistEtaPOI(NULL),
-   fHistProMeanPtperBin(NULL),
-   fHistQ(NULL),
-   fHarmonic(NULL),
-   fHistList(NULL)
- {
+  AliFlowCommonHist::AliFlowCommonHist(const char *anInput,const char *title):
+    TNamed(anInput,title),
+    fHistMultOrig(NULL),
+    fHistMultRP(NULL),
+    fHistMultPOI(NULL),
+    fHistPtRP(NULL),
+    fHistPtPOI(NULL),
+    fHistPtSub0(NULL),
+    fHistPtSub1(NULL),
+    fHistPhiRP(NULL),
+    fHistPhiPOI(NULL),
+    fHistPhiSub0(NULL),
+    fHistPhiSub1(NULL),
+    fHistEtaRP(NULL),
+    fHistEtaPOI(NULL),
+    fHistEtaSub0(NULL),
+    fHistEtaSub1(NULL),
+    fHistPhiEtaRP(NULL),
+    fHistPhiEtaPOI(NULL),
+    fHistProMeanPtperBin(NULL),
+    fHistQ(NULL),
+    fHarmonic(NULL),
+    fHistList(NULL)
+{
 
   //constructor creating histograms 
   Int_t iNbinsMult = AliFlowCommonConstants::GetMaster()->GetNbinsMult();
@@ -191,6 +226,18 @@ AliFlowCommonHist::AliFlowCommonHist(const AliFlowCommonHist& a):
   fHistPtPOI ->SetXTitle("P_{t} (GeV/c) for POI selection");
   fHistPtPOI ->SetYTitle("Counts");
 
+  sName = "Control_Flow_PtSub0_";
+  sName +=anInput;
+  fHistPtSub0 = new TH1F(sName.Data(), sName.Data(),iNbinsPt, dPtMin, dPtMax); 
+  fHistPtSub0 ->SetXTitle("P_{t} (GeV/c) for Subevent 0 selection");
+  fHistPtSub0 ->SetYTitle("Counts");
+
+  sName = "Control_Flow_PtSub1_";
+  sName +=anInput;
+  fHistPtSub1 = new TH1F(sName.Data(), sName.Data(),iNbinsPt, dPtMin, dPtMax); 
+  fHistPtSub1 ->SetXTitle("P_{t} (GeV/c) for Subevent 1 selection");
+  fHistPtSub1 ->SetYTitle("Counts");
+
   //Phi
   sName = "Control_Flow_PhiRP_";
   sName +=anInput;
@@ -204,6 +251,18 @@ AliFlowCommonHist::AliFlowCommonHist(const AliFlowCommonHist& a):
   fHistPhiPOI ->SetXTitle("#phi for POI selection");
   fHistPhiPOI ->SetYTitle("Counts");
 
+  sName = "Control_Flow_PhiSub0_";
+  sName +=anInput;
+  fHistPhiSub0 = new TH1F(sName.Data(), sName.Data(),iNbinsPhi, dPhiMin, dPhiMax);
+  fHistPhiSub0 ->SetXTitle("#phi for Subevent 0 selection");
+  fHistPhiSub0 ->SetYTitle("Counts");
+
+  sName = "Control_Flow_PhiSub1_";
+  sName +=anInput;
+  fHistPhiSub1 = new TH1F(sName.Data(), sName.Data(),iNbinsPhi, dPhiMin, dPhiMax);
+  fHistPhiSub1 ->SetXTitle("#phi for Subevent 1 selection");
+  fHistPhiSub1 ->SetYTitle("Counts");
+
   //Eta
   sName = "Control_Flow_EtaRP_";
   sName +=anInput;
@@ -217,6 +276,31 @@ AliFlowCommonHist::AliFlowCommonHist(const AliFlowCommonHist& a):
   fHistEtaPOI ->SetXTitle("#eta for POI selection");
   fHistEtaPOI ->SetYTitle("Counts");
 
+  sName = "Control_Flow_EtaSub0_";
+  sName +=anInput;
+  fHistEtaSub0 = new TH1F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax);
+  fHistEtaSub0 ->SetXTitle("#eta for Subevent 0 selection");
+  fHistEtaSub0 ->SetYTitle("Counts");
+
+  sName = "Control_Flow_EtaSub1_";
+  sName +=anInput;
+  fHistEtaSub1 = new TH1F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax);
+  fHistEtaSub1 ->SetXTitle("#eta for Subevent 1 selection");
+  fHistEtaSub1 ->SetYTitle("Counts");
+
+  //Phi vs Eta
+  sName = "Control_Flow_PhiEtaRP_";
+  sName +=anInput;
+  fHistPhiEtaRP = new TH2F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax, iNbinsPhi, dPhiMin, dPhiMax);
+  fHistPhiEtaRP ->SetXTitle("#eta");
+  fHistPhiEtaRP ->SetYTitle("#phi");
+
+  sName = "Control_Flow_PhiEtaPOI_";
+  sName +=anInput;
+  fHistPhiEtaPOI = new TH2F(sName.Data(), sName.Data(),iNbinsEta, dEtaMin, dEtaMax, iNbinsPhi, dPhiMin, dPhiMax);
+  fHistPhiEtaPOI ->SetXTitle("#eta");
+  fHistPhiEtaPOI ->SetYTitle("#phi");
+
   //Mean Pt per pt bin 
   sName = "Control_FlowPro_MeanPtperBin_";
   sName +=anInput;
@@ -243,16 +327,23 @@ AliFlowCommonHist::AliFlowCommonHist(const AliFlowCommonHist& a):
   fHistList-> Add(fHistMultRP);        
   fHistList-> Add(fHistMultPOI);       
   fHistList-> Add(fHistPtRP);          
-  fHistList-> Add(fHistPtPOI);         
+  fHistList-> Add(fHistPtPOI); 
+  fHistList-> Add(fHistPtSub0);
+  fHistList-> Add(fHistPtSub1);
   fHistList-> Add(fHistPhiRP);          
-  fHistList-> Add(fHistPhiPOI);         
+  fHistList-> Add(fHistPhiPOI);
+  fHistList-> Add(fHistPhiSub0);
+  fHistList-> Add(fHistPhiSub1);
   fHistList-> Add(fHistEtaRP);          
-  fHistList-> Add(fHistEtaPOI);         
+  fHistList-> Add(fHistEtaPOI); 
+  fHistList-> Add(fHistEtaSub0); 
+  fHistList-> Add(fHistEtaSub1);
+  fHistList-> Add(fHistPhiEtaRP);  
+  fHistList-> Add(fHistPhiEtaPOI);
   fHistList-> Add(fHistProMeanPtperBin);
   fHistList-> Add(fHarmonic);  
   fHistList-> Add(fHistQ);           
 
-
 }
 
 
@@ -265,11 +356,19 @@ AliFlowCommonHist::~AliFlowCommonHist()
   delete fHistMultRP;       
   delete fHistMultPOI;      
   delete fHistPtRP;         
-  delete fHistPtPOI;       
+  delete fHistPtPOI;
+  delete fHistPtSub0;
+  delete fHistPtSub1;
   delete fHistPhiRP;        
-  delete fHistPhiPOI;       
+  delete fHistPhiPOI;
+  delete fHistPhiSub0;
+  delete fHistPhiSub1;
   delete fHistEtaRP;        
   delete fHistEtaPOI;
+  delete fHistEtaSub0;
+  delete fHistEtaSub1;
+  delete fHistPhiEtaRP;
+  delete fHistPhiEtaPOI;
   delete fHistProMeanPtperBin;
   delete fHistQ;
   delete fHarmonic;
@@ -314,24 +413,49 @@ Bool_t AliFlowCommonHist::FillControlHistograms(AliFlowEventSimple* anEvent)
     pTrack = anEvent->GetTrack(i);
     if (pTrack ) {
       if (pTrack->InRPSelection()){
+       //pt
        dPt = pTrack->Pt();
        fHistPtRP->Fill(dPt);
+       //phi
        dPhi = pTrack->Phi();
        if (dPhi<0.) dPhi+=2*TMath::Pi();
        fHistPhiRP->Fill(dPhi);
+       //eta
        dEta = pTrack->Eta();
        fHistEtaRP->Fill(dEta);
+       //eta vs phi
+       fHistPhiEtaRP->Fill(dEta,dPhi);
+       //count
        iMultRP++;
+       if (pTrack->InSubevent(0)){
+         //Fill distributions for the subevent
+         fHistPtSub0 -> Fill(dPt);
+         fHistPhiSub0 -> Fill(dPhi);
+         fHistEtaSub0 -> Fill(dEta);
+       } 
+       else if (pTrack->InSubevent(1)){
+         //Fill distributions for the subevent
+         fHistPtSub1 -> Fill(dPt);
+         fHistPhiSub1 -> Fill(dPhi);
+         fHistEtaSub1 -> Fill(dEta);
+       } 
       }
       if (pTrack->InPOISelection()){
+       //pt
        dPt = pTrack->Pt();
        fHistPtPOI->Fill(dPt);
+       //phi
        dPhi = pTrack->Phi();
        if (dPhi<0.) dPhi+=2*TMath::Pi();
        fHistPhiPOI->Fill(dPhi);
+       //eta
        dEta = pTrack->Eta();
        fHistEtaPOI->Fill(dEta);
+       //eta vs phi
+       fHistPhiEtaPOI->Fill(dEta,dPhi);
+       //mean pt
        fHistProMeanPtperBin->Fill(dPt,dPt);
+       //count
        iMultPOI++;
       }
     } //track
index 28c9f1b..aa154dc 100644 (file)
@@ -14,6 +14,7 @@
 class AliFlowEventSimple;
 class AliFlowTrackSimple;
 class TH1F;
+class TH2F;
 class TH1D;
 class TProfile;
 class TCollection;
@@ -44,11 +45,19 @@ class AliFlowCommonHist: public TNamed {
   TH1F*     GetHistMultRP()          {return fHistMultRP; } ;  
   TH1F*     GetHistMultPOI()         {return fHistMultPOI; } ;  
   TH1F*     GetHistPtRP()            {return fHistPtRP; } ;  
-  TH1F*     GetHistPtPOI()           {return fHistPtPOI; } ;   
+  TH1F*     GetHistPtPOI()           {return fHistPtPOI; } ;
+  TH1F*     GetHistPtSub0()          {return fHistPtSub0; } ;
+  TH1F*     GetHistPtSub1()          {return fHistPtSub1; } ;
   TH1F*     GetHistPhiRP()           {return fHistPhiRP; } ;  
   TH1F*     GetHistPhiPOI()          {return fHistPhiPOI; } ;  
+  TH1F*     GetHistPhiSub0()         {return fHistPhiSub0; } ; 
+  TH1F*     GetHistPhiSub1()         {return fHistPhiSub1; } ; 
   TH1F*     GetHistEtaRP()           {return fHistEtaRP; } ;  
-  TH1F*     GetHistEtaPOI()          {return fHistEtaPOI;  } ;   
+  TH1F*     GetHistEtaPOI()          {return fHistEtaPOI;  } ;  
+  TH1F*     GetHistEtaSub0()         {return fHistEtaSub0;  } ; 
+  TH1F*     GetHistEtaSub1()         {return fHistEtaSub1;  } ; 
+  TH2F*     GetHistPhiEtaRP()        {return fHistPhiEtaRP;  } ; 
+  TH2F*     GetHistPhiEtaPOI()       {return fHistPhiEtaPOI;  } ; 
   TProfile* GetHistProMeanPtperBin() {return fHistProMeanPtperBin; } ;
   TH1F*     GetHistQ()               {return fHistQ; } ;    
   TProfile* GetHarmonic()            {return fHarmonic; } ;        
@@ -70,10 +79,18 @@ class AliFlowCommonHist: public TNamed {
   TH1F*     fHistMultPOI;         //multiplicity for POI selection
   TH1F*     fHistPtRP;            //pt distribution for RP selection
   TH1F*     fHistPtPOI;           //pt distribution for POI selection
+  TH1F*     fHistPtSub0;          //pt distribution for subevent 0
+  TH1F*     fHistPtSub1;          //pt distribution for subevent 1
   TH1F*     fHistPhiRP;           //phi distribution for RP selection
   TH1F*     fHistPhiPOI;          //phi distribution for POI selection
+  TH1F*     fHistPhiSub0;         //phi distribution for subevent 0
+  TH1F*     fHistPhiSub1;         //phi distribution for subevent 1
   TH1F*     fHistEtaRP;           //eta distribution for RP selection
   TH1F*     fHistEtaPOI;          //eta distribution for POI selection
+  TH1F*     fHistEtaSub0;         //eta distribution for subevent 0
+  TH1F*     fHistEtaSub1;         //eta distribution for subevent 1
+  TH2F*     fHistPhiEtaRP;        //eta vs phi for RP selection
+  TH2F*     fHistPhiEtaPOI;       //eta vs phi for POI selection
   TProfile* fHistProMeanPtperBin; //mean pt for each pt bin (for POI selection)
   TH1F*     fHistQ;               //Qvector distribution
   TProfile* fHarmonic;            //harmonic 
index 232c0a6..6cbf50e 100644 (file)
@@ -159,7 +159,7 @@ void AliFlowEventSimple::Generate(Int_t nParticles,
   {
     AddTrack(new AliFlowTrackSimple( gRandom->Uniform(phiMin,phiMax),
                                      gRandom->Uniform(etaMin,etaMax),
-                                     ptDist->GetRandom()));
+                                     ptDist->GetRandom(),1.));
   }
 }
 
@@ -191,21 +191,22 @@ AliFlowVector AliFlowEventSimple::GetQ(Int_t n, TList *weightsList, Bool_t usePh
 
   Int_t iOrder = n;
   Double_t iUsedTracks = 0;
-  Double_t dPhi=0.;
-  Double_t dPt=0.;
-  Double_t dEta=0.;
+  Double_t dPhi = 0.;
+  Double_t dPt = 0.;
+  Double_t dEta = 0.;
+  Double_t dWeight = 1.;
 
   AliFlowTrackSimple* pTrack = NULL;
 
-  Int_t nBinsPhi=0;
-  Double_t dBinWidthPt=0.;
-  Double_t dPtMin=0.;
-  Double_t dBinWidthEta=0.;
-  Double_t dEtaMin=0.;
+  Int_t nBinsPhi = 0;
+  Double_t dBinWidthPt = 0.;
+  Double_t dPtMin = 0.;
+  Double_t dBinWidthEta = 0.;
+  Double_t dEtaMin = 0.;
 
-  Double_t wPhi=1.; // weight Phi
-  Double_t wPt=1.;  // weight Pt
-  Double_t wEta=1.; // weight Eta
+  Double_t wPhi = 1.; // weight Phi
+  Double_t wPt = 1.;  // weight Pt
+  Double_t wEta = 1.; // weight Eta
 
   TH1F *phiWeights = NULL;
   TH1D *ptWeights  = NULL;
@@ -249,6 +250,7 @@ AliFlowVector AliFlowEventSimple::GetQ(Int_t n, TList *weightsList, Bool_t usePh
         dPhi = pTrack->Phi();
         dPt  = pTrack->Pt();
         dEta = pTrack->Eta();
+       dWeight = pTrack->Weight();
 
         // determine Phi weight: (to be improved, I should here only access it + the treatment of gaps in the if statement)
         if(phiWeights && nBinsPhi)
@@ -267,11 +269,11 @@ AliFlowVector AliFlowEventSimple::GetQ(Int_t n, TList *weightsList, Bool_t usePh
         }
 
         // building up the weighted Q-vector:
-        dQX += wPhi*wPt*wEta*TMath::Cos(iOrder*dPhi);
-        dQY += wPhi*wPt*wEta*TMath::Sin(iOrder*dPhi);
+        dQX += dWeight*wPhi*wPt*wEta*TMath::Cos(iOrder*dPhi);
+        dQY += dWeight*wPhi*wPt*wEta*TMath::Sin(iOrder*dPhi);
 
         // weighted multiplicity:
-        iUsedTracks+=wPhi*wPt*wEta;
+        iUsedTracks += dWeight*wPhi*wPt*wEta;
 
       } // end of if (pTrack->InRPSelection())
     } // end of if (pTrack)
@@ -301,10 +303,12 @@ void AliFlowEventSimple::Get2Qsub(AliFlowVector* Qarray, Int_t n, TList *weights
   Double_t dPhi = 0.;
   Double_t dPt  = 0.;
   Double_t dEta = 0.;
+  Double_t dWeight = 1.;
 
   AliFlowTrackSimple* pTrack = NULL;
 
-  Int_t    iNbinsPhi   = 0;
+  Int_t    iNbinsPhiSub0 = 0;
+  Int_t    iNbinsPhiSub1 = 0;
   Double_t dBinWidthPt = 0.;
   Double_t dPtMin      = 0.;
   Double_t dBinWidthEta= 0.;
@@ -314,7 +318,8 @@ void AliFlowEventSimple::Get2Qsub(AliFlowVector* Qarray, Int_t n, TList *weights
   Double_t dWpt  = 1.;  // weight Pt
   Double_t dWeta = 1.;  // weight Eta
 
-  TH1F* phiWeights = NULL;
+  TH1F* phiWeightsSub0 = NULL;
+  TH1F* phiWeightsSub1 = NULL;
   TH1D* ptWeights  = NULL;
   TH1D* etaWeights = NULL;
 
@@ -322,10 +327,13 @@ void AliFlowEventSimple::Get2Qsub(AliFlowVector* Qarray, Int_t n, TList *weights
   {
     if(usePhiWeights)
     {
-      phiWeights = dynamic_cast<TH1F *>(weightsList->FindObject("phi_weights"));
-      if(phiWeights)
-      {
-        iNbinsPhi = phiWeights->GetNbinsX();
+      phiWeightsSub0 = dynamic_cast<TH1F *>(weightsList->FindObject("phi_weights_sub0"));
+      phiWeightsSub1 = dynamic_cast<TH1F *>(weightsList->FindObject("phi_weights_sub1"));
+      if(phiWeightsSub0) {
+        iNbinsPhiSub0 = phiWeightsSub0->GetNbinsX();
+      }
+      if(phiWeightsSub1) {
+        iNbinsPhiSub1 = phiWeightsSub1->GetNbinsX();
       }
     }
     if(usePtWeights)
@@ -361,20 +369,28 @@ void AliFlowEventSimple::Get2Qsub(AliFlowVector* Qarray, Int_t n, TList *weights
         {
           if (pTrack->InSubevent(s))
           {
-            dPhi = pTrack->Phi();
-            dPt  = pTrack->Pt();
-            dEta = pTrack->Eta();
+            dPhi    = pTrack->Phi();
+            dPt     = pTrack->Pt();
+            dEta    = pTrack->Eta();
+           dWeight = pTrack->Weight();
 
             // determine Phi weight: (to be improved, I should here only access it + the treatment of gaps in the if statement)
-            if(phiWeights && iNbinsPhi)
-            {
-              dWphi = phiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*iNbinsPhi/TMath::TwoPi())));
-            }
+            if(s == 0) { //subevent 0
+             if(phiWeightsSub0 && iNbinsPhiSub0){
+               dWphi = phiWeightsSub0->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*iNbinsPhiSub0/TMath::TwoPi())));
+             } 
+           } else if (s == 1) {
+             if(phiWeightsSub1 && iNbinsPhiSub1){
+               dWphi = phiWeightsSub1->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*iNbinsPhiSub1/TMath::TwoPi())));
+             } 
+           }
+
             // determine v'(pt) weight:
             if(ptWeights && dBinWidthPt)
             {
               dWpt=ptWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-dPtMin)/dBinWidthPt)));
             }
+
             // determine v'(eta) weight:
             if(etaWeights && dBinWidthEta)
             {
@@ -382,11 +398,11 @@ void AliFlowEventSimple::Get2Qsub(AliFlowVector* Qarray, Int_t n, TList *weights
             }
 
             // building up the weighted Q-vector:
-            dQX += dWphi*dWpt*dWeta*TMath::Cos(iOrder*dPhi);
-            dQY += dWphi*dWpt*dWeta*TMath::Sin(iOrder*dPhi);
+            dQX += dWeight*dWphi*dWpt*dWeta*TMath::Cos(iOrder*dPhi);
+            dQY += dWeight*dWphi*dWpt*dWeta*TMath::Sin(iOrder*dPhi);
 
             // weighted multiplicity:
-            iUsedTracks+=dWphi*dWpt*dWeta;
+            iUsedTracks+=dWeight*dWphi*dWpt*dWeta;
 
           } // end of subevent
         } // end of if (pTrack->InRPSelection())
index 5e607e4..c3c7302 100644 (file)
@@ -36,6 +36,7 @@ AliFlowTrackSimple::AliFlowTrackSimple():
   fEta(0),
   fPt(0),
   fPhi(0),
+  fTrackWeight(1.),
   fFlowBits(0),
   fSubEventBits(0)
 {
@@ -43,11 +44,12 @@ AliFlowTrackSimple::AliFlowTrackSimple():
 }
 
 //-----------------------------------------------------------------------
-AliFlowTrackSimple::AliFlowTrackSimple(Double_t phi, Double_t eta, Double_t pt):
+AliFlowTrackSimple::AliFlowTrackSimple(Double_t phi, Double_t eta, Double_t pt, Double_t weight):
   TObject(),
   fEta(eta),
   fPt(pt),
   fPhi(phi),
+  fTrackWeight(weight),
   fFlowBits(0),
   fSubEventBits(0)
 {
@@ -60,6 +62,7 @@ AliFlowTrackSimple::AliFlowTrackSimple(const TParticle* p):
   fEta(p->Eta()),
   fPt(p->Pt()),
   fPhi(p->Phi()),
+  fTrackWeight(1.),
   fFlowBits(0),
   fSubEventBits(0)
 {
@@ -72,6 +75,7 @@ AliFlowTrackSimple::AliFlowTrackSimple(const AliFlowTrackSimple& aTrack):
   fEta(aTrack.fEta),
   fPt(aTrack.fPt),
   fPhi(aTrack.fPhi),
+  fTrackWeight(aTrack.fTrackWeight),
   fFlowBits(aTrack.fFlowBits),
   fSubEventBits(aTrack.fSubEventBits)
 {
@@ -91,6 +95,7 @@ AliFlowTrackSimple& AliFlowTrackSimple::operator=(const AliFlowTrackSimple& aTra
   fEta = aTrack.fEta;
   fPt = aTrack.fPt;
   fPhi = aTrack.fPhi;
+  fTrackWeight = aTrack.fTrackWeight;
   fFlowBits = aTrack.fFlowBits;
   fSubEventBits = aTrack.fSubEventBits;
 
@@ -206,7 +211,7 @@ void AliFlowTrackSimple::AddFlow( Double_t v1,
 void AliFlowTrackSimple::Print( Option_t* /*option*/ ) const
 {
   //print stuff
-  printf("Phi: %.3f, Eta: %+.3f, Pt: %.3f",fPhi,fEta,fPt);
+  printf("Phi: %.3f, Eta: %+.3f, Pt: %.3f, weight: %.3f",fPhi,fEta,fPt,fTrackWeight);
   if (InRPSelection()) printf(", RP");
   if (InPOISelection()) printf(", POI");
   for (Int_t i=0; i<2; i++)
index bf346e9..3e0f113 100644 (file)
@@ -20,7 +20,7 @@ public:
   AliFlowTrackSimple();
   AliFlowTrackSimple(const TParticle* p);
   AliFlowTrackSimple(const AliFlowTrackSimple& aTrack);
-  AliFlowTrackSimple(Double_t phi, Double_t eta, Double_t pt);
+  AliFlowTrackSimple(Double_t phi, Double_t eta, Double_t pt, Double_t weight);
   virtual AliFlowTrackSimple& operator=(const AliFlowTrackSimple& aTrack);
   virtual  ~AliFlowTrackSimple();
   virtual AliFlowTrackSimple* Clone(const char* option="") const;
@@ -31,7 +31,8 @@ public:
 
   Double_t Eta() const; 
   Double_t Pt()  const; 
-  Double_t Phi() const; 
+  Double_t Phi() const;
+  Double_t Weight() const; 
 
   Bool_t InRPSelection() const; 
   Bool_t InPOISelection() const; 
@@ -41,6 +42,7 @@ public:
   void SetEta(Double_t eta);
   void SetPt(Double_t pt); 
   void SetPhi(Double_t phi);
+  void SetWeight(Double_t weight);
   void SetForRPSelection(Bool_t b=kTRUE); 
   void SetForPOISelection(Bool_t b=kTRUE); 
   void SetForSubevent(Int_t i); 
@@ -69,24 +71,28 @@ public:
                 Int_t maxNumberOfIterations=100 );
     
   const TBits* GetFlowBits() const {return &fFlowBits;}
+
  private:
-  Double_t fEta;    // eta
-  Double_t fPt;     // pt
-  Double_t fPhi;    // phi
-  TBits fFlowBits;  // bits to set if track is selected
-  TBits fSubEventBits;  // bits to set if track is selected for a subevent
+  Double_t fEta;         // eta
+  Double_t fPt;          // pt
+  Double_t fPhi;         // phi
+  Double_t fTrackWeight; // weight
+  TBits    fFlowBits;    // bits to set if track is selected
+  TBits    fSubEventBits;// bits to set if track is selected for a subevent
 
   ClassDef(AliFlowTrackSimple,1)                 // macro for rootcint
 
 };
 
+//Setters
 inline Double_t AliFlowTrackSimple::Eta() const { 
   return this->fEta; }
 inline Double_t AliFlowTrackSimple::Pt() const {  
-  //  cout << "Returned pt:" << fPt << endl; 
   return this->fPt;}
 inline Double_t AliFlowTrackSimple::Phi() const { 
   return this->fPhi; }
+inline Double_t AliFlowTrackSimple::Weight() const { 
+  return this->fTrackWeight; }
 //TBits
 inline Bool_t AliFlowTrackSimple::InRPSelection() const { 
   return this->fFlowBits.TestBitNumber(0); }
@@ -95,13 +101,15 @@ inline Bool_t AliFlowTrackSimple::InPOISelection() const {
 inline Bool_t AliFlowTrackSimple::InSubevent(Int_t i) const { 
   return this->fSubEventBits.TestBitNumber(i); }
 
+//Getters
 inline void AliFlowTrackSimple::SetEta(Double_t val) {
   fEta = val; }
 inline void AliFlowTrackSimple::SetPt(Double_t val) {
   fPt = val; }
-  //  cout << "pt set to:" << fPt << endl;}
 inline void AliFlowTrackSimple::SetPhi(Double_t val) {
   fPhi = val; }
+inline void AliFlowTrackSimple::SetWeight(Double_t val) {
+  fTrackWeight = val; }
 //TBits
 inline void AliFlowTrackSimple::SetForRPSelection(Bool_t val) {
   fFlowBits.SetBitNumber(0,val); }
index 35ae9ec..b5859cb 100644 (file)
@@ -30,6 +30,7 @@
 #include "TTree.h"
 #include "TFile.h" //needed as include
 #include "TList.h"
+#include "TH2F.h"
 #include "TRandom3.h"
 #include "TTimeStamp.h"
 
@@ -100,11 +101,11 @@ AliAnalysisTaskFlowEvent::AliAnalysisTaskFlowEvent() :
 }
 
 //________________________________________________________________________
-AliAnalysisTaskFlowEvent::AliAnalysisTaskFlowEvent(const char *name, Bool_t on, UInt_t iseed) :
+AliAnalysisTaskFlowEvent::AliAnalysisTaskFlowEvent(const char *name, TString RPtype, Bool_t on, UInt_t iseed) :
   AliAnalysisTaskSE(name),
   //  fOutputFile(NULL),
   fAnalysisType("ESD"),
-  fRPType("Global"),
+  fRPType(RPtype),
   fCFManager1(NULL),
   fCFManager2(NULL),
   fQAInt(NULL),
@@ -131,6 +132,10 @@ AliAnalysisTaskFlowEvent::AliAnalysisTaskFlowEvent(const char *name, Bool_t on,
   fMyTRandom3 = new TRandom3(iseed);
   gRandom->SetSeed(fMyTRandom3->Integer(65539));
 
+  //FMD input slot
+  if (strcmp(RPtype,"FMD")==0) {
+    DefineInput(1, TList::Class());
+  }
 
   // Define output slots here
   // Define here the flow event output
@@ -180,8 +185,21 @@ void AliAnalysisTaskFlowEvent::UserExec(Option_t *)
   AliESDEvent* myESD = dynamic_cast<AliESDEvent*>(InputEvent()); // from TaskSE
   AliAODEvent* myAOD = dynamic_cast<AliAODEvent*>(InputEvent()); // from TaskSE
   AliMultiplicity* myTracklets = NULL;
+  TH2F* histFMD = NULL;
 
-  /*test*/ cout<<"(AliAnalysisTaskFlowEvent::UserExec)fRPType = "<<fRPType<<endl;
+  if(GetNinputs()==2) {                   
+    TList* FMDdata = dynamic_cast<TList*>(GetInputData(1));
+    if(!FMDdata) {
+      cout<<" No FMDdata "<<endl;
+      exit(2);
+    }
+    histFMD = dynamic_cast<TH2F*>(FMDdata->FindObject("dNdetadphiHistogramTrVtx"));
+    if (!histFMD) {
+      cout<< "No histFMD"<<endl;
+      exit(2);
+    }
+  }
+  
 
   // Make the FlowEvent for MC input
   if (fAnalysisType == "MC")
@@ -243,6 +261,10 @@ void AliAnalysisTaskFlowEvent::UserExec(Option_t *)
     else if (fRPType == "Tracklet"){
       flowEvent = new AliFlowEvent(myESD,myTracklets,fCFManager2);
     }
+    else if (fRPType == "FMD"){
+      flowEvent = new AliFlowEvent(myESD,histFMD,fCFManager2);
+    }
+    
     // if monte carlo event get reaction plane from monte carlo (depends on generator)
     if (mcEvent && mcEvent->GenEventHeader()) flowEvent->SetMCReactionPlaneAngle(mcEvent);
     //set reference multiplicity, TODO: maybe move it to the constructor?
index cfccaba..b92e0f2 100644 (file)
@@ -21,7 +21,7 @@ class TString;
 class AliAnalysisTaskFlowEvent : public AliAnalysisTaskSE {
  public:
   AliAnalysisTaskFlowEvent();
-  AliAnalysisTaskFlowEvent(const char *name,Bool_t QAon,UInt_t=666);
+  AliAnalysisTaskFlowEvent(const char *name,TString RPtype,Bool_t QAon,UInt_t=666);
   virtual ~AliAnalysisTaskFlowEvent();
   
   virtual void   UserCreateOutputObjects();
@@ -80,7 +80,7 @@ class AliAnalysisTaskFlowEvent : public AliAnalysisTaskSE {
   //  AliESDEvent*  fESD;                   // ESD object
   //  AliAODEvent*  fAOD;                   // AOD object
   TString       fAnalysisType;          // can be MC, ESD or AOD
-  TString       fRPType;                // can be Global or Tracklet
+  TString       fRPType;                // can be Global or Tracklet or FMD
   AliCFManager* fCFManager1;            // correction framework manager
   AliCFManager* fCFManager2;            // correction framework manager
   TList*        fQAInt;                 // QA histogram list
index 883fd49..b234270 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "Riostream.h"
 #include "TList.h"
+#include "TH2F.h"
 #include "AliMCEvent.h"
 #include "AliMCParticle.h"
 #include "AliCFManager.h"
@@ -364,8 +365,8 @@ AliFlowEvent::AliFlowEvent( const AliESDEvent* anInput,
 
 //-----------------------------------------------------------------------
 AliFlowEvent::AliFlowEvent( const AliESDEvent* anInput,
-                                             const AliMultiplicity* anInputTracklets,
-                                             const AliCFManager* poiCFManager ):
+                           const AliMultiplicity* anInputTracklets,
+                           const AliCFManager* poiCFManager ):
   AliFlowEventSimple(20)
 {
 
@@ -405,9 +406,7 @@ AliFlowEvent::AliFlowEvent( const AliESDEvent* anInput,
   //Select the reference particles from the SPD tracklets
   anInputTracklets = anInput->GetMultiplicity();
   Int_t multSPD = anInputTracklets->GetNumberOfTracklets();
-
-  cout << "N tracklets: " << multSPD << endl; //for testing
-
+  
   //loop over tracklets
   for (Int_t itracklet=0; itracklet<multSPD; ++itracklet) {
     Float_t thetaTr= anInputTracklets->GetTheta(itracklet);
@@ -432,3 +431,75 @@ AliFlowEvent::AliFlowEvent( const AliESDEvent* anInput,
 }
 
 
+//-----------------------------------------------------------------------
+AliFlowEvent::AliFlowEvent( const AliESDEvent* anInput,
+                           const TH2F* anInputFMDhist,
+                           const AliCFManager* poiCFManager ):
+  AliFlowEventSimple(20)
+{
+
+  //Select the particles of interest from the ESD
+  Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ;
+
+  //loop over tracks
+  for (Int_t itrkN=0; itrkN<iNumberOfInputTracks; itrkN++)
+    {
+      AliESDtrack* pParticle = anInput->GetTrack(itrkN);   //get input particle
+
+      //check if pParticle passes the cuts
+      Bool_t poiOK = kTRUE;
+      if (poiCFManager)
+       {
+         poiOK = ( poiCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle) &&
+                   poiCFManager->CheckParticleCuts(AliCFManager::kPartSelCuts,pParticle));
+       }
+      if (!poiOK) continue;
+      //make new AliFLowTrack
+      AliFlowTrack* pTrack = new AliFlowTrack();
+      pTrack->SetPt(pParticle->Pt() );
+      pTrack->SetEta(pParticle->Eta() );
+      pTrack->SetPhi(pParticle->Phi() );
+          
+      //marking the particles used for the particle of interest (POI) selection:
+      if(poiOK && poiCFManager)
+       {
+         pTrack->SetForPOISelection(kTRUE);
+         pTrack->SetSource(AliFlowTrack::kFromESD);
+       }
+
+      AddTrack(pTrack);
+    }//end of while (itrkN < iNumberOfInputTracks)
+
+  //Select the reference particles from the FMD hits
+  //loop over FMD histogram
+  Int_t iBinsEta = anInputFMDhist->GetNbinsX();
+  Int_t iBinsPhi = anInputFMDhist->GetNbinsY();
+  
+  for (Int_t iEta = 1; iEta <= iBinsEta; iEta++){
+    Double_t etaFMD = anInputFMDhist->GetXaxis()->GetBinCenter(iEta);
+    for (Int_t iPhi = 1; iPhi <= iBinsPhi; iPhi++){
+      Double_t phiFMD = anInputFMDhist->GetYaxis()->GetBinCenter(iPhi);
+      Double_t weightFMD = anInputFMDhist->GetBinContent(iEta,iPhi);
+    
+      if (weightFMD > 0.0) { //do not add empty bins
+       //make new AliFLowTrackSimple
+       AliFlowTrack* pTrack = new AliFlowTrack();
+       pTrack->SetPt(0.0);
+       pTrack->SetEta(etaFMD);
+       pTrack->SetPhi(phiFMD);
+       pTrack->SetWeight(weightFMD);
+       //marking the particles used for the reference particle (RP) selection:
+       pTrack->SetForRPSelection(kTRUE);
+       pTrack->SetSource(AliFlowTrack::kFromFMD);
+       fNumberOfRPs++;
+
+       //Add the track to the flowevent
+       AddTrack(pTrack);
+       
+      }
+    }
+  }
+
+}
+
index 6f72d35..a90fc30 100644 (file)
@@ -20,6 +20,7 @@ class AliESDEvent;
 class AliMCEvent;
 class AliAODEvent;
 class AliMultiplicity;
+class TH2F;
 
 #include "AliFlowEventSimple.h"
 
@@ -50,6 +51,10 @@ public:
   AliFlowEvent( const AliESDEvent* anInput,
                 const AliMultiplicity* anInputTracklets,
                 const AliCFManager* poiCFManager );
+  AliFlowEvent( const AliESDEvent* anInput,
+                const TH2F* anInputFMDhist,
+                const AliCFManager* poiCFManager );
+
 
   void SetMCReactionPlaneAngle(const AliMCEvent* mcEvent);
 
index 90245cf..fdf4953 100644 (file)
@@ -27,17 +27,15 @@ ClassImp(AliFlowTrack)
 //-----------------------------------------------------------------------
 AliFlowTrack::AliFlowTrack():
   AliFlowTrackSimple(),
-  fTrackSourceBits(),
-  fFMDmultiplicity(0.)
+  fTrackSourceBits() 
 {
   //constructor 
 }
 
 //-----------------------------------------------------------------------
 AliFlowTrack::AliFlowTrack(AliVParticle* p):
-  AliFlowTrackSimple(p->Phi(),p->Eta(),p->Pt()),
-  fTrackSourceBits(),
-  fFMDmultiplicity(0.)
+  AliFlowTrackSimple(p->Phi(),p->Eta(),p->Pt(),1.),
+  fTrackSourceBits()
 {
   //constructor 
 }
@@ -45,8 +43,7 @@ AliFlowTrack::AliFlowTrack(AliVParticle* p):
 //-----------------------------------------------------------------------
 AliFlowTrack::AliFlowTrack(const AliFlowTrack& aTrack):
   AliFlowTrackSimple(aTrack),
-  fTrackSourceBits(aTrack.fTrackSourceBits),
-  fFMDmultiplicity(aTrack.fFMDmultiplicity)
+  fTrackSourceBits(aTrack.fTrackSourceBits)
 {
   //copy constructor 
 }
@@ -64,7 +61,6 @@ AliFlowTrack& AliFlowTrack::operator=(const AliFlowTrack& aTrack)
   //assignment
   AliFlowTrackSimple::operator=(aTrack);
   fTrackSourceBits = aTrack.fTrackSourceBits;
-  fFMDmultiplicity = aTrack.fFMDmultiplicity;
   return *this;
 }
 
@@ -77,12 +73,10 @@ AliFlowTrackSimple& AliFlowTrack::operator=(const AliFlowTrackSimple& aTrack)
   if (pft)
   {
     fTrackSourceBits = pft->fTrackSourceBits;
-    fFMDmultiplicity = pft->fFMDmultiplicity;
   }
   else
   {
     fTrackSourceBits.ResetAllBits();
-    fFMDmultiplicity=0.;
   }
   return *this;
 }
index a901958..60abb28 100644 (file)
@@ -28,8 +28,6 @@ public:
   virtual  ~AliFlowTrack();
   virtual AliFlowTrack* Clone(const char* option="") const;
  
-  void SetFMDMultiplicity( const Float_t m ) {fFMDmultiplicity=m;} 
-  Float_t GetFMDMultiplicity() const {return fFMDmultiplicity;}
   void SetSource( trackSource s )
                   { fTrackSourceBits.SetBitNumber(UInt_t(s),kTRUE); }
   Bool_t IsSource( trackSource s ) const
@@ -37,9 +35,7 @@ public:
 
 private:
   TBits fTrackSourceBits; //where do i come from?
-  Float_t fFMDmultiplicity; //FMD multiplicity
   
-
   ClassDef(AliFlowTrack,1);
 };
 
index 4b9f829..43ce147 100644 (file)
@@ -8,9 +8,15 @@
 /////////////////////////////////////////////////////////////////////////////////////////////
 
 // Define the range for eta subevents (for SP method)
+//(FMD 1.7 - 5.0)
+//Double_t minA = -5.0;
+//Double_t maxA = -1.7;
+//Double_t minB = 1.7;
+//Double_t maxB = 5.0;
+//(Tracklets 0.9 - 2.0)
 Double_t minA = -2.0;
-Double_t maxA = -0.1;
-Double_t minB = 0.1;
+Double_t maxA = -0.9;
+Double_t minB = 0.9;
 Double_t maxB = 2.0;
 
 // use physics selection class
@@ -43,9 +49,11 @@ const Int_t multmax = 10000;     //used for AliFlowEventSimple (to set the centr
 
 
 //----------For RP selection----------
-// Use Global tracks ("Global") or SPD tracklets ("Tracklet") for the RP selection
+// Use Global tracks ("Global"), or SPD tracklets ("Tracklet") 
+// or FMD hits ("FMD") for the RP selection
 const TString rptype = "Global";
 //const TString rptype = "Tracklet";
+//const TString rptype = "FMD";
 
 //KINEMATICS (on generated and reconstructed tracks)
 Bool_t UseKineforRP =  kTRUE;
@@ -302,6 +310,18 @@ AliAnalysisTaskFlowEvent* AddTaskFlow(TString type, Bool_t* METHODS, Bool_t QA,
     cout<<"LYZEP input file/list read..."<<endl;
   }
   
+  // Create the FMD task and add it to the manager
+  //===========================================================================
+  AliFMDAnalysisTaskSE *taskfmd = NULL;
+  if (rptype == "FMD") {
+    taskfmd = new AliFMDAnalysisTaskSE("TaskFMD");
+    mgr->AddTask(taskfmd);
+  
+    AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
+    pars->Init();
+    pars->SetProcessPrimary(kTRUE);
+    pars->SetProcessHits(kFALSE);
+  }
 
 
   // Create the task, add it to the manager.
@@ -309,9 +329,9 @@ AliAnalysisTaskFlowEvent* AddTaskFlow(TString type, Bool_t* METHODS, Bool_t QA,
   AliAnalysisTaskFlowEvent *taskFE = NULL;
   if (QA) { 
     if(AddToEvent) { 
-      taskFE = new AliAnalysisTaskFlowEvent("TaskFlowEvent",kTRUE,1);
+      taskFE = new AliAnalysisTaskFlowEvent("TaskFlowEvent",rptype,kTRUE,1);
       taskFE->SetEllipticFlowValue(ellipticFlow); }    //TEST
-    else {taskFE = new AliAnalysisTaskFlowEvent("TaskFlowEvent",kTRUE); }
+    else {taskFE = new AliAnalysisTaskFlowEvent("TaskFlowEvent",rptype,kTRUE); }
     taskFE->SetAnalysisType(type);
     taskFE->SetRPType(rptype); //only for ESD
     if (UseMultCut) {
@@ -327,9 +347,9 @@ AliAnalysisTaskFlowEvent* AddTaskFlow(TString type, Bool_t* METHODS, Bool_t QA,
   }
   else { 
     if(AddToEvent) { 
-      taskFE = new AliAnalysisTaskFlowEvent("TaskFlowEvent",kFALSE,1);
+      taskFE = new AliAnalysisTaskFlowEvent("TaskFlowEvent",rptype,kFALSE,1);
       taskFE->SetEllipticFlowValue(ellipticFlow); }    //TEST
-    else {taskFE = new AliAnalysisTaskFlowEvent("TaskFlowEvent",kFALSE); }
+    else {taskFE = new AliAnalysisTaskFlowEvent("TaskFlowEvent",rptype,kFALSE); }
     taskFE->SetAnalysisType(type);
     if (UseMultCut) {
       taskFE->SetMinMult(multmin);
@@ -746,7 +766,19 @@ AliAnalysisTaskFlowEvent* AddTaskFlow(TString type, Bool_t* METHODS, Bool_t QA,
   // Connect to the input and output containers
   //===========================================================================
   AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
-  AliAnalysisDataContainer *coutputFE = mgr->CreateContainer("cobjFlowEventSimple",  AliFlowEventSimple::Class(),AliAnalysisManager::kExchangeContainer);
+  
+  if (rptype == "FMD") {
+    AliAnalysisDataContainer *coutputFMD = 
+      mgr->CreateContainer("BackgroundCorrected", TList::Class(), AliAnalysisManager::kExchangeContainer);                        
+    //input and output taskFMD     
+    mgr->ConnectInput(taskfmd, 0, cinput1);
+    mgr->ConnectOutput(taskfmd, 1, coutputFMD);
+    //input into taskFE
+    mgr->ConnectInput(taskFE,1,coutputFMD);
+  }
+
+  AliAnalysisDataContainer *coutputFE = 
+    mgr->CreateContainer("cobjFlowEventSimple",  AliFlowEventSimple::Class(),AliAnalysisManager::kExchangeContainer);
   mgr->ConnectInput(taskFE,0,cinput1); 
   mgr->ConnectOutput(taskFE,1,coutputFE);
 
index 6a6df34..67f8fa0 100644 (file)
@@ -31,9 +31,9 @@ Bool_t QA = kTRUE;
 Bool_t WEIGHTS[] = {kFALSE,kFALSE,kFALSE}; //Phi, v'(pt), v'(eta)
 
 
-//void runFlowTask(Int_t mode=mLocal, Int_t nRuns = 1, 
+void runFlowTask(Int_t mode=mLocal, Int_t nRuns = 1, 
 //Bool_t DATA = kTRUE, const Char_t* dataDir="/data/alice2/kolk/PP/data/LHC09d/104892/test", Int_t offset = 0)
-                //Bool_t DATA = kFALSE, const Char_t* dataDir="/data/alice2/kolk/PP/LHC09d10/104873", Int_t offset = 0)
+                Bool_t DATA = kFALSE, const Char_t* dataDir="/data/alice2/kolk/PP/LHC09d10/104873", Int_t offset = 0)
 
 //void runFlowTask(Int_t mode = mPROOF, Int_t nRuns = 50000000, 
                 //Bool_t DATA = kFALSE, const Char_t* dataDir="/PWG2/akisiel/Therminator_midcentral_ESD", Int_t offset=0)
@@ -42,7 +42,7 @@ Bool_t WEIGHTS[] = {kFALSE,kFALSE,kFALSE}; //Phi, v'(pt), v'(eta)
                 //Bool_t DATA = kFALSE, const Char_t* dataDir="/alice/sim/LHC10a18_140012", Int_t offset=0) //perugia0 7 TeV
                 //Bool_t DATA = kFALSE, const Char_t* dataDir="/alice/sim/LHC10a20_140514", Int_t offset=0) //phojet 7 TeV
 
-void runFlowTask(Int_t mode = mGRID, Bool_t DATA = kTRUE)
+//void runFlowTask(Int_t mode = mGRID, Bool_t DATA = kTRUE)
 {
   TStopwatch timer;
   timer.Start();
@@ -74,10 +74,10 @@ void runFlowTask(Int_t mode = mGRID, Bool_t DATA = kTRUE)
   if (type == "ESD"){
     AliVEventHandler* esdH = new AliESDInputHandler;
     mgr->SetInputEventHandler(esdH);
-    if (MCEP) { 
+    //if (MCEP) { //Because of FMD task
       AliMCEventHandler *mc = new AliMCEventHandler();
       mgr->SetMCtruthEventHandler(mc); 
-    }
+      //}
   }
   
   if (type == "AOD"){
@@ -178,6 +178,8 @@ void LoadLibraries(const anaModes mode) {
     gSystem->Load("libCORRFW");
     cerr<<"libCORRFW loaded..."<<endl;
     if (mode==mLocal) {
+      gSystem->Load("libPWG2forward");
+      cerr<<"libPWG2forward loaded..."<<endl;
       gSystem->Load("libPWG2flowCommon");
       cerr<<"libPWG2flowCommon loaded..."<<endl;
       gSystem->Load("libPWG2flowTasks");