]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/FLOW/AliFlowCommon/AliFlowTrackSimple.cxx
move of class to other lib and an added method to add flow
[u/mrichter/AliRoot.git] / PWG2 / FLOW / AliFlowCommon / AliFlowTrackSimple.cxx
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
16 /* $Id$ */ 
17
18 // AliFlowTrackSimple:
19 // A simple track class to the the AliFlowEventSimple for flow analysis
20 //
21 //
22 // author: N. van der Kolk (kolk@nikhef.nl)
23 // mods: Mikolaj Krzewicki (mikolaj.krzewicki@cern.ch)
24
25 #include "TNamed.h"
26 #include "TParticle.h"
27 #include "AliFlowTrackSimple.h"
28 #include "TRandom.h"
29
30 ClassImp(AliFlowTrackSimple)
31
32 //-----------------------------------------------------------------------
33
34 AliFlowTrackSimple::AliFlowTrackSimple():
35   fEta(0),
36   fPt(0),
37   fPhi(0),
38   fFlowBits(0),
39   fSubEventBits(0)
40 {
41   //constructor 
42 }
43
44 //-----------------------------------------------------------------------
45 AliFlowTrackSimple::AliFlowTrackSimple(const TParticle* p):
46   fEta(p->Eta()),
47   fPt(p->Pt()),
48   fPhi(p->Phi()),
49   fFlowBits(0),
50   fSubEventBits(0)
51 {
52   //ctor
53 }
54
55 //-----------------------------------------------------------------------
56
57 AliFlowTrackSimple::AliFlowTrackSimple(const AliFlowTrackSimple& aTrack):
58   TNamed(),
59   fEta(aTrack.fEta),
60   fPt(aTrack.fPt),
61   fPhi(aTrack.fPhi),
62   fFlowBits(aTrack.fFlowBits),
63   fSubEventBits(aTrack.fSubEventBits)
64 {
65   //copy constructor 
66 }
67 //-----------------------------------------------------------------------
68
69 AliFlowTrackSimple& AliFlowTrackSimple::operator=(const AliFlowTrackSimple& aTrack)
70 {
71   fEta = aTrack.fEta;
72   fPt = aTrack.fPt;
73   fPhi = aTrack.fPhi;
74   fFlowBits = aTrack.fFlowBits;
75   fSubEventBits = aTrack.fSubEventBits;
76
77   return *this;
78 }
79
80
81 //----------------------------------------------------------------------- 
82
83 AliFlowTrackSimple::~AliFlowTrackSimple()
84 {
85   //destructor
86   
87 }
88
89 //----------------------------------------------------------------------- 
90 void AliFlowTrackSimple::AddFlow( Double_t flow, Double_t reactionPlaneAngle )
91 {
92   //add flow wrt the eventplane
93   fPhi -= flow*TMath::Sin(2*(fPhi-reactionPlaneAngle));
94 }
95
96 //----------------------------------------------------------------------- 
97 void AliFlowTrackSimple::ResolutionPt(Double_t res)
98 {
99   //smear the pt by a gaussian with sigma=res
100   fPt += gRandom->Gaus(0.,res);
101 }