restructure to include tracklets (empty constructor will be filled soon)
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 7 Jun 2010 12:29:18 +0000 (12:29 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 7 Jun 2010 12:29:18 +0000 (12:29 +0000)
PWG2/FLOW/AliFlowCommon/AliFlowEventSimple.cxx
PWG2/FLOW/AliFlowCommon/AliFlowEventSimple.h
PWG2/FLOW/AliFlowCommon/AliFlowTrackSimple.cxx
PWG2/FLOW/AliFlowCommon/AliFlowTrackSimple.h
PWG2/FLOW/AliFlowTasks/AliFlowEvent.cxx
PWG2/FLOW/AliFlowTasks/AliFlowEvent.h
PWG2/PWG2flowTasksLinkDef.h
PWG2/libPWG2flowTasks.pkg

index 56b8f17..688d408 100644 (file)
@@ -498,13 +498,13 @@ void AliFlowEventSimple::TagSubeventsInEta(Double_t etaMinA, Double_t etaMaxA, D
 }
 
 //_____________________________________________________________________________
-void AliFlowEventSimple::AddFlow(Double_t flow)
+void AliFlowEventSimple::AddV2(Double_t v2)
 {
-  //add flow to all tracks wrt the reaction plane angle
+  //add v2 to all tracks wrt the reaction plane angle
   for (Int_t i=0; i<fNumberOfTracks; i++)
   {
     AliFlowTrackSimple* track = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i));
-    if (track) track->AddFlow(flow, fMCReactionPlaneAngle);
+    if (track) track->AddV2(v2, fMCReactionPlaneAngle, 0.001);
   }
 }
 
index e4c85dd..81c67fc 100644 (file)
@@ -46,7 +46,7 @@ class AliFlowEventSimple: public TObject {
   void ResolutionPt(Double_t res);
   void TagSubeventsInEta(Double_t etaMinA, Double_t etaMaxA, Double_t etaMinB, Double_t etaMaxB );
   void CloneTracks(Int_t n);
-  void AddFlow( Double_t flow );
+  void AddV2( Double_t v2 );
  
   AliFlowTrackSimple* GetTrack(Int_t i);
   void AddTrack( AliFlowTrackSimple* track ); 
index df345dd..868ce17 100644 (file)
 #include "TParticle.h"
 #include "AliFlowTrackSimple.h"
 #include "TRandom.h"
+#include "AliLog.h"
 
 ClassImp(AliFlowTrackSimple)
 
 //-----------------------------------------------------------------------
-
 AliFlowTrackSimple::AliFlowTrackSimple():
   fEta(0),
   fPt(0),
@@ -42,6 +42,17 @@ AliFlowTrackSimple::AliFlowTrackSimple():
 }
 
 //-----------------------------------------------------------------------
+AliFlowTrackSimple::AliFlowTrackSimple(Double_t phi, Double_t eta, Double_t pt):
+  fEta(eta),
+  fPt(pt),
+  fPhi(phi),
+  fFlowBits(0),
+  fSubEventBits(0)
+{
+  //constructor 
+}
+
+//-----------------------------------------------------------------------
 AliFlowTrackSimple::AliFlowTrackSimple(const TParticle* p):
   fEta(p->Eta()),
   fPt(p->Pt()),
@@ -79,7 +90,6 @@ AliFlowTrackSimple& AliFlowTrackSimple::operator=(const AliFlowTrackSimple& aTra
 
 
 //----------------------------------------------------------------------- 
-
 AliFlowTrackSimple::~AliFlowTrackSimple()
 {
   //destructor
@@ -87,15 +97,27 @@ AliFlowTrackSimple::~AliFlowTrackSimple()
 }
 
 //----------------------------------------------------------------------- 
-void AliFlowTrackSimple::AddFlow( Double_t flow, Double_t reactionPlaneAngle )
+void AliFlowTrackSimple::ResolutionPt(Double_t res)
 {
-  //add flow wrt the eventplane
-  fPhi -= flow*TMath::Sin(2*(fPhi-reactionPlaneAngle));
+  //smear the pt by a gaussian with sigma=res
+  fPt += gRandom->Gaus(0.,res);
 }
 
 //----------------------------------------------------------------------- 
-void AliFlowTrackSimple::ResolutionPt(Double_t res)
+void AliFlowTrackSimple::AddV2( Double_t v2, Double_t reactionPlaneAngle, Double_t precisionPhi, Int_t maxNumberOfIterations )
 {
-  //smear the pt by a gaussian with sigma=res
-  fPt += gRandom->Gaus(0.,res);
+  //afterburner, adds v2, uses Newton-Raphson iteration
+  Double_t phi0=fPhi;
+  Double_t f,fp,v2sin,v2cos,phiprev;
+
+  for (Int_t i=0; i<maxNumberOfIterations; i++)
+  {
+    phiprev=fPhi; //store last value for comparison
+    v2sin = v2*TMath::Sin(2.*(fPhi-reactionPlaneAngle));
+    v2cos = v2*TMath::Cos(2.*(fPhi-reactionPlaneAngle));
+    f = fPhi-phi0+v2sin;
+    fp = 1.+2.*v2cos; //first derivative
+    fPhi -= f/fp;
+    if (TMath::AreEqualAbs(phiprev,fPhi,precisionPhi)) break;
+  }
 }
index be1613a..e2ff593 100644 (file)
@@ -16,10 +16,11 @@ class TParticle;
 
 class AliFlowTrackSimple: public TNamed {
 
- public:
+public:
   AliFlowTrackSimple();
   AliFlowTrackSimple(const TParticle* p);
   AliFlowTrackSimple(const AliFlowTrackSimple& aTrack);
+  AliFlowTrackSimple(Double_t phi, Double_t eta, Double_t pt);
   AliFlowTrackSimple& operator=(const AliFlowTrackSimple& aTrack);
   virtual  ~AliFlowTrackSimple();
   
@@ -34,7 +35,7 @@ class AliFlowTrackSimple: public TNamed {
   TBits    GetFlowBits() const;
   Bool_t   InRPSelection() const; 
   Bool_t   InPOISelection() const; 
-  Bool_t   InSubevent(Int_t i) const; 
+  Bool_t   InSubevent(Int_t i) const;
       
   void SetEta(Double_t eta);
   void SetPt(Double_t pt); 
@@ -45,7 +46,8 @@ class AliFlowTrackSimple: public TNamed {
   
   void ResolutionPt(Double_t resolution);
 
-  void AddFlow( Double_t flow, Double_t reactionPlaneAngle);
+  void AddV2( Double_t v2, Double_t reactionPlaneAngle,
+                Double_t precision, Int_t maxNumberOfIterations=100 );
     
  private:
   Double_t fEta;    // eta
@@ -53,7 +55,6 @@ class AliFlowTrackSimple: public TNamed {
   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
-  
 
   ClassDef(AliFlowTrackSimple,1)                 // macro for rootcint
 
index 29381f8..aa2a05b 100644 (file)
 #include "AliGenEposEventHeader.h"
 #include "AliGenHijingEventHeader.h"
 #include "AliGenGeVSimEventHeader.h"
+#include "AliMultiplicity.h"
 #include "AliFlowTrackSimpleCuts.h"
 #include "AliFlowEventSimple.h"
+#include "AliFlowTrack.h"
 #include "AliFlowEvent.h"
 #include "AliLog.h"
 
@@ -105,8 +107,8 @@ void AliFlowEvent::SetMCReactionPlaneAngle(const AliMCEvent* mcEvent)
 
 //-----------------------------------------------------------------------
 AliFlowEvent::AliFlowEvent( const AliMCEvent* anInput,
-                            const AliCFManager* intCFManager,
-                            const AliCFManager* diffCFManager):
+                            const AliCFManager* rpCFManager,
+                            const AliCFManager* poiCFManager):
   AliFlowEventSimple(20)
 {
   //Fills the event from the MC kinematic information
@@ -123,10 +125,10 @@ AliFlowEvent::AliFlowEvent( const AliMCEvent* anInput,
     //check if pParticle passes the cuts
     Bool_t rpOK = kTRUE;
     Bool_t poiOK = kTRUE;
-    if (intCFManager && diffCFManager)
+    if (rpCFManager && poiCFManager)
     {
-      rpOK = intCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pParticle);
-      poiOK = diffCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pParticle);
+      rpOK = rpCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pParticle);
+      poiOK = poiCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pParticle);
     }
     if (!(rpOK||poiOK)) continue;
 
@@ -136,12 +138,12 @@ AliFlowEvent::AliFlowEvent( const AliMCEvent* anInput,
     pTrack->SetPhi(pParticle->Phi());
     pTrack->SetPt(pParticle->Pt());
 
-    if (rpOK && intCFManager)
+    if (rpOK && rpCFManager)
     {
       pTrack->SetForRPSelection(kTRUE);
       fEventNSelTracksRP++;
     }
-    if (poiOK && diffCFManager)
+    if (poiOK && poiCFManager)
     {
       pTrack->SetForPOISelection(kTRUE);
     }
@@ -153,8 +155,8 @@ AliFlowEvent::AliFlowEvent( const AliMCEvent* anInput,
 
 //-----------------------------------------------------------------------
 AliFlowEvent::AliFlowEvent( const AliESDEvent* anInput,
-                            const AliCFManager* intCFManager,
-                            const AliCFManager* diffCFManager ):
+                            const AliCFManager* rpCFManager,
+                            const AliCFManager* poiCFManager ):
   AliFlowEventSimple(20)
 {
   //Fills the event from the ESD
@@ -169,12 +171,12 @@ AliFlowEvent::AliFlowEvent( const AliESDEvent* anInput,
     //check if pParticle passes the cuts
     Bool_t rpOK = kTRUE;
     Bool_t poiOK = kTRUE;
-    if (intCFManager && diffCFManager)
+    if (rpCFManager && poiCFManager)
     {
-      rpOK = ( intCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle) &&
-               intCFManager->CheckParticleCuts(AliCFManager::kPartSelCuts,pParticle));
-      poiOK = ( diffCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle) &&
-                diffCFManager->CheckParticleCuts(AliCFManager::kPartSelCuts,pParticle));
+      rpOK = ( rpCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle) &&
+               rpCFManager->CheckParticleCuts(AliCFManager::kPartSelCuts,pParticle));
+      poiOK = ( poiCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle) &&
+                poiCFManager->CheckParticleCuts(AliCFManager::kPartSelCuts,pParticle));
     }
     if (!(rpOK || poiOK)) continue;
 
@@ -185,13 +187,13 @@ AliFlowEvent::AliFlowEvent( const AliESDEvent* anInput,
     pTrack->SetPhi(pParticle->Phi() );
 
     //marking the particles used for int. flow:
-    if(rpOK && intCFManager)
+    if(rpOK && rpCFManager)
     {
       pTrack->SetForRPSelection(kTRUE);
       fEventNSelTracksRP++;
     }
     //marking the particles used for diff. flow:
-    if(poiOK && diffCFManager)
+    if(poiOK && poiCFManager)
     {
       pTrack->SetForPOISelection(kTRUE);
     }
@@ -202,8 +204,8 @@ AliFlowEvent::AliFlowEvent( const AliESDEvent* anInput,
 
 //-----------------------------------------------------------------------
 AliFlowEvent::AliFlowEvent( const AliAODEvent* anInput,
-                            const AliCFManager* intCFManager,
-                            const AliCFManager* diffCFManager):
+                            const AliCFManager* rpCFManager,
+                            const AliCFManager* poiCFManager):
   AliFlowEventSimple(20)
 {
   //Fills the event from the AOD
@@ -217,12 +219,12 @@ AliFlowEvent::AliFlowEvent( const AliAODEvent* anInput,
     //check if pParticle passes the cuts
     Bool_t rpOK = kTRUE;
     Bool_t poiOK = kTRUE;
-    if (intCFManager && diffCFManager)
+    if (rpCFManager && poiCFManager)
     {
-      rpOK = ( intCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle) &&
-               intCFManager->CheckParticleCuts(AliCFManager::kPartSelCuts,pParticle));
-      poiOK = ( diffCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle) &&
-                diffCFManager->CheckParticleCuts(AliCFManager::kPartSelCuts,pParticle));
+      rpOK = ( rpCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle) &&
+               rpCFManager->CheckParticleCuts(AliCFManager::kPartSelCuts,pParticle));
+      poiOK = ( poiCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle) &&
+                poiCFManager->CheckParticleCuts(AliCFManager::kPartSelCuts,pParticle));
     }
     if (!(rpOK || poiOK)) continue;
 
@@ -232,12 +234,12 @@ AliFlowEvent::AliFlowEvent( const AliAODEvent* anInput,
     pTrack->SetEta(pParticle->Eta() );
     pTrack->SetPhi(pParticle->Phi() );
 
-    if (rpOK && intCFManager)
+    if (rpOK && rpCFManager)
     {
       pTrack->SetForRPSelection(kTRUE);
       fEventNSelTracksRP++;
     }
-    if (poiOK && diffCFManager)
+    if (poiOK && poiCFManager)
     {
       pTrack->SetForPOISelection(kTRUE);
     }
@@ -275,8 +277,8 @@ AliFlowEvent::AliFlowEvent( const AliAODEvent* anInput,
 AliFlowEvent::AliFlowEvent( const AliESDEvent* anInput,
                             const AliMCEvent* anInputMc,
                             KineSource anOption,
-                            const AliCFManager* intCFManager,
-                            const AliCFManager* diffCFManager ):
+                            const AliCFManager* rpCFManager,
+                            const AliCFManager* poiCFManager ):
   AliFlowEventSimple(20)
 {
   //fills the event with tracks from the ESD and kinematics from the MC info via the track label
@@ -311,22 +313,22 @@ AliFlowEvent::AliFlowEvent( const AliESDEvent* anInput,
     //check if pParticle passes the cuts
     Bool_t rpOK = kTRUE;
     Bool_t poiOK = kTRUE;
-    if (intCFManager && diffCFManager)
+    if (rpCFManager && poiCFManager)
     {
       if(anOption == kESDkine)
       {
-        if (intCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pMcParticle,"mcGenCuts1") &&
-            intCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle))
+        if (rpCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pMcParticle,"mcGenCuts1") &&
+            rpCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle))
           rpOK=kTRUE;
-        if (diffCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pMcParticle,"mcGenCuts2") &&
-            diffCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle))
+        if (poiCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pMcParticle,"mcGenCuts2") &&
+            poiCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle))
           poiOK=kTRUE;
       }
       else if (anOption == kMCkine)
       {
-        if (intCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pMcParticle))
+        if (rpCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pMcParticle))
           rpOK=kTRUE;
-        if (diffCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pMcParticle))
+        if (poiCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pMcParticle))
           poiOK=kTRUE;
       }
     }
@@ -348,12 +350,12 @@ AliFlowEvent::AliFlowEvent( const AliESDEvent* anInput,
       pTrack->SetPhi(pMcParticle->Phi() );
     }
 
-    if (rpOK && intCFManager)
+    if (rpOK && rpCFManager)
     {
       fEventNSelTracksRP++;
       pTrack->SetForRPSelection();
     }
-    if (poiOK && diffCFManager) pTrack->SetForPOISelection();
+    if (poiOK && poiCFManager) pTrack->SetForPOISelection();
 
     AddTrack(pTrack);
   }
index 614926e..18ec5f0 100644 (file)
@@ -18,6 +18,7 @@ class AliMCEvent;
 class AliESDEvent;
 class AliMCEvent;
 class AliAODEvent;
+class AliMultiplicity;
 
 #include "AliFlowEventSimple.h"
 
@@ -45,6 +46,9 @@ public:
                 KineSource anOption=kNoKine,
                 const AliCFManager* rpCFManager=NULL, 
                 const AliCFManager* poiCFManager=NULL );  //use CF(2x)
+  AliFlowEvent( const AliESDEvent* anInput,
+                const AliMultiplicity* anInputTracklets,
+                const AliCFManager* poiCFManager ){}
 
   void SetMCReactionPlaneAngle(const AliMCEvent* mcEvent);
 
index 647ed67..638ee56 100644 (file)
@@ -5,6 +5,7 @@
 #pragma link off all functions;
 
 #pragma link C++ class AliFlowEvent+;
+#pragma link C++ class AliFlowTrack+;
 #pragma link C++ class AliFlowEventSimpleMaker+;
 
 #pragma link C++ class AliAnalysisTaskScalarProduct+;
index af4a3e9..1cfd730 100644 (file)
@@ -2,6 +2,7 @@
 
 SRCS= FLOW/AliFlowTasks/AliFlowEventSimpleMaker.cxx \
       FLOW/AliFlowTasks/AliFlowEvent.cxx \
+      FLOW/AliFlowTasks/AliFlowTrack.cxx \
       FLOW/AliFlowTasks/AliAnalysisTaskScalarProduct.cxx \
       FLOW/AliFlowTasks/AliAnalysisTaskMCEventPlane.cxx \
       FLOW/AliFlowTasks/AliAnalysisTaskLYZEventPlane.cxx \