]>
Commit | Line | Data |
---|---|---|
f1d945a1 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
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 | **************************************************************************/ | |
15 | ||
f1d945a1 | 16 | #include "Riostream.h" |
17 | #include "TObjArray.h" | |
18 | #include "TMath.h" | |
19 | #include "AliFlowVector.h" | |
20 | #include "AliFlowTrackSimple.h" | |
21 | #include "AliFlowEventSimple.h" | |
22 | ||
23 | // AliFlowEventSimple: | |
24 | // A simple event for flow analysis | |
25 | // | |
26 | // | |
27 | // authors: N. van der Kolk (kolk@nikhef.nl), A. Bilandzic (anteb@nikhef.nl) | |
28 | ||
29 | ||
30 | ClassImp(AliFlowEventSimple) | |
31 | ||
32 | //----------------------------------------------------------------------- | |
33 | ||
e35ddff0 | 34 | AliFlowEventSimple::AliFlowEventSimple(Int_t aLenght): |
f1d945a1 | 35 | fTrackCollection(0), |
f1d945a1 | 36 | fNumberOfTracks(0), |
37 | fEventNSelTracksIntFlow(0) | |
38 | { | |
39 | //constructor | |
e35ddff0 | 40 | fTrackCollection = new TObjArray(aLenght) ; |
f1d945a1 | 41 | } |
42 | ||
43 | //----------------------------------------------------------------------- | |
44 | ||
e35ddff0 | 45 | AliFlowEventSimple::AliFlowEventSimple(const AliFlowEventSimple& anEvent): |
bc6b015e | 46 | TObject(), |
e35ddff0 | 47 | fTrackCollection(anEvent.fTrackCollection), |
48 | fNumberOfTracks(anEvent.fNumberOfTracks), | |
49 | fEventNSelTracksIntFlow(anEvent.fEventNSelTracksIntFlow) | |
f1d945a1 | 50 | { |
51 | //copy constructor | |
f1d945a1 | 52 | } |
53 | ||
54 | //----------------------------------------------------------------------- | |
55 | ||
e35ddff0 | 56 | AliFlowEventSimple& AliFlowEventSimple::operator=(const AliFlowEventSimple& anEvent) |
f1d945a1 | 57 | { |
e35ddff0 | 58 | *fTrackCollection = *anEvent.fTrackCollection ; |
59 | fNumberOfTracks = anEvent.fNumberOfTracks; | |
60 | fEventNSelTracksIntFlow = anEvent.fEventNSelTracksIntFlow; | |
f1d945a1 | 61 | |
62 | return *this; | |
63 | ||
64 | } | |
65 | ||
66 | ||
67 | //----------------------------------------------------------------------- | |
68 | ||
69 | AliFlowEventSimple::~AliFlowEventSimple() | |
70 | { | |
71 | //destructor | |
72 | fTrackCollection->Delete() ; delete fTrackCollection ; | |
73 | } | |
74 | ||
75 | //----------------------------------------------------------------------- | |
76 | ||
77 | AliFlowTrackSimple* AliFlowEventSimple::GetTrack(Int_t i) | |
78 | { | |
79 | //get track i from collection | |
e35ddff0 | 80 | AliFlowTrackSimple* pTrack = (AliFlowTrackSimple*)TrackCollection()->At(i) ; |
81 | return pTrack; | |
f1d945a1 | 82 | } |
83 | ||
84 | //----------------------------------------------------------------------- | |
85 | AliFlowVector AliFlowEventSimple::GetQ() | |
86 | { | |
87 | //calculate Q. | |
88 | ||
e35ddff0 | 89 | Double_t dQX = 0.; |
90 | Double_t dQY = 0.; | |
91 | AliFlowVector vQ; | |
92 | vQ.Set(0.,0.); | |
93 | Double_t dOrder = 2.; | |
94 | Int_t iUsedTracks = 0; | |
f1d945a1 | 95 | |
96 | for (Int_t i=0;i<fNumberOfTracks;i++) | |
97 | { | |
e35ddff0 | 98 | AliFlowTrackSimple* pTrack = (AliFlowTrackSimple*)TrackCollection()->At(i) ; |
99 | if (pTrack){ | |
100 | if (pTrack->UseForIntegratedFlow()) { | |
101 | Double_t dPhi = pTrack->Phi(); | |
102 | dQX += TMath::Cos(dOrder*dPhi); | |
103 | dQY += TMath::Sin(dOrder*dPhi); | |
104 | iUsedTracks++; | |
f1d945a1 | 105 | } |
106 | } //if particle | |
107 | else {cerr << "no particle!!!"<<endl;} | |
108 | }//loop over particles | |
109 | ||
e35ddff0 | 110 | vQ.Set(dQX,dQY); |
111 | vQ.SetMult(iUsedTracks); | |
f1d945a1 | 112 | |
e35ddff0 | 113 | return vQ; |
f1d945a1 | 114 | |
115 | } |