Added class AliFlowEvent, inherits from AliFlowEventSimple.
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 20 Apr 2010 17:23:26 +0000 (17:23 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 20 Apr 2010 17:23:26 +0000 (17:23 +0000)
15 files changed:
PWG2/FLOW/AliFlowCommon/AliFlowEvent.cxx [new file with mode: 0644]
PWG2/FLOW/AliFlowCommon/AliFlowEvent.h [new file with mode: 0644]
PWG2/FLOW/AliFlowCommon/AliFlowEventSimple.cxx
PWG2/FLOW/AliFlowCommon/AliFlowEventSimple.h
PWG2/FLOW/AliFlowCommon/AliFlowTrackSimple.cxx
PWG2/FLOW/AliFlowCommon/AliFlowTrackSimple.h
PWG2/FLOW/macros/compareFlowResults.C
PWG2/FLOW/macros/makeWeights.C
PWG2/FLOW/macros/mergeOutput.C
PWG2/FLOW/macros/redoFinish.C
PWG2/FLOW/macros/runFlowAnalysis.C
PWG2/FLOW/macros/runFlowAnalysisOnTheFly.C
PWG2/FLOW/macros/showSpread.C
PWG2/PWG2flowCommonLinkDef.h
PWG2/libPWG2flowCommon.pkg

diff --git a/PWG2/FLOW/AliFlowCommon/AliFlowEvent.cxx b/PWG2/FLOW/AliFlowCommon/AliFlowEvent.cxx
new file mode 100644 (file)
index 0000000..8ec917f
--- /dev/null
@@ -0,0 +1,363 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, 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.                  *
+ **************************************************************************/
+
+/*****************************************************************
+  AliFlowEvent: Event container for flow analysis
+
+  origin:   Mikolaj Krzewicki  (mikolaj.krzewicki@cern.ch)
+*****************************************************************/
+
+#include "Riostream.h"
+#include "TList.h"
+#include "AliMCEvent.h"
+#include "AliMCParticle.h"
+#include "AliCFManager.h"
+#include "AliESDtrack.h"
+#include "AliESDEvent.h"
+#include "AliAODEvent.h"
+#include "AliGenCocktailEventHeader.h"
+#include "AliGenEposEventHeader.h"
+#include "AliGenHijingEventHeader.h"
+#include "AliGenGeVSimEventHeader.h"
+#include "AliFlowTrackSimpleCuts.h"
+#include "AliFlowEventSimple.h"
+#include "AliFlowEvent.h"
+
+ClassImp(AliFlowEvent)
+
+//-----------------------------------------------------------------------
+
+AliFlowEvent::AliFlowEvent():
+  AliFlowEventSimple()
+{
+  //ctor
+  cout << "AliFlowEvent: Default constructor to be used only by root for io" << endl;
+}
+
+//-----------------------------------------------------------------------
+
+AliFlowEvent::AliFlowEvent(const AliFlowEvent& event):
+  AliFlowEventSimple(event)
+{
+  //cpy ctor
+}
+
+//-----------------------------------------------------------------------
+
+AliFlowEvent& AliFlowEvent::operator=(const AliFlowEvent& event)
+{
+  //assignment operator
+  AliFlowEventSimple::operator=(event);
+  return *this;
+}
+
+//-----------------------------------------------------------------------
+void AliFlowEvent::SetMCReactionPlaneAngle(const AliMCEvent* mcEvent)
+{
+  //sets the event plane angle from the proper header in the MC
+
+  //COCKTAIL with HIJING
+  if (!strcmp(mcEvent-> GenEventHeader()->GetName(),"Cocktail Header"))   //returns 0 if matches
+  {
+    AliGenCocktailEventHeader *headerC = dynamic_cast<AliGenCocktailEventHeader *> (mcEvent-> GenEventHeader());
+    if (headerC)
+    {
+      TList *lhd = headerC->GetHeaders();
+      if (lhd)
+      {
+        AliGenHijingEventHeader *hdh = dynamic_cast<AliGenHijingEventHeader *> (lhd->At(0));
+        if (hdh) AliFlowEventSimple::SetMCReactionPlaneAngle( hdh->ReactionPlaneAngle() );
+      }
+    }
+  }
+  else if (!strcmp(mcEvent-> GenEventHeader()->GetName(),"GeVSim header"))   //returns 0 if matches
+  {
+    AliGenGeVSimEventHeader* headerG = dynamic_cast<AliGenGeVSimEventHeader*>(mcEvent->GenEventHeader());
+    if (headerG) AliFlowEventSimple::SetMCReactionPlaneAngle( headerG->GetEventPlane() );
+  }
+  else if (!strcmp(mcEvent-> GenEventHeader()->GetName(),"Hijing"))   //returns 0 if matches
+  {
+    AliGenHijingEventHeader* headerH = dynamic_cast<AliGenHijingEventHeader*>(mcEvent->GenEventHeader());
+    if (headerH) AliFlowEventSimple::SetMCReactionPlaneAngle( headerH->ReactionPlaneAngle() );
+  }
+  else if (!strcmp(mcEvent->GenEventHeader()->GetName(),"EPOS"))
+  {
+    AliGenEposEventHeader* headerE = dynamic_cast<AliGenEposEventHeader*>(mcEvent->GenEventHeader());
+    if (headerE) AliFlowEventSimple::SetMCReactionPlaneAngle( headerE->ReactionPlaneAngle() );
+  }
+}
+
+//-----------------------------------------------------------------------
+AliFlowEvent::AliFlowEvent( const AliMCEvent* anInput,
+                            const AliCFManager* intCFManager,
+                            const AliCFManager* diffCFManager):
+  AliFlowEventSimple(20)
+{
+  //Fills the event from the MC kinematic information
+
+  Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ;
+
+    //loop over tracks
+    for (Int_t itrkN=0; itrkN<iNumberOfInputTracks; itrkN++)
+    {
+      //get input particle
+      AliMCParticle* pParticle = dynamic_cast<AliMCParticle*>(anInput->GetTrack(itrkN));
+      if (!pParticle) continue;
+
+      //check if pParticle passes the cuts
+      Bool_t rpOK = kTRUE;
+      Bool_t poiOK = kTRUE;
+      if (intCFManager && diffCFManager)
+      {
+        rpOK = intCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pParticle);
+        poiOK = diffCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pParticle);
+      }
+      if (!(rpOK||poiOK)) continue;
+
+      //TODO maybe make a class AliFlowTrack with a constructor from AliVParticle
+      AliFlowTrackSimple* pTrack = new AliFlowTrackSimple();
+      pTrack->SetEta(pParticle->Eta());
+      pTrack->SetPhi(pParticle->Phi());
+      pTrack->SetPt(pParticle->Pt());
+
+      if (rpOK)
+      {
+        pTrack->SetForRPSelection(kTRUE);
+        fEventNSelTracksRP++;
+      }
+      if (poiOK)
+      {
+        pTrack->SetForPOISelection(kTRUE);
+      }
+
+      AddTrack(pTrack) ;
+    }//for all tracks
+  SetMCReactionPlaneAngle(anInput);
+}
+
+//-----------------------------------------------------------------------
+AliFlowEvent::AliFlowEvent( const AliESDEvent* anInput,
+                            const AliCFManager* intCFManager,
+                            const AliCFManager* diffCFManager ):
+  AliFlowEventSimple(20)
+{
+  //Fills the event 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 rpOK = kTRUE;
+    Bool_t poiOK = kTRUE;
+    if (intCFManager && diffCFManager)
+    {
+      rpOK = ( intCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle) &&
+               intCFManager->CheckParticleCuts(AliCFManager::kPartSelCuts,pParticle));
+      poiOK = ( diffCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle) &&
+                diffCFManager->CheckParticleCuts(AliCFManager::kPartSelCuts,pParticle));
+    }
+    if (!(rpOK || poiOK)) continue;
+
+    //make new AliFLowTrackSimple
+    AliFlowTrackSimple* pTrack = new AliFlowTrackSimple();
+    pTrack->SetPt(pParticle->Pt() );
+    pTrack->SetEta(pParticle->Eta() );
+    pTrack->SetPhi(pParticle->Phi() );
+
+    //marking the particles used for int. flow:
+    if(rpOK)
+    {
+      pTrack->SetForRPSelection(kTRUE);
+      fEventNSelTracksRP++;
+    }
+    //marking the particles used for diff. flow:
+    if(poiOK)
+    {
+      pTrack->SetForPOISelection(kTRUE);
+    }
+
+    AddTrack(pTrack);
+  }//end of while (itrkN < iNumberOfInputTracks)
+}
+
+//-----------------------------------------------------------------------
+AliFlowEvent::AliFlowEvent( const AliAODEvent* anInput,
+                            const AliCFManager* intCFManager,
+                            const AliCFManager* diffCFManager):
+  AliFlowEventSimple(20)
+{
+  //Fills the event from the AOD
+  Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ;
+
+    //loop over tracks
+  for (Int_t itrkN=0; itrkN<iNumberOfInputTracks; itrkN++)
+    {
+      AliAODTrack* pParticle = anInput->GetTrack(itrkN);   //get input particle
+
+      //check if pParticle passes the cuts
+      Bool_t rpOK = kTRUE;
+      Bool_t poiOK = kTRUE;
+      if (intCFManager && diffCFManager)
+      {
+        rpOK = ( intCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle) &&
+                 intCFManager->CheckParticleCuts(AliCFManager::kPartSelCuts,pParticle));
+        poiOK = ( diffCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle) &&
+                  diffCFManager->CheckParticleCuts(AliCFManager::kPartSelCuts,pParticle));
+      }
+      if (!(rpOK || poiOK)) continue;
+
+      //make new AliFlowTrackSimple
+      AliFlowTrackSimple* pTrack = new AliFlowTrackSimple();
+      pTrack->SetPt(pParticle->Pt() );
+      pTrack->SetEta(pParticle->Eta() );
+      pTrack->SetPhi(pParticle->Phi() );
+
+      if (rpOK)
+      {
+        pTrack->SetForRPSelection(kTRUE);
+        fEventNSelTracksRP++;
+      }
+      if (poiOK)
+      {
+        pTrack->SetForPOISelection(kTRUE);
+      }
+      AddTrack(pTrack);
+    }
+
+  //  if (iSelParticlesRP >= fMinMult && iSelParticlesRP <= fMaxMult)
+  //  {
+  //    if ( (++fCount % 100) == 0)
+  //    {
+  //      if (!fMCReactionPlaneAngle == 0) cout<<" MC Reaction Plane Angle = "<<  fMCReactionPlaneAngle << endl;
+  //      else cout<<" MC Reaction Plane Angle = unknown "<< endl;
+  //      cout<<" iGoodTracks = "<<iGoodTracks<<endl;
+  //      cout<<" # of RP selected tracks = "<<iSelParticlesRP<<endl;
+  //      cout<<" # of POI selected tracks = "<<iSelParticlesPOI<<endl;
+  //      cout << "# " << fCount << " events processed" << endl;
+  //    }
+  //    return pEvent;
+  //  }
+  //  else
+  //  {
+  //    cout<<"Not enough tracks in the FlowEventSimple"<<endl;
+  //    return 0;
+  //  }
+  //}
+  //else
+  //{
+  //  cout<<"Event does not pass multiplicity cuts"<<endl;
+  //  return 0;
+  //}
+
+}
+
+//-----------------------------------------------------------------------
+AliFlowEvent::AliFlowEvent( const AliESDEvent* anInput,
+                            const AliMCEvent* anInputMc,
+                            Int_t anOption,
+                            const AliCFManager* intCFManager,
+                            const AliCFManager* diffCFManager ):
+  AliFlowEventSimple(20)
+{
+  //fills the event with tracks from the ESD and kinematics from the MC info via the track label
+  if (!(anOption ==0 || anOption ==1))
+  {
+    cout<<"WRONG OPTION IN AliFlowEventMaker::FillTracks(AliESDEvent* anInput, AliMCEvent* anInputMc, Int_t anOption)"<<endl;
+    exit(1);
+  }
+
+  Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ;
+
+  Int_t iNumberOfInputTracksMC = anInputMc->GetNumberOfTracks() ;
+  if (iNumberOfInputTracksMC==-1)
+  {
+    cout<<"Skipping Event -- No MC information available for this event"<<endl;
+    return;
+  }
+
+  //loop over ESD tracks
+  for (Int_t itrkN=0; itrkN<iNumberOfInputTracks; itrkN++)
+    {
+      AliESDtrack* pParticle = anInput->GetTrack(itrkN);   //get input particle
+      //get Label
+      Int_t iLabel = pParticle->GetLabel();
+      //match to mc particle
+      AliMCParticle* pMcParticle = (AliMCParticle*) anInputMc->GetTrack(TMath::Abs(iLabel));
+
+      //check
+      if (TMath::Abs(pParticle->GetLabel())!=pMcParticle->Label()) cout<<"pParticle->GetLabel()!=pMcParticle->Label() "<<pParticle->GetLabel()<<"  "<<pMcParticle->Label()<<endl;
+
+      //check if pParticle passes the cuts
+      Bool_t rpOK = kTRUE;
+      Bool_t poiOK = kTRUE;
+      if (intCFManager && diffCFManager)
+      {
+      if(anOption == 0)
+      {
+        //cout<<"take the PID from the MC & the kinematics from the ESD"<<endl;
+        if (intCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pMcParticle,"mcGenCuts1") &&
+            intCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle))
+          rpOK=kTRUE;
+        if (diffCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pMcParticle,"mcGenCuts2") &&
+            diffCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle))
+          poiOK=kTRUE;
+      }
+      else if (anOption == 1)
+      {
+        //cout<<"take the PID and kinematics from the MC"<<endl;
+        if (intCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pMcParticle))
+          rpOK=kTRUE;
+        if (diffCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pMcParticle))
+          poiOK=kTRUE;
+      }
+      }
+
+      if (!(rpOK || poiOK)) continue;
+
+      //make new AliFlowTrackSimple
+      AliFlowTrackSimple* pTrack = new AliFlowTrackSimple();
+      if(anOption == 0)   //take the PID from the MC & the kinematics from the ESD
+      {
+        pTrack->SetPt(pParticle->Pt() );
+        pTrack->SetEta(pParticle->Eta() );
+        pTrack->SetPhi(pParticle->Phi() );
+      }
+      else if (anOption == 1)   //take the PID and kinematics from the MC
+      {
+        pTrack->SetPt(pMcParticle->Pt() );
+        pTrack->SetEta(pMcParticle->Eta() );
+        pTrack->SetPhi(pMcParticle->Phi() );
+      }
+      else
+      {
+        cout<<"Not a valid option"<<endl;
+      }
+
+      if (rpOK)
+      {
+        fEventNSelTracksRP++;
+        pTrack->SetForRPSelection();
+      }
+      if (poiOK) pTrack->SetForPOISelection();
+
+      AddTrack(pTrack);
+    }
+    SetMCReactionPlaneAngle(anInputMc);
+}
+
diff --git a/PWG2/FLOW/AliFlowCommon/AliFlowEvent.h b/PWG2/FLOW/AliFlowCommon/AliFlowEvent.h
new file mode 100644 (file)
index 0000000..0373b1f
--- /dev/null
@@ -0,0 +1,53 @@
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+* See cxx source for full Copyright notice */
+/* $Id$ */
+
+/*****************************************************************
+  AliFlowEvent: Event container for flow analysis                  
+                                     
+  origin:   Mikolaj Krzewicki  (mikolaj.krzewicki@cern.ch)
+*****************************************************************/
+
+#ifndef ALIFLOWEVENT_H
+#define ALIFLOWEVENT_H
+
+class TTree;
+class AliFlowTrackSimpleCuts;
+class AliCFManager;
+class AliMCEvent;
+class AliESDEvent;
+class AliMCEvent;
+class AliAODEvent;
+
+#include "AliFlowEventSimple.h"
+
+class AliFlowEvent: public AliFlowEventSimple {
+public:
+  AliFlowEvent();
+  AliFlowEvent(const AliFlowEvent& event);
+  AliFlowEvent& operator=(const AliFlowEvent& event);
+  virtual  ~AliFlowEvent() {}
+
+  AliFlowEvent( const AliMCEvent* anInput,
+                const AliCFManager* rpCFManager=NULL,
+                const AliCFManager* poiCFManager=NULL ); //use CF(2x)
+  AliFlowEvent( const AliESDEvent* anInput,  
+                const AliCFManager* rpCFManager=NULL, 
+                const AliCFManager* poiCFManager=NULL ); //use CF(2x)
+  AliFlowEvent( const AliAODEvent* anInput, 
+                const AliCFManager* rpCFManager=NULL, 
+                const AliCFManager* poiCFManager=NULL );  //use CF(2x)
+  AliFlowEvent( const AliESDEvent* anInput, 
+                const AliMCEvent* anInputMc, 
+                Int_t anOption=-1,
+                const AliCFManager* rpCFManager=NULL, 
+                const AliCFManager* poiCFManager=NULL );  //use CF(2x)
+
+  void SetMCReactionPlaneAngle(const AliMCEvent* mcEvent);
+
+  ClassDef(AliFlowEvent,1)
+};
+
+#endif
+
+
index 3ad1a66..34932ac 100644 (file)
 #include "AliFlowTrackSimple.h"
 #include "AliFlowEventSimple.h"
 #include "AliFlowTrackSimpleCuts.h"
+#include "TRandom.h"
 
 ClassImp(AliFlowEventSimple)
 
 //-----------------------------------------------------------------------
-
 AliFlowEventSimple::AliFlowEventSimple():
   fTrackCollection(NULL),
   fNumberOfTracks(0),
@@ -58,7 +58,6 @@ AliFlowEventSimple::AliFlowEventSimple():
 }
 
 //-----------------------------------------------------------------------
-
 AliFlowEventSimple::AliFlowEventSimple(Int_t aLenght):
   fTrackCollection(NULL),
   fNumberOfTracks(0),
@@ -74,7 +73,6 @@ AliFlowEventSimple::AliFlowEventSimple(Int_t aLenght):
 }
 
 //-----------------------------------------------------------------------
-
 AliFlowEventSimple::AliFlowEventSimple(const AliFlowEventSimple& anEvent):
   TObject(),
   fTrackCollection(anEvent.fTrackCollection),
@@ -90,9 +88,9 @@ AliFlowEventSimple::AliFlowEventSimple(const AliFlowEventSimple& anEvent):
 }
 
 //-----------------------------------------------------------------------
-
 AliFlowEventSimple& AliFlowEventSimple::operator=(const AliFlowEventSimple& anEvent)
 {
+  if (!fTrackCollection) fTrackCollection = new TObjArray();
   *fTrackCollection = *anEvent.fTrackCollection ;
   fNumberOfTracks = anEvent.fNumberOfTracks;
   fEventNSelTracksRP = anEvent.fEventNSelTracksRP;
@@ -106,7 +104,6 @@ AliFlowEventSimple& AliFlowEventSimple::operator=(const AliFlowEventSimple& anEv
 }
 
 //-----------------------------------------------------------------------
-
 AliFlowEventSimple::~AliFlowEventSimple()
 {
   //destructor
@@ -118,15 +115,24 @@ AliFlowEventSimple::~AliFlowEventSimple()
 }
 
 //-----------------------------------------------------------------------
-
 AliFlowTrackSimple* AliFlowEventSimple::GetTrack(Int_t i)
 {
   //get track i from collection
-  AliFlowTrackSimple* pTrack = (AliFlowTrackSimple*)TrackCollection()->At(i) ;
+  if (i>=fNumberOfTracks) return NULL;
+  AliFlowTrackSimple* pTrack = static_cast<AliFlowTrackSimple*>(TrackCollection()->At(i)) ;
   return pTrack;
 }
 
 //-----------------------------------------------------------------------
+void AliFlowEventSimple::AddTrack( AliFlowTrackSimple* track )
+{
+  //add a track
+  if (!fTrackCollection) return;
+  fTrackCollection->AddLast(track);
+  fNumberOfTracks++;
+}
+
+//-----------------------------------------------------------------------
 AliFlowVector AliFlowEventSimple::GetQ(Int_t n, TList *weightsList, Bool_t usePhiWeights, Bool_t usePtWeights, Bool_t useEtaWeights)
 {
   // calculate Q-vector in harmonic n without weights (default harmonic n=2)
@@ -425,21 +431,21 @@ AliFlowEventSimple::AliFlowEventSimple( TTree* inputTree,
     if (!pParticle) continue; //no particle
     if (!pParticle->IsPrimary()) continue;
 
-    Bool_t bPassedRPFlowCuts = rpCuts->PassesCuts(pParticle);
-    Bool_t bPassedPOIFlowCuts = poiCuts->PassesCuts(pParticle);
+    Bool_t rpOK = rpCuts->PassesCuts(pParticle);
+    Bool_t poiOK = poiCuts->PassesCuts(pParticle);
     
-    if (bPassedRPFlowCuts || bPassedPOIFlowCuts)
+    if (rpOK || poiOK)
     {
       AliFlowTrackSimple* pTrack = new AliFlowTrackSimple(pParticle);
 
       //marking the particles used for int. flow:
-      if(bPassedRPFlowCuts)
+      if(rpOK)
       {
         pTrack->SetForRPSelection(kTRUE);
         fEventNSelTracksRP++;
       }
       //marking the particles used for diff. flow:
-      if(bPassedPOIFlowCuts)
+      if(poiOK)
       {
         pTrack->SetForPOISelection(kTRUE);
         iSelParticlesPOI++;
@@ -468,3 +474,15 @@ void AliFlowEventSimple::CloneTracks(Int_t n)
     }
   }
 }
+
+//_____________________________________________________________________________
+void AliFlowEventSimple::ResolutionPt(Double_t res)
+{
+  //smear pt of all tracks by gaussian with sigma=res
+  for (Int_t i=0; i<fNumberOfTracks; i++)
+  {
+    AliFlowTrackSimple* track = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i));
+    if (!track) continue;
+    track->ResolutionPt(res);
+  }
+}
index 8c8ce1d..a260013 100644 (file)
@@ -43,15 +43,18 @@ class AliFlowEventSimple: public TObject {
   Double_t GetMCReactionPlaneAngle() const          { return fMCReactionPlaneAngle; }
   void     SetMCReactionPlaneAngle(Double_t fPhiRP) { fMCReactionPlaneAngle=fPhiRP; fMCReactionPlaneAngleIsSet=kTRUE; }
 
+  void ResolutionPt(Double_t res);
+
   void CloneTracks(Int_t n);
  
   AliFlowTrackSimple* GetTrack(Int_t i);
-  TObjArray* TrackCollection() const                { return fTrackCollection; }
+  void AddTrack( AliFlowTrackSimple* track ); 
+  TObjArray* TrackCollection() const                { return fTrackCollection; } //deprecated!
  
   AliFlowVector GetQ(Int_t n=2, TList *weightsList=NULL, Bool_t usePhiWeights=kFALSE, Bool_t usePtWeights=kFALSE, Bool_t useEtaWeights=kFALSE);
   void Get2Qsub(AliFlowVector* Qarray, Int_t n=2, TList *weightsList=NULL, Bool_t usePhiWeights=kFALSE, Bool_t usePtWeights=kFALSE, Bool_t useEtaWeights=kFALSE);  
 
- private:
+ protected:
   TObjArray*              fTrackCollection;           // collection of tracks
   Int_t                   fNumberOfTracks;            // number of tracks
   Int_t                   fEventNSelTracksRP;         // number of tracks that have passed the RP selection
index 528ff59..69766fe 100644 (file)
@@ -25,6 +25,7 @@
 #include "TNamed.h"
 #include "TParticle.h"
 #include "AliFlowTrackSimple.h"
+#include "TRandom.h"
 
 ClassImp(AliFlowTrackSimple)
 
@@ -86,3 +87,16 @@ AliFlowTrackSimple::~AliFlowTrackSimple()
   
 }
 
+//----------------------------------------------------------------------- 
+void AliFlowTrackSimple::AddFlow( Double_t flow, Double_t planeAngle )
+{
+  //add flow wrt the eventplane
+  fPhi -= flow*TMath::Sin(2*(fPhi-planeAngle));
+}
+
+//----------------------------------------------------------------------- 
+void AliFlowTrackSimple::ResolutionPt(Double_t res)
+{
+  //smear the pt by a gaussian with sigma=res
+  fPt += gRandom->Gaus(0.,res);
+}
index 2883a6e..04f68f5 100644 (file)
@@ -39,9 +39,13 @@ class AliFlowTrackSimple: public TNamed {
   void SetEta(Double_t eta);
   void SetPt(Double_t pt); 
   void SetPhi(Double_t phi);
-  void SetForRPSelection(Bool_t b); 
-  void SetForPOISelection(Bool_t b); 
+  void SetForRPSelection(Bool_t b=kTRUE); 
+  void SetForPOISelection(Bool_t b=kTRUE); 
   void SetForSubevent(Int_t i); 
+  
+  void ResolutionPt(Double_t resolution);
+
+  void AddFlow( Double_t flow, Double_t planeAngle);
     
  private:
   Double_t fEta;    // eta
index 3ef4498..1bb3619 100644 (file)
@@ -3571,7 +3571,8 @@ void LoadPlotLibraries(const libModes mode) {
     
     // Flow event
     gROOT->LoadMacro("AliFlowCommon/AliFlowVector.cxx+"); 
-    gROOT->LoadMacro("AliFlowCommon/AliFlowTrackSimple.cxx+");    
+    gROOT->LoadMacro("AliFlowCommon/AliFlowTrackSimple.cxx+");
+    gROOT->LoadMacro("AliFlowCommon/AliFlowEvent.cxx+");
     gROOT->LoadMacro("AliFlowCommon/AliFlowEventSimple.cxx+");
     
     // Cuts
index 9cbf29c..ca6caa0 100755 (executable)
@@ -321,7 +321,8 @@ void LoadLibrariesMW(const libModes mode) {
     
     // Flow event
     gROOT->LoadMacro("AliFlowCommon/AliFlowVector.cxx+"); 
-    gROOT->LoadMacro("AliFlowCommon/AliFlowTrackSimple.cxx+");    
+    gROOT->LoadMacro("AliFlowCommon/AliFlowTrackSimple.cxx+");
+    gROOT->LoadMacro("AliFlowCommon/AliFlowEvent.cxx+");
     gROOT->LoadMacro("AliFlowCommon/AliFlowEventSimple.cxx+");
     
     // Cuts
index a158ddf..c9a127b 100644 (file)
@@ -201,7 +201,8 @@ void LoadLibrariesMO(const libModes mode) {
     
     // Flow event
     gROOT->LoadMacro("AliFlowCommon/AliFlowVector.cxx+"); 
-    gROOT->LoadMacro("AliFlowCommon/AliFlowTrackSimple.cxx+");    
+    gROOT->LoadMacro("AliFlowCommon/AliFlowTrackSimple.cxx+");
+    gROOT->LoadMacro("AliFlowCommon/AliFlowEvent.cxx+");
     gROOT->LoadMacro("AliFlowCommon/AliFlowEventSimple.cxx+");
     
     // Cuts
index 61e58b0..f16c390 100644 (file)
@@ -252,7 +252,8 @@ void LoadLibrariesRF(const libModes mode) {
     
     // Flow event
     gROOT->LoadMacro("AliFlowCommon/AliFlowVector.cxx+"); 
-    gROOT->LoadMacro("AliFlowCommon/AliFlowTrackSimple.cxx+");    
+    gROOT->LoadMacro("AliFlowCommon/AliFlowTrackSimple.cxx+");
+    gROOT->LoadMacro("AliFlowCommon/AliFlowEvent.cxx+");
     gROOT->LoadMacro("AliFlowCommon/AliFlowEventSimple.cxx+");
     
     // Cuts
index 4be845d..7e428a1 100644 (file)
@@ -10,6 +10,7 @@
 #include <AliFlowCommon/AliFlowCumuConstants.h>
 #include <AliFlowCommon/AliFlowVector.h>
 #include <AliFlowCommon/AliFlowTrackSimple.h>
+#include <AliFlowCommon/AliFlowEvent.h>
 #include <AliFlowCommon/AliFlowEventSimple.h>
 #include <AliFlowCommon/AliFlowTrackSimpleCuts.h>
 #include <AliFlowCommon/AliFlowCommonHist.h>
@@ -617,7 +618,8 @@ void LoadLibraries(const anaModes mode) {
     
     // Flow event
     gROOT->LoadMacro("AliFlowCommon/AliFlowVector.cxx+"); 
-    gROOT->LoadMacro("AliFlowCommon/AliFlowTrackSimple.cxx+");    
+    gROOT->LoadMacro("AliFlowCommon/AliFlowTrackSimple.cxx+");
+    gROOT->LoadMacro("AliFlowCommon/AliFlowEvent.cxx+");
     gROOT->LoadMacro("AliFlowCommon/AliFlowEventSimple.cxx+");
     
     // Cuts
index e1a3a63..ca49710 100644 (file)
@@ -756,7 +756,8 @@ void LoadLibraries(const anaModes mode) {
     
     // Flow event
     gROOT->LoadMacro("AliFlowCommon/AliFlowVector.cxx+"); 
-    gROOT->LoadMacro("AliFlowCommon/AliFlowTrackSimple.cxx+");    
+    gROOT->LoadMacro("AliFlowCommon/AliFlowTrackSimple.cxx+");
+    gROOT->LoadMacro("AliFlowCommon/AliFlowEvent.cxx+");
     gROOT->LoadMacro("AliFlowCommon/AliFlowEventSimple.cxx+");
     
     // Cuts
index 8d56d1d..dc2ccc8 100644 (file)
@@ -456,7 +456,8 @@ void LoadLibrariesSS(const libModes mode) {
     
     // Flow event
     gROOT->LoadMacro("AliFlowCommon/AliFlowVector.cxx+"); 
-    gROOT->LoadMacro("AliFlowCommon/AliFlowTrackSimple.cxx+");    
+    gROOT->LoadMacro("AliFlowCommon/AliFlowTrackSimple.cxx+");
+    gROOT->LoadMacro("AliFlowCommon/AliFlowEvent.cxx+");
     gROOT->LoadMacro("AliFlowCommon/AliFlowEventSimple.cxx+");
     
     // Cuts
index 699d8a5..a8d638b 100644 (file)
@@ -10,6 +10,7 @@
 
 #pragma link C++ class AliFlowVector+;
 #pragma link C++ class AliFlowTrackSimple+;
+#pragma link C++ class AliFlowEvent+;
 #pragma link C++ class AliFlowEventSimple+;
 
 #pragma link C++ class AliFlowTrackSimpleCuts+;
index 655be1f..e0f7e63 100644 (file)
@@ -1,6 +1,7 @@
 #-*- Mode: Makefile -*-
 
-SRCS= FLOW/AliFlowCommon/AliFlowEventSimple.cxx \
+SRCS= FLOW/AliFlowCommon/AliFlowEvent.cxx \
+      FLOW/AliFlowCommon/AliFlowEventSimple.cxx \
       FLOW/AliFlowCommon/AliFlowTrackSimple.cxx \
       FLOW/AliFlowCommon/AliFlowTrackSimpleCuts.cxx \
       FLOW/AliFlowCommon/AliFlowVector.cxx \