1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 #include "Riostream.h"
17 #include "TObjArray.h"
19 #include "AliFlowVector.h"
20 #include "AliFlowTrackSimple.h"
21 #include "AliFlowEventSimple.h"
23 // AliFlowEventSimple:
24 // A simple event for flow analysis
27 // authors: N. van der Kolk (kolk@nikhef.nl), A. Bilandzic (anteb@nikhef.nl)
30 ClassImp(AliFlowEventSimple)
32 //-----------------------------------------------------------------------
34 AliFlowEventSimple::AliFlowEventSimple(Int_t aLenght):
35 fTrackCollection(NULL),
37 fEventNSelTracksIntFlow(0)
40 fTrackCollection = new TObjArray(aLenght) ;
43 //-----------------------------------------------------------------------
45 AliFlowEventSimple::AliFlowEventSimple(const AliFlowEventSimple& anEvent):
47 fTrackCollection(anEvent.fTrackCollection),
48 fNumberOfTracks(anEvent.fNumberOfTracks),
49 fEventNSelTracksIntFlow(anEvent.fEventNSelTracksIntFlow)
54 //-----------------------------------------------------------------------
56 AliFlowEventSimple& AliFlowEventSimple::operator=(const AliFlowEventSimple& anEvent)
58 *fTrackCollection = *anEvent.fTrackCollection ;
59 fNumberOfTracks = anEvent.fNumberOfTracks;
60 fEventNSelTracksIntFlow = anEvent.fEventNSelTracksIntFlow;
67 //-----------------------------------------------------------------------
69 AliFlowEventSimple::~AliFlowEventSimple()
72 fTrackCollection->Delete() ; delete fTrackCollection ;
75 //-----------------------------------------------------------------------
77 AliFlowTrackSimple* AliFlowEventSimple::GetTrack(Int_t i)
79 //get track i from collection
80 AliFlowTrackSimple* pTrack = (AliFlowTrackSimple*)TrackCollection()->At(i) ;
84 //-----------------------------------------------------------------------
85 AliFlowVector AliFlowEventSimple::GetQ(Int_t n)
95 Int_t iUsedTracks = 0;
97 for (Int_t i=0;i<fNumberOfTracks;i++)
99 AliFlowTrackSimple* pTrack = (AliFlowTrackSimple*)TrackCollection()->At(i) ;
101 if (pTrack->UseForIntegratedFlow()) {
102 Double_t dPhi = pTrack->Phi();
103 dQX += TMath::Cos(iOrder*dPhi);
104 dQY += TMath::Sin(iOrder*dPhi);
108 else {cerr << "no particle!!!"<<endl;}
109 }//loop over particles
112 vQ.SetMult(iUsedTracks);