From 244c607ac42094e8dec0521e3e3a27c6f3bd1074 Mon Sep 17 00:00:00 2001 From: snelling Date: Mon, 7 Jun 2010 12:29:18 +0000 Subject: [PATCH] restructure to include tracklets (empty constructor will be filled soon) --- .../FLOW/AliFlowCommon/AliFlowEventSimple.cxx | 6 +- PWG2/FLOW/AliFlowCommon/AliFlowEventSimple.h | 2 +- .../FLOW/AliFlowCommon/AliFlowTrackSimple.cxx | 38 ++++++++-- PWG2/FLOW/AliFlowCommon/AliFlowTrackSimple.h | 9 ++- PWG2/FLOW/AliFlowTasks/AliFlowEvent.cxx | 74 ++++++++++--------- PWG2/FLOW/AliFlowTasks/AliFlowEvent.h | 4 + PWG2/PWG2flowTasksLinkDef.h | 1 + PWG2/libPWG2flowTasks.pkg | 1 + 8 files changed, 83 insertions(+), 52 deletions(-) diff --git a/PWG2/FLOW/AliFlowCommon/AliFlowEventSimple.cxx b/PWG2/FLOW/AliFlowCommon/AliFlowEventSimple.cxx index 56b8f176652..688d4086ae3 100644 --- a/PWG2/FLOW/AliFlowCommon/AliFlowEventSimple.cxx +++ b/PWG2/FLOW/AliFlowCommon/AliFlowEventSimple.cxx @@ -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(fTrackCollection->At(i)); - if (track) track->AddFlow(flow, fMCReactionPlaneAngle); + if (track) track->AddV2(v2, fMCReactionPlaneAngle, 0.001); } } diff --git a/PWG2/FLOW/AliFlowCommon/AliFlowEventSimple.h b/PWG2/FLOW/AliFlowCommon/AliFlowEventSimple.h index e4c85dd6340..81c67fc0a25 100644 --- a/PWG2/FLOW/AliFlowCommon/AliFlowEventSimple.h +++ b/PWG2/FLOW/AliFlowCommon/AliFlowEventSimple.h @@ -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 ); diff --git a/PWG2/FLOW/AliFlowCommon/AliFlowTrackSimple.cxx b/PWG2/FLOW/AliFlowCommon/AliFlowTrackSimple.cxx index df345dd95e9..868ce171a43 100644 --- a/PWG2/FLOW/AliFlowCommon/AliFlowTrackSimple.cxx +++ b/PWG2/FLOW/AliFlowCommon/AliFlowTrackSimple.cxx @@ -26,11 +26,11 @@ #include "TParticle.h" #include "AliFlowTrackSimple.h" #include "TRandom.h" +#include "AliLog.h" ClassImp(AliFlowTrackSimple) //----------------------------------------------------------------------- - AliFlowTrackSimple::AliFlowTrackSimple(): fEta(0), fPt(0), @@ -41,6 +41,17 @@ AliFlowTrackSimple::AliFlowTrackSimple(): //constructor } +//----------------------------------------------------------------------- +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()), @@ -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; iCheckParticleCuts(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); } diff --git a/PWG2/FLOW/AliFlowTasks/AliFlowEvent.h b/PWG2/FLOW/AliFlowTasks/AliFlowEvent.h index 614926ebbec..18ec5f0fd1e 100644 --- a/PWG2/FLOW/AliFlowTasks/AliFlowEvent.h +++ b/PWG2/FLOW/AliFlowTasks/AliFlowEvent.h @@ -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); diff --git a/PWG2/PWG2flowTasksLinkDef.h b/PWG2/PWG2flowTasksLinkDef.h index 647ed6781f6..638ee560397 100644 --- a/PWG2/PWG2flowTasksLinkDef.h +++ b/PWG2/PWG2flowTasksLinkDef.h @@ -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+; diff --git a/PWG2/libPWG2flowTasks.pkg b/PWG2/libPWG2flowTasks.pkg index af4a3e94e4b..1cfd730b4fa 100644 --- a/PWG2/libPWG2flowTasks.pkg +++ b/PWG2/libPWG2flowTasks.pkg @@ -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 \ -- 2.39.3