]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG/FLOW/Base/AliFlowEventSimple.cxx
changes Paul
[u/mrichter/AliRoot.git] / PWG / FLOW / Base / AliFlowEventSimple.cxx
index fc04f57d00eb8d1f7e108115409f4c9341f367ae..32cb654be2ff64a0b0d1dbfea938097139bd6d3e 100644 (file)
@@ -195,6 +195,17 @@ void AliFlowEventSimple::AddTrack( AliFlowTrackSimple* track )
   fNumberOfTracks++;
 }
 
+//-----------------------------------------------------------------------
+AliFlowTrackSimple* AliFlowEventSimple::MakeNewTrack()
+{
+   AliFlowTrackSimple *t=dynamic_cast<AliFlowTrackSimple *>(fTrackCollection->RemoveAt(fNumberOfTracks));
+   if( !t ) {  // If there was no track at the end of the list then create a new track
+      t=new AliFlowTrackSimple();
+   }
+
+   return t;
+}
+
 //-----------------------------------------------------------------------
 AliFlowVector AliFlowEventSimple::GetQ(Int_t n, TList *weightsList, Bool_t usePhiWeights, Bool_t usePtWeights, Bool_t useEtaWeights)
 {