New classes for event plane calculation (Johanna)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 8 Apr 2011 08:25:44 +0000 (08:25 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 8 Apr 2011 08:25:44 +0000 (08:25 +0000)
18 files changed:
ANALYSIS/ANALYSISaliceLinkDef.h
ANALYSIS/AliAnalysisTaskESDfilter.cxx
ANALYSIS/AliEPSelectionTask.cxx [new file with mode: 0644]
ANALYSIS/AliEPSelectionTask.h [new file with mode: 0644]
ANALYSIS/CMakelibANALYSISalice.pkg
ANALYSIS/macros/AddTaskEventplane.C [new file with mode: 0644]
STEER/AliAODEvent.h
STEER/AliAODHeader.cxx
STEER/AliAODHeader.h
STEER/AliESDEvent.cxx
STEER/AliESDEvent.h
STEER/AliEventplane.cxx [new file with mode: 0644]
STEER/AliEventplane.h [new file with mode: 0644]
STEER/AliMCEvent.h
STEER/AliMixedEvent.h
STEER/AliVEvent.h
STEER/CMakelibSTEERBase.pkg
STEER/STEERBaseLinkDef.h

index 9b0cebc..b0d64d6 100644 (file)
@@ -35,6 +35,7 @@
 #pragma link C++ class AliCollisionNormalizationTask+;
 #pragma link C++ class AliAnalysisTaskAODCentralityMaker+;
 #pragma link C++ class AliCentralitySelectionTask+;
+#pragma link C++ class AliEPSelectionTask+;
 #pragma link C++ class AliAnalysisTaskStat+;
 #pragma link C++ class AliMultiInputEventHandler+;
 #pragma link C++ class AliAnalysisTaskPIDResponse+;
index bda6541..1c89405 100644 (file)
@@ -38,6 +38,7 @@
 #include "AliESDMuonTrack.h"\r
 #include "AliESDVertex.h"\r
 #include "AliCentrality.h"\r
+#include "AliEventplane.h"\r
 #include "AliESDv0.h"\r
 #include "AliESDkink.h"\r
 #include "AliESDcascade.h"\r
@@ -254,6 +255,7 @@ AliAODHeader* AliAnalysisTaskESDfilter::ConvertHeader(const AliESDEvent& esd)
     header->SetEventType(0);\r
     header->SetMuonMagFieldScale(-999.);\r
     header->SetCentrality(0);       \r
+    header->SetEventplane(0);\r
   } else {\r
     header->SetBunchCrossNumber(esd.GetBunchCrossNumber());\r
     header->SetOrbitNumber(esd.GetOrbitNumber());\r
@@ -267,6 +269,12 @@ AliAODHeader* AliAnalysisTaskESDfilter::ConvertHeader(const AliESDEvent& esd)
     else{\r
       header->SetCentrality(0);\r
     }\r
+    if(const_cast<AliESDEvent&>(esd).GetEventplane()){\r
+      header->SetEventplane(const_cast<AliESDEvent&>(esd).GetEventplane());\r
+    }\r
+    else{\r
+      header->SetEventplane(0);\r
+    }\r
   }\r
   \r
   // Trigger\r
diff --git a/ANALYSIS/AliEPSelectionTask.cxx b/ANALYSIS/AliEPSelectionTask.cxx
new file mode 100644 (file)
index 0000000..1830b51
--- /dev/null
@@ -0,0 +1,428 @@
+/**************************************************************************
+ * Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+//*****************************************************
+//   Class AliEPSelectionTask
+//   Class to determine event plane            
+//   author: Alberica Toia, Johanna Gramling
+//*****************************************************
+
+#include "AliEPSelectionTask.h"
+
+#include <TTree.h>
+#include <TList.h>
+#include <TH1F.h>
+#include <TH2F.h>
+#include <TProfile.h>
+#include <TFile.h>
+#include <TObjString.h>
+#include <TString.h>
+#include <TCanvas.h>
+#include <TROOT.h>
+#include <TDirectory.h>
+#include <TSystem.h>
+#include <iostream>
+#include <TRandom2.h>
+#include <TArrayF.h>
+
+#include "AliAnalysisManager.h"
+#include "AliVEvent.h"
+#include "AliESD.h"
+#include "AliESDEvent.h"
+#include "AliMCEvent.h"
+#include "AliESDtrack.h"
+#include "AliESDtrackCuts.h"
+#include "AliESDHeader.h"
+#include "AliESDInputHandler.h"
+#include "AliAODHandler.h"
+#include "AliAODEvent.h"
+#include "AliHeader.h"
+#include "AliGenHijingEventHeader.h"
+#include "AliAnalysisTaskSE.h"
+#include "AliPhysicsSelectionTask.h"
+#include "AliPhysicsSelection.h"
+#include "AliBackgroundSelection.h"
+#include "AliESDUtils.h"
+
+#include "AliEventplane.h"
+
+ClassImp(AliEPSelectionTask)
+
+//________________________________________________________________________
+AliEPSelectionTask::AliEPSelectionTask():
+AliAnalysisTaskSE(),
+  fDebug(0),
+  fAnalysisInput("ESD"),
+  fStatus("TPC"),
+  fUseMCRP(kFALSE),
+  fUsePhiWeight(kFALSE),
+  fUsePtWeight(kFALSE),
+  fSaveTrackContribution(kFALSE),
+  fESDtrackCuts(0),
+  ftracklist(0),
+  fPhiDist(0),
+  fQVector(0),
+  fQContributionX(0),
+  fQContributionY(0),
+  fEventplaneQ(0),
+  fQsub1(0),
+  fQsub2(0),
+  fQsubRes(0),  
+  fOutputList(0),
+  fHOutEventplaneQ(0),
+  fHOutPhi(0),
+  fHOutPhiCorr(0),
+  fHOutsub1sub2(0),
+  fHOutNTEPRes(0),
+  fHOutPTPsi(0),
+  fHOutDiff(0),
+  fHOutleadPTPsi(0)
+{   
+  // Default constructor
+  AliInfo("Event Plane Selection enabled.");
+}   
+
+//________________________________________________________________________
+AliEPSelectionTask::AliEPSelectionTask(const char *name):
+  AliAnalysisTaskSE(name),
+  fDebug(0),
+  fAnalysisInput("ESD"),
+  fStatus("TPC"),
+  fUseMCRP(kFALSE),
+  fUsePhiWeight(kFALSE),
+  fUsePtWeight(kFALSE),  
+  fSaveTrackContribution(kFALSE),
+  fESDtrackCuts(0),
+  ftracklist(0),
+  fPhiDist(0),
+  fQVector(0),
+  fQContributionX(0),
+  fQContributionY(0),
+  fEventplaneQ(0),
+  fQsub1(0),
+  fQsub2(0),
+  fQsubRes(0),
+  fOutputList(0),
+  fHOutEventplaneQ(0),
+  fHOutPhi(0),
+  fHOutPhiCorr(0),
+  fHOutsub1sub2(0),
+  fHOutNTEPRes(0),
+  fHOutPTPsi(0),
+  fHOutDiff(0),
+  fHOutleadPTPsi(0)
+{
+  // Default constructor
+  AliInfo("Event Plane Selection enabled.");
+  DefineOutput(1, TList::Class());
+}
+//________________________________________________________________________
+AliEPSelectionTask::~AliEPSelectionTask()
+{
+  // Destructor  
+  if (fOutputList && !AliAnalysisManager::GetAnalysisManager()->IsProofMode()){
+      delete fOutputList;
+      fOutputList = 0;
+  }
+  if (fESDtrackCuts){
+      delete fESDtrackCuts;
+      fESDtrackCuts = 0;
+  }
+  if (fQVector){
+      delete fQVector;
+      fQVector = 0;
+  }
+  if (fQsub1){
+      delete fQsub1;
+      fQsub1 = 0;
+  }
+    if (fQsub2){
+      delete fQsub2;
+      fQsub2 = 0;
+  }
+}  
+
+//________________________________________________________________________
+void AliEPSelectionTask::UserCreateOutputObjects()
+{  
+  // Create the output containers
+  if (fDebug>1) printf("AliEPSelectionTask::UserCreateOutputObjects() \n");
+  AliLog::SetClassDebugLevel("AliEPSelectionTask", AliLog::kInfo);
+
+  fOutputList = new TList();
+  fOutputList->SetOwner();
+  fHOutEventplaneQ = new TH1F("fHOutEventplaneQ","fHOutEventplaneQ; Event Plane Q",100,0,TMath::Pi());
+  fHOutPhi = new TH1F("fHOutPhi","fHOutPhi; Phi Distribution",100,0,TMath::TwoPi());
+  fHOutPhiCorr = new TH1F("fHOutPhiCorr","fHOutPhiCorr; Corrected Phi Distribution",100,0,TMath::TwoPi());
+  fHOutsub1sub2 = new TH2F("fHOutsub1sub2","fHOutsub1sub2; EP1; EP2",100,0,TMath::Pi(),100,0,TMath::Pi());
+  fHOutNTEPRes = new TH2F("fHOutNTEPRes","fHOutNTEPRes; Number of Tracks; Event Plane Resolution",100,0,5000,100,-TMath::Pi(),TMath::Pi());
+  fHOutPTPsi = new TH2F("fHOutPTPsi","fHOutPTPsi; PT; Phi-EP",100,0,20,100,0,TMath::Pi());
+  fHOutDiff = new TH2F("fHOutDiff","fHOutDiff; EP; MCEP",100,0,TMath::Pi(),100,0,TMath::Pi());
+  fHOutleadPTPsi = new TH2F("fHOutleadPTPsi","fHOutleadPTPsi; leadPT; EP",100,0,TMath::Pi(),100,0,TMath::Pi());
+
+  fOutputList->Add(fHOutEventplaneQ);
+  fOutputList->Add(fHOutPhi);
+  fOutputList->Add(fHOutPhiCorr);
+  fOutputList->Add(fHOutsub1sub2);
+  fOutputList->Add(fHOutNTEPRes);
+  fOutputList->Add(fHOutPTPsi);
+  fOutputList->Add(fHOutleadPTPsi);
+  fOutputList->Add(fHOutDiff);
+  
+  PostData(1, fOutputList); 
+}
+
+//________________________________________________________________________
+void AliEPSelectionTask::UserExec(Option_t */*option*/)
+{ 
+  // Execute analysis for current event:
+  if (fDebug>1) printf(" **** AliEPSelectionTask::UserExec() \n");
+  AliEventplane* esdEP = 0;
+  TVector2 QQ1;
+  TVector2 QQ2;
+  Double_t fRP = 0.; // the monte carlo reaction plane angle
+    
+  if (fAnalysisInput.CompareTo("ESD")==0){
+    
+    AliVEvent* event = InputEvent();
+    AliESDEvent* esd = dynamic_cast<AliESDEvent*>(event);
+    
+    if (fUseMCRP) {
+      AliMCEvent* mcEvent  = MCEvent();      
+      if (mcEvent && mcEvent->GenEventHeader()) {
+       AliGenHijingEventHeader* headerH = dynamic_cast<AliGenHijingEventHeader*>(mcEvent->GenEventHeader());
+       fRP = headerH->ReactionPlaneAngle();
+      }
+    }
+    if (esd){
+      esdEP = esd->GetEventplane();
+      if (fSaveTrackContribution) {
+       esdEP->GetQContributionXArray()->Set(esd->GetNumberOfTracks());
+       esdEP->GetQContributionYArray()->Set(esd->GetNumberOfTracks());
+      }
+      
+      if (fStatus.CompareTo("GLOBAL")==0) ftracklist = fESDtrackCuts->GetAcceptedTracks(esd,kFALSE);
+      if (fStatus.CompareTo("TPC")==0) ftracklist = fESDtrackCuts->GetAcceptedTracks(esd,kTRUE);
+      const int NT = ftracklist->GetEntries();
+      
+      if (NT>4){
+       fQVector = new TVector2(GetQ(esdEP,ftracklist));
+       fEventplaneQ = fQVector->Phi()/2; 
+       GetQsub(QQ1, QQ2, ftracklist);
+       fQsub1 = new TVector2(QQ1);
+       fQsub2 = new TVector2(QQ2);
+       fQsubRes = (fQsub1->Phi()/2 - fQsub2->Phi()/2);
+  
+       esdEP->SetQVector(fQVector);
+       esdEP->SetEventplaneQ(fEventplaneQ);
+       esdEP->SetQsub(fQsub1,fQsub2);
+       esdEP->SetQsubRes(fQsubRes);
+       
+       fHOutEventplaneQ->Fill(fEventplaneQ);
+       fHOutsub1sub2->Fill(fQsub1->Phi()/2,fQsub2->Phi()/2);
+       fHOutNTEPRes->Fill(NT,fQsubRes);
+
+       if (fUseMCRP) fHOutDiff->Fill(fEventplaneQ, fRP);
+       
+       for (int iter = 0; iter<NT;iter++){
+         AliESDtrack* track = dynamic_cast<AliESDtrack*> (ftracklist->At(iter));
+         float delta = track->Phi()-fEventplaneQ;
+         while (delta < 0) delta += TMath::Pi();
+         while (delta > TMath::Pi()) delta -= TMath::Pi();
+         fHOutPTPsi->Fill(track->Pt(),delta);
+         fHOutPhi->Fill(track->Phi());
+         fHOutPhiCorr->Fill(track->Phi(),GetPhiWeight(track));
+       }
+       
+       AliESDtrack* trmax = esd->GetTrack(0);
+       for (int iter = 1; iter<NT;iter++){
+         AliESDtrack* track = dynamic_cast<AliESDtrack*> (ftracklist->At(iter));
+         if (track->Pt() > trmax->Pt()) trmax = track;
+       }
+       fHOutleadPTPsi->Fill(trmax->Phi(),fEventplaneQ);      
+      }
+      delete ftracklist;
+    }
+  }
+  
+  else if (fAnalysisInput.CompareTo("AOD")==0){
+    //AliAODEvent *aod =  dynamic_cast<AliAODEvent*> (InputEvent());
+    // to be implemented
+    printf("  AOD analysis not yet implemented!!!\n\n");
+    return;
+  }  
+  else {
+    printf(" Analysis Input not known!\n\n ");
+    return;
+  }
+  PostData(1, fOutputList); 
+}
+
+//________________________________________________________________________
+void AliEPSelectionTask::Terminate(Option_t */*option*/)
+{
+  // Terminate analysis
+}
+
+//__________________________________________________________________________
+TVector2 AliEPSelectionTask::GetQ(AliEventplane* EP, TObjArray* tracklist)
+{
+  TVector2 mQ;
+  float mQx=0, mQy=0;
+  AliESDtrack* track;
+  Double_t weight;
+  
+  int NT = tracklist->GetEntries();
+
+  for (int i=0; i<NT; i++){
+    weight = 1;
+    track = dynamic_cast<AliESDtrack*> (tracklist->At(i));
+    weight = GetWeight(track);
+    if (fSaveTrackContribution){
+      EP->GetQContributionXArray()->AddAt(weight*cos(2*track->Phi()),track->GetID());
+      EP->GetQContributionYArray()->AddAt(weight*sin(2*track->Phi()),track->GetID());
+    }
+    mQx += (weight*cos(2*track->Phi()));
+    mQy += (weight*sin(2*track->Phi()));
+  }
+  mQ.Set(mQx,mQy);
+  return mQ;
+}
+  
+  //________________________________________________________________________
+void AliEPSelectionTask::GetQsub(TVector2 &Q1, TVector2 &Q2, TObjArray* tracklist)
+{
+  TVector2 mQ[2];
+  float mQx1=0, mQy1=0, mQx2=0, mQy2=0;
+  Double_t weight;
+
+  AliESDtrack* track;
+  TRandom2 RN = 0;
+  
+  int NT = tracklist->GetEntries();
+  int trackcounter1=0, trackcounter2=0;
+  
+  for (Int_t i = 0; i < NT; i++) {
+    weight = 1;
+    track = dynamic_cast<AliESDtrack*> (tracklist->At(i));
+    weight = GetWeight(track);
+    
+    // This loop splits the track set into 2 random subsets
+    if( trackcounter1 < int(NT/2.) && trackcounter2 < int(NT/2.)){
+      float random = RN.Rndm();
+      if(random < .5){
+        mQx1 += (weight*cos(2*track->Phi()));
+        mQy1 += (weight*sin(2*track->Phi()));
+        trackcounter1++;
+      }
+      else {
+        mQx2 += (weight*cos(2*track->Phi()));
+        mQy2 += (weight*sin(2*track->Phi()));
+        trackcounter2++;
+      }
+    }
+    else if( trackcounter1 >= int(NT/2.)){
+      mQx2 += (weight*cos(2*track->Phi()));
+      mQy2 += (weight*sin(2*track->Phi()));
+      trackcounter2++;
+    }
+    else {
+      mQx1 += (weight*cos(2*track->Phi()));
+      mQy1 += (weight*sin(2*track->Phi()));
+      trackcounter1++;
+    }
+  }
+  mQ[0].Set(mQx1,mQy1);
+  mQ[1].Set(mQx2,mQy2);
+  Q1 = mQ[0];
+  Q2 = mQ[1];
+}
+
+//________________________________________________________________________
+void AliEPSelectionTask::SetESDtrackCuts(TString status){
+  
+  fStatus = status;
+  if (fStatus.CompareTo("GLOBAL")==0) fESDtrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(kTRUE);
+  if (fStatus.CompareTo("TPC")==0)    fESDtrackCuts = AliESDtrackCuts::GetStandardTPCOnlyTrackCuts();
+  fESDtrackCuts->SetPtRange(0.15,20);
+  fESDtrackCuts->SetEtaRange(-0.8,0.8);
+}
+
+//__________________________________________________________________________
+void AliEPSelectionTask::SetPhiDistribution(char* infilename, char* listname){
+  TFile f(infilename);
+  TObject* list = f.Get(listname);
+  fPhiDist = (TH1F*)list->FindObject("fHOutPhi");
+  if (!fPhiDist) cout << "Phi Distribution not found!!!" << endl;
+  
+  Bool_t emptybins;
+
+  int iter = 0;  
+  while (iter<3){
+      emptybins = kFALSE;
+   
+      for (int i=1; i<fPhiDist->GetNbinsX(); i++){
+       if (!((fPhiDist->GetBinContent(i))>0)) {
+         emptybins = kTRUE;
+       }
+      }  
+      if (emptybins) {
+       cout << "empty bins - rebinning!" << endl;
+       fPhiDist->Rebin();
+       iter++;
+      }      
+      else iter = 3;
+  }
+  
+  if (emptybins) {
+    AliError("After Maximum of rebinning still empty Phi-bins!!!");
+  }
+  f.Close();
+}
+
+//________________________________________________________________________
+Double_t AliEPSelectionTask::GetWeight(AliESDtrack* track)
+{
+  Double_t ptweight=1;
+
+  if (fUsePtWeight) {      
+    if (track->Pt()<2) ptweight=track->Pt();
+    else ptweight=2;
+  }
+  return ptweight*GetPhiWeight(track);
+}
+
+//________________________________________________________________________
+Double_t AliEPSelectionTask::GetPhiWeight(AliESDtrack* track)
+{
+  Double_t phiweight=1;
+  
+  if (fUsePhiWeight) {
+    Double_t nParticles = fPhiDist->Integral();
+    Double_t nPhibins = fPhiDist->GetNbinsX();
+  
+    Double_t Phi = track->Phi();
+    
+    while (Phi<0) Phi += TMath::TwoPi();
+    while (Phi>TMath::TwoPi()) Phi -= TMath::TwoPi();
+      
+    Double_t PhiDistValue = fPhiDist->GetBinContent(1+TMath::Floor((track->Phi())*nPhibins/TMath::TwoPi()));
+    
+    if (PhiDistValue > 0) phiweight = nParticles/nPhibins/PhiDistValue;
+  }
+  return phiweight;
+}
diff --git a/ANALYSIS/AliEPSelectionTask.h b/ANALYSIS/AliEPSelectionTask.h
new file mode 100644 (file)
index 0000000..29cf7df
--- /dev/null
@@ -0,0 +1,94 @@
+#ifndef ALIEPSELECTIONTASK_H
+#define ALIEPSELECTIONTASK_H
+
+/* Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+//*****************************************************
+//   Class AliEPSelectionTask
+//   author: Alberica Toia, Johanna Gramling
+//*****************************************************
+
+#include "AliAnalysisTaskSE.h"
+
+class TFile;
+class TH1F;
+class TH2F;
+class TList;
+class TString;
+class TVector2;
+class TObjArray;
+
+class AliESDEvent;
+class AliESDtrackCuts;
+class AliESDtrack;
+class AliEventplane;
+
+class AliEPSelectionTask : public AliAnalysisTaskSE {
+
+ public:
+
+  AliEPSelectionTask();
+  AliEPSelectionTask(const char *name);
+  virtual ~AliEPSelectionTask();
+
+  // Implementation of interface methods
+  virtual void UserCreateOutputObjects();
+  virtual void UserExec(Option_t *option);
+  virtual void Terminate(Option_t *option);
+  
+  TVector2 GetQ(AliEventplane* EP, TObjArray* event);
+  void GetQsub(TVector2& Qsub1, TVector2& Qsub2, TObjArray* event);
+  Double_t GetWeight(AliESDtrack* track);
+  Double_t GetPhiWeight(AliESDtrack* track);
+
+  virtual void  SetDebugLevel(Int_t level) {fDebug = level;}
+  void SetInput(const char* input)         {fAnalysisInput = input;}
+  void SetUseMCRP()                       {fUseMCRP = kTRUE;}
+  void SetUsePhiWeight()                  {fUsePhiWeight = kTRUE;}
+  void SetUsePtWeight()                           {fUsePtWeight = kTRUE;}
+  void SetSaveTrackContribution()         {fSaveTrackContribution = kTRUE;}
+  void SetESDtrackCuts(TString status);
+  void SetPhiDistribution(char* filename, char* listname);
+  
+ private:
+   
+  AliEPSelectionTask(const AliEPSelectionTask& ep);
+  AliEPSelectionTask& operator= (const AliEPSelectionTask& ep); 
+
+  Int_t    fDebug;                     // Debug flag
+  TString  fAnalysisInput;             // "ESD", "AOD"
+  TString  fStatus;                    // "GLOBAL", "TPC"
+  Bool_t   fUseMCRP;                   // i.e. usable for Therminator, when MC RP is provided
+  Bool_t   fUsePhiWeight;              // use of phi weights
+  Bool_t   fUsePtWeight;               // use of pT weights
+  Bool_t   fSaveTrackContribution;     // storage of contribution of each track to Q-Vector
+  
+  AliESDtrackCuts* fESDtrackCuts;
+  
+  TObjArray* ftracklist;               // list of accepted tracks for Q-Vector
+  TH1F*         fPhiDist;                      // Phi distribution used to calculate phi weights
+
+  TVector2* fQVector;                  // Q-Vector of the event  
+  Double_t* fQContributionX;           // array of the tracks' contributions to X component of Q-Vector - index = track ID
+  Double_t* fQContributionY;           // array of the tracks' contributions to Y component of Q-Vector - index = track ID
+  Double_t  fEventplaneQ;              // Event plane angle from Q-Vector
+  TVector2* fQsub1;                    // Q-Vector of sub-event 1
+  TVector2* fQsub2;                    // Q-Vector of sub-event 2
+  Double_t  fQsubRes;                  // Difference of EP angles of subevents
+  
+  TList* fOutputList;  
+  TH1F*  fHOutEventplaneQ;             // control histogram: Event Plane angle
+  TH1F*  fHOutPhi;                     // control histogram: original phi distribution
+  TH1F*         fHOutPhiCorr;                  // control histogram: corrected phi distribution
+  TH2F*  fHOutsub1sub2;                        // control histogram: correlation of EP from subevents
+  TH2F*  fHOutNTEPRes;                 // control histogram: Difference of EP angles of subevents vs Nch
+  TH2F*  fHOutPTPsi;                   // control histogram: Difference of EP angle and emission angle of track vs track pT
+  TH2F*         fHOutDiff;                     // control histogram: Difference of MC RP and EP - only filled if fUseMCRP is true!
+  TH2F*  fHOutleadPTPsi;               // control histogram: emission angle of leading pT track vs EP angle
+
+  ClassDef(AliEPSelectionTask,2); 
+};
+
+#endif
+
index c05712b..4776c04 100644 (file)
@@ -25,7 +25,7 @@
 # SHLIBS - Shared Libraries and objects for linking (Executables only)           #
 #--------------------------------------------------------------------------------#
 
-set ( SRCS     AliAnalysisTaskSE.cxx AliAnalysisTaskME.cxx AliAnalysisTaskESDfilter.cxx AliAnalysisTaskMCParticleFilter.cxx AliKineTrackCuts.cxx AliESDtrackCuts.cxx  AliESDpidCuts.cxx AliESDv0Cuts.cxx AliEventPoolOTF.cxx AliEventPoolLoop.cxx AliEventPoolSparse.cxx AliAnalysisTaskTagCreator.cxx AliMultiEventInputHandler.cxx AliTriggerAnalysis.cxx AliPhysicsSelection.cxx AliBackgroundSelection.cxx AliPhysicsSelectionTask.cxx AliAnalysisFilter.cxx AliAnalysisCuts.cxx AliCollisionNormalization.cxx AliCollisionNormalizationTask.cxx AliCentralitySelectionTask.cxx AliAnalysisTaskAODCentralityMaker.cxx AliAnalysisTaskStat.cxx AliMultiInputEventHandler.cxx AliESDv0KineCuts.cxx AliAnalysisTaskPIDResponse.cxx)
+set ( SRCS     AliAnalysisTaskSE.cxx AliAnalysisTaskME.cxx AliAnalysisTaskESDfilter.cxx AliAnalysisTaskMCParticleFilter.cxx AliKineTrackCuts.cxx AliESDtrackCuts.cxx  AliESDpidCuts.cxx AliESDv0Cuts.cxx AliEventPoolOTF.cxx AliEventPoolLoop.cxx AliEventPoolSparse.cxx AliAnalysisTaskTagCreator.cxx AliMultiEventInputHandler.cxx AliTriggerAnalysis.cxx AliPhysicsSelection.cxx AliBackgroundSelection.cxx AliPhysicsSelectionTask.cxx AliAnalysisFilter.cxx AliAnalysisCuts.cxx AliCollisionNormalization.cxx AliCollisionNormalizationTask.cxx AliCentralitySelectionTask.cxx AliAnalysisTaskAODCentralityMaker.cxx AliEPSelectionTask.cxx AliAnalysisTaskStat.cxx AliMultiInputEventHandler.cxx AliESDv0KineCuts.cxx AliAnalysisTaskPIDResponse.cxx)
 
 if( ROOTHASALIEN STREQUAL "yes")
        
diff --git a/ANALYSIS/macros/AddTaskEventplane.C b/ANALYSIS/macros/AddTaskEventplane.C
new file mode 100644 (file)
index 0000000..1856e85
--- /dev/null
@@ -0,0 +1,40 @@
+AliEPSelectionTask *AddTaskEventplane()
+{
+  // Macro to connect an event plane selection task to an existing analysis manager.
+  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+  if (!mgr) {
+    ::Error("AddTaskEventplane", "No analysis manager to connect to.");
+    return NULL;
+  }      
+  // Check the analysis type using the event handlers connected to the analysis manager.
+  //==============================================================================
+  if (!mgr->GetInputEventHandler()) {
+    ::Error("AddTaskEventplane", "This task requires an input event handler");
+    return NULL;
+  }
+  TString inputDataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
+  if (inputDataType != "ESD") {
+    ::Error("AddTaskEventplane", "This task works only on ESD analysis");
+    return NULL;
+  }
+  
+  AliEPSelectionTask *eventplaneTask = new AliEPSelectionTask("EventplaneSelection");
+  eventplaneTask->SelectCollisionCandidates(AliVEvent::kMB);
+  eventplaneTask->SetESDtrackCuts("TPC");
+//   eventplaneTask->SetUseMCRP();
+//   eventplaneTask->SetPhiDistribution("Phidist.root","EPStat");
+  eventplaneTask->SetUsePtWeight();
+//   eventplaneTask->SetUsePhiWeight();
+//   eventplaneTask->SetSaveTrackContribution();
+  mgr->AddTask(eventplaneTask);
+
+  AliAnalysisDataContainer *cinput0 = mgr->GetCommonInputContainer();
+  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("EPStat",
+                TList::Class(), AliAnalysisManager::kOutputContainer,
+                "EventStat_temp.root");
+  
+  mgr->ConnectInput(eventplaneTask, 0, mgr->GetCommonInputContainer());
+  mgr->ConnectOutput(eventplaneTask,1,coutput1);
+
+  return eventplaneTask;
+}
index c88e8ca..2f6ff5f 100644 (file)
@@ -35,6 +35,7 @@
 class TTree;
 class TFolder;
 class AliCentrality;
+class AliEventplane;
 
 class AliAODEvent : public AliVEvent {
 
@@ -236,6 +237,7 @@ class AliAODEvent : public AliVEvent {
   virtual Int_t        EventIndexForPHOSCell(Int_t)    const {return 0;}
   virtual Int_t        EventIndexForEMCALCell(Int_t)   const {return 0;} 
   AliCentrality*       GetCentrality() {return fHeader->GetCentralityP();} 
+  AliEventplane*       GetEventplane() {return fHeader->GetEventplaneP();}
 
   // VZERO 
   AliAODVZERO *GetVZEROData() const { return fAODVZERO; }
index 0d54890..d1bb9ff 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "AliAODHeader.h"
 #include "AliCentrality.h"
+#include "AliEventplane.h"
 #include <TGeoMatrix.h>
 #include <TObjString.h>
 
@@ -33,6 +34,7 @@ AliAODHeader::AliAODHeader() :
   fMagneticField(-999.),
   fMuonMagFieldScale(-999.),
   fCentrality(-999.),
+  fEventplane(-999.),
   fZDCN1Energy(-999.),
   fZDCP1Energy(-999.),
   fZDCN2Energy(-999.),
@@ -60,7 +62,8 @@ AliAODHeader::AliAODHeader() :
   fL0TriggerInputs(0),
   fL1TriggerInputs(0),
   fL2TriggerInputs(0),
-  fCentralityP(0)
+  fCentralityP(0),
+  fEventplaneP(0)
 {
   // default constructor
 
@@ -83,6 +86,7 @@ AliAODHeader::AliAODHeader(Int_t nRun,
   fMagneticField(-999.),
   fMuonMagFieldScale(-999.),
   fCentrality(-999.),
+  fEventplane(-999.),
   fZDCN1Energy(-999.),
   fZDCP1Energy(-999.),
   fZDCN2Energy(-999.),
@@ -110,7 +114,8 @@ AliAODHeader::AliAODHeader(Int_t nRun,
   fL0TriggerInputs(0),
   fL1TriggerInputs(0),
   fL2TriggerInputs(0),
-  fCentralityP(0)
+  fCentralityP(0),
+  fEventplaneP(0)
 {
   // constructor
 
@@ -135,6 +140,7 @@ AliAODHeader::AliAODHeader(Int_t nRun,
                           Double_t magField,
                           Double_t muonMagFieldScale,
                           Double_t cent,
+                          Double_t eventplane,
                           Double_t n1Energy,
                           Double_t p1Energy,
                           Double_t n2Energy,
@@ -150,6 +156,7 @@ AliAODHeader::AliAODHeader(Int_t nRun,
   fMagneticField(magField),
   fMuonMagFieldScale(muonMagFieldScale),
   fCentrality(cent),
+  fEventplane(eventplane),
   fZDCN1Energy(n1Energy),
   fZDCP1Energy(p1Energy),
   fZDCN2Energy(n2Energy),
@@ -177,7 +184,8 @@ AliAODHeader::AliAODHeader(Int_t nRun,
   fL0TriggerInputs(0),
   fL1TriggerInputs(0),
   fL2TriggerInputs(0),
-  fCentralityP(0)
+  fCentralityP(0),
+  fEventplaneP(0)
 {
   // constructor
 
@@ -196,6 +204,7 @@ AliAODHeader::~AliAODHeader()
 {
   // destructor
   delete fCentralityP;
+  delete fEventplaneP;
   RemoveQTheta();
 }
 
@@ -205,6 +214,7 @@ AliAODHeader::AliAODHeader(const AliAODHeader& hdr) :
   fMagneticField(hdr.fMagneticField),
   fMuonMagFieldScale(hdr.fMuonMagFieldScale),
   fCentrality(hdr.fCentrality),
+  fEventplane(hdr.fEventplane),
   fZDCN1Energy(hdr.fZDCN1Energy),
   fZDCP1Energy(hdr.fZDCP1Energy),
   fZDCN2Energy(hdr.fZDCN2Energy),
@@ -232,7 +242,8 @@ AliAODHeader::AliAODHeader(const AliAODHeader& hdr) :
   fL0TriggerInputs(hdr.fL0TriggerInputs),
   fL1TriggerInputs(hdr.fL1TriggerInputs),
   fL2TriggerInputs(hdr.fL2TriggerInputs),
-  fCentralityP(new AliCentrality(*hdr.fCentralityP))
+  fCentralityP(new AliCentrality(*hdr.fCentralityP)),
+  fEventplaneP(new AliEventplane(*hdr.fEventplaneP))
 {
   // Copy constructor.
   
@@ -271,6 +282,7 @@ AliAODHeader& AliAODHeader::operator=(const AliAODHeader& hdr)
     fMagneticField    = hdr.fMagneticField;
     fMuonMagFieldScale= hdr.fMuonMagFieldScale;
     fCentrality       = hdr.fCentrality;
+    fEventplane       = hdr.fEventplane;
     fZDCN1Energy      = hdr.fZDCN1Energy;
     fZDCP1Energy      = hdr.fZDCP1Energy;
     fZDCN2Energy      = hdr.fZDCN2Energy;
@@ -297,6 +309,7 @@ AliAODHeader& AliAODHeader::operator=(const AliAODHeader& hdr)
     fL1TriggerInputs    = hdr.fL1TriggerInputs;
     fL2TriggerInputs    = hdr.fL2TriggerInputs;
     fCentralityP        = new AliCentrality(*hdr.fCentralityP);
+    fEventplaneP        = new AliEventplane(*hdr.fEventplaneP);
 
     SetName(hdr.fName);
     SetTitle(hdr.fTitle);
@@ -374,6 +387,11 @@ void AliAODHeader::Clear(Option_t* /*opt*/)
     fCentralityP = 0;
     fCentrality = -999;
   }
+  if (fEventplaneP){
+    delete fEventplaneP;
+    fEventplaneP = 0;
+    fEventplane = -999;
+  }
   return;
 }
 
@@ -393,6 +411,7 @@ void AliAODHeader::Print(Option_t* /*option*/) const
   printf("Muon mag. field scale   : %f\n", fMuonMagFieldScale);
   
   printf("Centrality              : %f\n", fCentrality);
+  printf("Event plane             : %f\n", fEventplane);
   printf("ZDC N1 Energy           : %f\n", fZDCN1Energy);
   printf("ZDC P1 Energy           : %f\n", fZDCP1Energy);
   printf("ZDC N2 Energy           : %f\n", fZDCN2Energy);
index d7e34dc..d912e4a 100644 (file)
@@ -14,6 +14,7 @@
 #include "AliAODVertex.h"
 #include <TString.h>
 #include "AliCentrality.h"
+#include "AliEventplane.h"
 
 class TGeoHMatrix;
 class TString;
@@ -35,6 +36,7 @@ class AliAODHeader : public AliVHeader {
               Double_t magField,
               Double_t muonMagFieldScale,
               Double_t cent,
+              Double_t eventplane,
               Double_t n1Energy,
               Double_t p1Energy,
               Double_t n2Energy,
@@ -64,6 +66,7 @@ class AliAODHeader : public AliVHeader {
   Double_t  GetMuonMagFieldScale()  const { return fMuonMagFieldScale; }
   
   Double_t  GetCentrality()         const { return fCentrality; }
+  Double_t  GetEventplane()         const { return fEventplane; }
   Double_t  GetZDCN1Energy()        const { return fZDCN1Energy; }
   Double_t  GetZDCP1Energy()        const { return fZDCP1Energy; }
   Double_t  GetZDCN2Energy()        const { return fZDCN2Energy; }
@@ -91,6 +94,7 @@ class AliAODHeader : public AliVHeader {
   UInt_t   GetL1TriggerInputs() const {return fL1TriggerInputs;} 
   UShort_t GetL2TriggerInputs() const {return fL2TriggerInputs;} 
   AliCentrality* GetCentralityP()  const { return fCentralityP; }
+  AliEventplane* GetEventplaneP()  const { return fEventplaneP; }
 
   
   void SetRunNumber(Int_t nRun)                { fRunNumber = nRun; }
@@ -105,6 +109,7 @@ class AliAODHeader : public AliVHeader {
   void SetMagneticField(Double_t magFld)       { fMagneticField = magFld; }
   void SetMuonMagFieldScale(Double_t magFldScl){ fMuonMagFieldScale = magFldScl; }
   void SetCentrality(AliCentrality* cent);
+  void SetEventplane(AliEventplane* eventplane);
   void SetZDCN1Energy(Double_t n1Energy)       { fZDCN1Energy = n1Energy; }
   void SetZDCP1Energy(Double_t p1Energy)       { fZDCP1Energy = p1Energy; }
   void SetZDCN2Energy(Double_t n2Energy)       { fZDCN2Energy = n2Energy; }
@@ -159,6 +164,7 @@ class AliAODHeader : public AliVHeader {
   Double32_t  fMagneticField;       // Solenoid Magnetic Field in kG
   Double32_t  fMuonMagFieldScale;   // magnetic field scale of muon arm magnet
   Double32_t  fCentrality;          // Centrality
+  Double32_t  fEventplane;          // Event plane angle
   Double32_t  fZDCN1Energy;         // reconstructed energy in the neutron1 ZDC
   Double32_t  fZDCP1Energy;         // reconstructed energy in the proton1 ZDC
   Double32_t  fZDCN2Energy;         // reconstructed energy in the neutron2 ZDC
@@ -192,7 +198,8 @@ class AliAODHeader : public AliVHeader {
   UInt_t      fL1TriggerInputs;     // L1 Trigger Inputs (mask)
   UShort_t    fL2TriggerInputs;     // L2 Trigger Inputs (mask)
   AliCentrality* fCentralityP;      // Pointer to full centrality information
-  ClassDef(AliAODHeader, 14);
+  AliEventplane* fEventplaneP;     // Pointer to full event plane information
+  ClassDef(AliAODHeader, 15);
 };
 inline
 void AliAODHeader::SetCentrality(AliCentrality* cent)      { 
@@ -205,4 +212,15 @@ void AliAODHeader::SetCentrality(AliCentrality* cent)      {
        fCentrality = -999;
     }
 }
+inline
+void AliAODHeader::SetEventplane(AliEventplane* eventplane)      { 
+    if(eventplane){
+       if(fEventplaneP)*fEventplaneP = *eventplane;
+       else fEventplaneP = new AliEventplane(*eventplane);
+       fEventplane = eventplane->GetEventplane("Q");
+    }
+    else{
+       fEventplane = -999;
+    }
+}
 #endif
index a308218..73c3ea4 100644 (file)
@@ -67,6 +67,7 @@
 #include "AliESDACORDE.h"
 #include "AliESDHLTDecision.h"
 #include "AliCentrality.h"
+#include "AliEventplane.h"
 
 ClassImp(AliESDEvent)
 
@@ -136,7 +137,8 @@ AliESDEvent::AliESDEvent():
   fConnected(kFALSE),
   fUseOwnList(kFALSE),
   fTOFHeader(0),
-  fCentrality(0)
+  fCentrality(0),
+  fEventplane(0)
 {
 }
 //______________________________________________________________________________
@@ -174,7 +176,8 @@ AliESDEvent::AliESDEvent(const AliESDEvent& esd):
   fConnected(esd.fConnected),
   fUseOwnList(esd.fUseOwnList),
   fTOFHeader(new AliTOFHeader(*esd.fTOFHeader)),
-  fCentrality(new AliCentrality(*esd.fCentrality))
+  fCentrality(new AliCentrality(*esd.fCentrality)),
+  fEventplane(new AliEventplane(*esd.fEventplane))
 {
   // CKB init in the constructor list and only add here ...
   AddObject(fESDRun);
@@ -297,6 +300,7 @@ AliESDEvent & AliESDEvent::operator=(const AliESDEvent& source) {
   }
 
   fCentrality = source.fCentrality;
+  fEventplane = source.fEventplane;
 
   fConnected  = source.fConnected;
   fUseOwnList = source.fUseOwnList;
@@ -321,6 +325,7 @@ AliESDEvent::~AliESDEvent()
       fESDObjects = 0;
     }
   if (fCentrality) delete fCentrality;
+  if (fEventplane) delete fEventplane;
   
 }
 
@@ -1750,3 +1755,9 @@ AliCentrality* AliESDEvent::GetCentrality()
     if (!fCentrality) fCentrality = new AliCentrality();
     return  fCentrality;
 }
+
+AliEventplane* AliESDEvent::GetEventplane()
+{
+    if (!fEventplane) fEventplane = new AliEventplane();
+    return  fEventplane;
+}
index 56e1003..ff9f257 100644 (file)
@@ -58,6 +58,7 @@ class AliESDMuonTrack;
 class AliESD;
 class AliESDcascade;
 class AliCentrality;
+class AliEventplane;
 class TRefArray;
 class AliESDACORDE;
 class AliESDHLTDecision;
@@ -189,6 +190,7 @@ public:
   Double_t GetZDCEMEnergy(Int_t i=0) const {return fESDZDC?fESDZDC->GetZDCEMEnergy(i):0;}
   Int_t    GetZDCParticipants() const {return fESDZDC?fESDZDC->GetZDCParticipants():0;}
   AliCentrality* GetCentrality();
+  AliEventplane* GetEventplane();
     
 
   void     SetZDC(Float_t n1Energy, Float_t p1Energy, Float_t em1Energy, Float_t em2Energy,
@@ -472,7 +474,8 @@ protected:
                              //  It contains also TOF time resolution
                              //  and T0spread as written in OCDB
   AliCentrality *fCentrality; //! Centrality for AA collision
-  ClassDef(AliESDEvent,13)  //ESDEvent class 
+  AliEventplane *fEventplane; //! Event plane for AA collision
+  ClassDef(AliESDEvent,14)  //ESDEvent class 
 };
 #endif 
 
diff --git a/STEER/AliEventplane.cxx b/STEER/AliEventplane.cxx
new file mode 100644 (file)
index 0000000..8f616a7
--- /dev/null
@@ -0,0 +1,154 @@
+/**************************************************************************
+ * Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+//*****************************************************
+//   Class AliEventplane
+//   author: Alberica Toia, Johanna Gramling
+//*****************************************************
+/// A container for the event plane stored in AOD in ESD
+#include "AliEventplane.h"
+#include "TVector2.h"
+#include "AliESDtrack.h"
+#include "TObjArray.h"
+#include "TArrayF.h"
+
+ClassImp(AliEventplane)
+
+AliEventplane::AliEventplane() : TNamed("Eventplane", "Eventplane"),
+  fQVector(0),
+  fQContributionX(0),
+  fQContributionY(0),
+  fEventplaneQ(0),
+  fQsub1(0),
+  fQsub2(0),
+  fQsubRes(0)
+{
+  /// constructor
+  fQContributionX = new TArrayF();
+  fQContributionY = new TArrayF();
+}
+
+AliEventplane::AliEventplane(const AliEventplane& ep) : 
+  TNamed(),
+  fQVector(0),
+  fQContributionX(0),
+  fQContributionY(0),
+  fEventplaneQ(0),
+  fQsub1(0),
+  fQsub2(0),
+  fQsubRes(0)
+{
+  /// Copy constructor
+  ((AliEventplane &) ep).CopyEP(*this);
+}
+
+AliEventplane& AliEventplane::operator=(const AliEventplane& ep)
+{
+  /// Assignment operator
+  if (this!=&ep)
+    ((AliEventplane &) ep).CopyEP(*this);
+
+  return *this;
+}
+
+void AliEventplane::CopyEP(AliEventplane& ep) const
+{ // copy function
+
+  AliEventplane& target = (AliEventplane &) ep;
+  if (fQContributionX)
+      target.fQContributionX = fQContributionX;
+  if (fQContributionY)
+      target.fQContributionY = fQContributionY;
+  if (fEventplaneQ)
+      target.fEventplaneQ = fEventplaneQ;
+  if (fQVector)
+      target.fQVector = dynamic_cast<TVector2*> (fQVector->Clone());
+  if (fQsub1)
+      target.fQsub1 = dynamic_cast<TVector2*> (fQsub1->Clone());
+  if (fQsub2)
+      target.fQsub2 = dynamic_cast<TVector2*> (fQsub2->Clone());
+  if (fQsubRes)
+      target.fQsubRes = fQsubRes;
+}
+
+AliEventplane::~AliEventplane()
+{
+  /// destructor
+  if (fQContributionX){
+      delete fQContributionX;
+      fQContributionX = 0;
+  }
+  if (fQContributionY){
+      delete fQContributionY;
+      fQContributionY = 0;
+  }
+  if (fQVector){
+      delete fQVector;
+      fQVector = 0;
+  }
+  if (fQsub1){
+      delete fQsub1;
+      fQsub1 = 0;
+  }
+    if (fQsub2){
+      delete fQsub2;
+      fQsub2 = 0;
+  }
+}
+
+TVector2* AliEventplane::GetQVector()
+{
+  return fQVector;
+}
+
+Double_t AliEventplane::GetEventplane(const char *x)
+{
+  TString method = x;
+  if(method.CompareTo("Q")==0)      return fEventplaneQ;
+  return -1;
+}
+
+TVector2* AliEventplane::GetQsub1()
+{
+  return fQsub1;
+}
+
+TVector2* AliEventplane::GetQsub2()
+{
+  return fQsub2;
+}
+
+Double_t AliEventplane::GetQsubRes()
+{
+  return fQsubRes;
+}
+
+Bool_t AliEventplane::IsEventInEventplaneClass(Double_t a, Double_t b, const char *x)
+{
+  TString method = x;
+  if ((method.CompareTo("Q")==0) && (fEventplaneQ >=a && fEventplaneQ < b)) return kTRUE;
+  else return kFALSE;
+}
+
+Double_t AliEventplane::GetQContributionX(AliESDtrack* track)
+{ 
+  return fQContributionX->GetAt(track->GetID());
+}
+
+Double_t AliEventplane::GetQContributionY(AliESDtrack* track)
+{ 
+  return fQContributionY->GetAt(track->GetID());
+}
diff --git a/STEER/AliEventplane.h b/STEER/AliEventplane.h
new file mode 100644 (file)
index 0000000..f3273dd
--- /dev/null
@@ -0,0 +1,58 @@
+#ifndef ALIEventplane_H
+#define ALIEventplane_H
+
+/* Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+//*****************************************************
+//   Class AliEventplane
+//   author: Alberica Toia, Johanna Gramling
+//*****************************************************
+
+#include "TNamed.h"
+
+class TVector2;
+class AliESDtrack;
+class TObjArray;
+class TArrayF;
+
+class AliEventplane : public TNamed
+{
+ public:
+
+  AliEventplane();  /// constructor
+  ~AliEventplane();  /// destructor
+  AliEventplane(const AliEventplane& ep); /// copy constructor
+  AliEventplane& operator=(const AliEventplane& ep);   /// assignment operator
+  virtual void CopyEP(AliEventplane& ep) const;
+
+  /// set event plane result
+  void SetQVector(TVector2* qvector) {fQVector = qvector;}
+  void SetEventplaneQ(Double_t evp) {fEventplaneQ = evp;} 
+  void SetQsub(TVector2* qs1, TVector2* qs2) {fQsub1 = qs1;fQsub2 = qs2;}
+  void SetQsubRes (Double_t qsr) {fQsubRes = qsr;}
+
+  /// get event plane result
+  TVector2* GetQVector(); 
+  Double_t GetQContributionX(AliESDtrack* track);
+  Double_t GetQContributionY(AliESDtrack* track);
+  TArrayF* GetQContributionXArray() { return fQContributionX; }
+  TArrayF* GetQContributionYArray() { return fQContributionY; }
+  Double_t GetEventplane(const char *method);
+  TVector2* GetQsub1();
+  TVector2* GetQsub2();
+  Double_t GetQsubRes();
+  Bool_t  IsEventInEventplaneClass(Double_t a, Double_t b, const char *method);
+
+ private:
+   TVector2* fQVector;         // Q-Vector of event
+   TArrayF* fQContributionX;   // array of the tracks' contributions to X component of Q-Vector - index = track ID
+   TArrayF* fQContributionY;   // array of the tracks' contributions to Y component of Q-Vector - index = track ID
+   Double_t fEventplaneQ;      // Event plane angle from Q-Vector
+   TVector2* fQsub1;           // Q-Vector of subevent 1
+   TVector2* fQsub2;           // Q-Vector of subevent 2
+   Double_t fQsubRes;          // Difference of EP angles of subevents
+  ClassDef(AliEventplane, 1)
+};
+#endif //ALIEVENTPLANE_H
index ed092a9..743dbcf 100644 (file)
@@ -25,6 +25,7 @@
 #include "AliMCParticle.h"
 
 class AliCentrality;
+class AliEventplane;
 class AliStack;
 class AliHeader;
 class AliGenEventHeader;
@@ -134,6 +135,7 @@ public:
   virtual Int_t        EventIndexForPHOSCell(Int_t)    const {return 0;}
   virtual Int_t        EventIndexForEMCALCell(Int_t)   const {return 0;} 
   AliCentrality*       GetCentrality()  {return 0;} 
+  AliEventplane*       GetEventplane()  {return 0;} 
 
   virtual AliVVZERO *GetVZEROData() const {return 0;}
 private:
index a138ca0..8fe4857 100644 (file)
@@ -18,6 +18,7 @@
 #include <TList.h>
 #include <TObjArray.h>
 class AliCentrality;
+class AliEventplane;
 class AliVVertex;
 
 class AliMixedEvent : public AliVEvent {
@@ -110,6 +111,7 @@ public:
   virtual Int_t        EventIndexForEMCALCell(Int_t icell) const;
 
   virtual AliCentrality* GetCentrality() {return 0;}
+  virtual AliEventplane* GetEventplane() {return 0;}
   // Primary vertex
     virtual const AliVVertex   *GetPrimaryVertex() const {return fMeanVertex;}
     virtual Bool_t ComputeVtx(const TObjArray *vertices, Double_t *pos,Double_t *sig,Int_t *nContributors);
index 7e2c7ad..fffad8c 100644 (file)
@@ -23,6 +23,7 @@
 #include "AliVCaloCells.h"
 #include "TRefArray.h"
 class AliCentrality;
+class AliEventplane;
 class AliVVZERO;
 
 class AliVEvent : public TObject {
@@ -129,6 +130,7 @@ public:
     return kFALSE;    
   }
   virtual AliCentrality* GetCentrality()                          = 0;
+  virtual AliEventplane* GetEventplane()                          = 0;
   virtual Int_t        EventIndex(Int_t itrack)             const = 0;
   virtual Int_t        EventIndexForCaloCluster(Int_t iclu) const = 0;
   virtual Int_t        EventIndexForPHOSCell(Int_t icell)   const = 0;
index d8ecb69..effa58e 100644 (file)
@@ -1,4 +1,4 @@
-set ( SRCS  AliVParticle.cxx AliVTrack.cxx AliVCluster.cxx AliVCaloCells.cxx AliVVertex.cxx AliVEvent.cxx AliMixedEvent.cxx AliVHeader.cxx AliVEventHandler.cxx AliVEventPool.cxx AliVCuts.cxx AliVVZERO.cxx AliCentrality.cxx AliPID.cxx AliLog.cxx AliRunTag.cxx AliLHCTag.cxx AliDetectorTag.cxx AliEventTag.cxx AliFileTag.cxx AliEventTagCuts.cxx AliRunTagCuts.cxx AliLHCTagCuts.cxx AliDetectorTagCuts.cxx AliTagCreator.cxx AliHeader.cxx AliGenEventHeader.cxx AliDetectorEventHeader.cxx AliGenPythiaEventHeader.cxx AliGenCocktailEventHeader.cxx AliGenGeVSimEventHeader.cxx AliGenHijingEventHeader.cxx AliCollisionGeometry.cxx AliGenDPMjetEventHeader.cxx AliGenHerwigEventHeader.cxx AliGenEposEventHeader.cxx AliStack.cxx AliMCEventHandler.cxx AliInputEventHandler.cxx AliTrackReference.cxx AliSysInfo.cxx AliMCEvent.cxx AliMCParticle.cxx AliMCVertex.cxx AliMagF.cxx AliMagWrapCheb.cxx AliCheb3D.cxx AliCheb3DCalc.cxx AliNeutralTrackParam.cxx AliCodeTimer.cxx AliPDG.cxx AliTimeStamp.cxx AliTriggerScalers.cxx AliTriggerScalersRecord.cxx AliExternalTrackParam.cxx AliQA.cxx AliITSPidParams.cxx AliPIDResponse.cxx AliITSPIDResponse.cxx AliTPCPIDResponse.cxx AliTOFPIDResponse.cxx AliTRDPIDResponse.cxx AliDAQ.cxx AliRefArray.cxx)
+set ( SRCS  AliVParticle.cxx AliVTrack.cxx AliVCluster.cxx AliVCaloCells.cxx AliVVertex.cxx AliVEvent.cxx AliMixedEvent.cxx AliVHeader.cxx AliVEventHandler.cxx AliVEventPool.cxx AliVCuts.cxx AliVVZERO.cxx AliCentrality.cxx AliEventplane.cxx AliPID.cxx AliLog.cxx AliRunTag.cxx AliLHCTag.cxx AliDetectorTag.cxx AliEventTag.cxx AliFileTag.cxx AliEventTagCuts.cxx AliRunTagCuts.cxx AliLHCTagCuts.cxx AliDetectorTagCuts.cxx AliTagCreator.cxx AliHeader.cxx AliGenEventHeader.cxx AliDetectorEventHeader.cxx AliGenPythiaEventHeader.cxx AliGenCocktailEventHeader.cxx AliGenGeVSimEventHeader.cxx AliGenHijingEventHeader.cxx AliCollisionGeometry.cxx AliGenDPMjetEventHeader.cxx AliGenHerwigEventHeader.cxx AliGenEposEventHeader.cxx AliStack.cxx AliMCEventHandler.cxx AliInputEventHandler.cxx AliTrackReference.cxx AliSysInfo.cxx AliMCEvent.cxx AliMCParticle.cxx AliMCVertex.cxx AliMagF.cxx AliMagWrapCheb.cxx AliCheb3D.cxx AliCheb3DCalc.cxx AliNeutralTrackParam.cxx AliCodeTimer.cxx AliPDG.cxx AliTimeStamp.cxx AliTriggerScalers.cxx AliTriggerScalersRecord.cxx AliExternalTrackParam.cxx AliQA.cxx AliITSPidParams.cxx AliPIDResponse.cxx AliITSPIDResponse.cxx AliTPCPIDResponse.cxx AliTOFPIDResponse.cxx AliTRDPIDResponse.cxx AliDAQ.cxx AliRefArray.cxx)
 
 string(REPLACE ".cxx" ".h" HDRS  "${SRCS}")
 
index 0e8a63e..a4acecb 100644 (file)
@@ -22,7 +22,7 @@
 #pragma link C++ class AliVCuts+;
 #pragma link C++ class AliVVZERO+;
 #pragma link C++ class AliCentrality+;
-
+#pragma link C++ class AliEventplane+;
 
 #pragma link C++ class AliMixedEvent+;