]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG2/FLOW/AliFlowTasks/AliFlowEvent.cxx
Added charge to the tracks
[u/mrichter/AliRoot.git] / PWG2 / FLOW / AliFlowTasks / AliFlowEvent.cxx
index b234270366f70cfb1f6b89fadb85b537c758f2a1..0a59cd908ec6179202ad83e185037a74ffa65c4b 100644 (file)
@@ -337,18 +337,14 @@ AliFlowEvent::AliFlowEvent( const AliESDEvent* anInput,
     if (!(rpOK || poiOK)) continue;
 
     //make new AliFlowTrack
-    AliFlowTrack* pTrack = new AliFlowTrack();
+    AliFlowTrack* pTrack = NULL;
     if(anOption == kESDkine)   //take the PID from the MC & the kinematics from the ESD
     {
-      pTrack->SetPt(pParticle->Pt() );
-      pTrack->SetEta(pParticle->Eta() );
-      pTrack->SetPhi(pParticle->Phi() );
+      pTrack = new AliFlowTrack(pParticle);
     }
     else if (anOption == kMCkine)   //take the PID and kinematics from the MC
     {
-      pTrack->SetPt(pMcParticle->Pt() );
-      pTrack->SetEta(pMcParticle->Eta() );
-      pTrack->SetPhi(pMcParticle->Phi() );
+      pTrack = new AliFlowTrack(pMcParticle);
     }
 
     if (rpOK && rpCFManager)
@@ -388,10 +384,7 @@ AliFlowEvent::AliFlowEvent( const AliESDEvent* anInput,
       if (!poiOK) continue;
       
       //make new AliFLowTrack
-      AliFlowTrack* pTrack = new AliFlowTrack();
-      pTrack->SetPt(pParticle->Pt() );
-      pTrack->SetEta(pParticle->Eta() );
-      pTrack->SetPhi(pParticle->Phi() );
+      AliFlowTrack* pTrack = new AliFlowTrack(pParticle);
           
       //marking the particles used for the particle of interest (POI) selection:
       if(poiOK && poiCFManager)
@@ -456,10 +449,7 @@ AliFlowEvent::AliFlowEvent( const AliESDEvent* anInput,
       if (!poiOK) continue;
  
       //make new AliFLowTrack
-      AliFlowTrack* pTrack = new AliFlowTrack();
-      pTrack->SetPt(pParticle->Pt() );
-      pTrack->SetEta(pParticle->Eta() );
-      pTrack->SetPhi(pParticle->Phi() );
+      AliFlowTrack* pTrack = new AliFlowTrack(pParticle);
           
       //marking the particles used for the particle of interest (POI) selection:
       if(poiOK && poiCFManager)