]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG/FLOW/Base/AliFlowTrackSimple.h
766e59bfe1260dda7273428d8639485c742208e2
[u/mrichter/AliRoot.git] / PWG / FLOW / Base / AliFlowTrackSimple.h
1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice */
3 /* $Id$ */
4
5 #ifndef ALIFLOWTRACKSIMPLE_H
6 #define ALIFLOWTRACKSIMPLE_H
7
8 #include "TObject.h"
9 #include "TBits.h"
10 class TParticle;
11
12 // AliFlowTrackSimple:
13 // A simple track class to the the AliFlowEventSimple for flow analysis
14 // author: N. van der Kolk (kolk@nikhef.nl)
15 // mods: Mikolaj Krzewicki (mikolaj.krzewicki@cern.ch)
16
17 class AliFlowTrackSimple: public TObject {
18
19 public:
20   enum tagType { kInvalid=-1,
21                  kRP=0,
22                  kPOI=1,
23                  kPOI1=2,
24                  kPOI2=3,
25                };
26
27   AliFlowTrackSimple();
28   AliFlowTrackSimple(TParticle* p);
29   AliFlowTrackSimple(const AliFlowTrackSimple& aTrack);
30   AliFlowTrackSimple& operator=(const AliFlowTrackSimple& aTrack);
31   virtual  ~AliFlowTrackSimple();
32   virtual AliFlowTrackSimple* Clone(const char* option="") const;
33   
34   Bool_t  IsFolder() const {return kTRUE;};
35   //  void Browse(TBrowser *b); 
36   virtual void Print(Option_t* option = "") const;
37
38   void Set(TParticle* p);
39
40   Double_t Eta() const; 
41   Double_t Pt()  const; 
42   Double_t Phi() const;
43   Double_t Weight() const; 
44   Int_t Charge() const;
45   Int_t PID() const {return 0;}
46   
47   Bool_t InRPSelection() const; 
48   Bool_t InPOISelection() const; 
49   Bool_t InSubevent(Int_t i) const;
50   Bool_t IsDead() const {return (fFlowBits.CountBits()==0);}
51       
52   void SetEta(Double_t eta);
53   void SetPt(Double_t pt); 
54   void SetPhi(Double_t phi);
55   void SetWeight(Double_t weight);
56   void SetCharge(Int_t charge);
57   void SetForRPSelection(Bool_t b=kTRUE); 
58   void SetForPOISelection(Bool_t b=kTRUE); 
59   void TagRP(Bool_t b=kTRUE) {SetForRPSelection(b);} 
60   void TagPOI(Bool_t b=kTRUE) {SetForPOISelection(b);} 
61   void Tag(Int_t n, Bool_t b=kTRUE) {fFlowBits.SetBitNumber(n,b);}
62   void CheckTag(Int_t n) {fFlowBits.TestBitNumber(n);}
63   void SetForSubevent(Int_t i); 
64   void ResetFlowTags() {fFlowBits.ResetAllBits();}
65   void ResetSubEventTags() {fSubEventBits.ResetAllBits();}
66   void Clear(Option_t* o="");
67   
68   void ResolutionPt(Double_t resolution);
69
70   void AddV1( Double_t v1,
71               Double_t reactionPlaneAngle,
72               Double_t precision,
73               Int_t maxNumberOfIterations=100 );
74   void AddV2( Double_t v2,
75               Double_t reactionPlaneAngle,
76               Double_t precision,
77               Int_t maxNumberOfIterations=100 );
78   void AddV3( Double_t v3,
79               Double_t reactionPlaneAngle,
80               Double_t precision,
81               Int_t maxNumberOfIterations=100 );
82   void AddV4( Double_t v4,
83               Double_t reactionPlaneAngle,
84               Double_t precision,
85               Int_t maxNumberOfIterations=100 );
86   void AddV5( Double_t v5,
87               Double_t reactionPlaneAngle,
88               Double_t precision,
89               Int_t maxNumberOfIterations=100 );
90   void AddFlow( Double_t v1,
91                 Double_t v2,
92                 Double_t v3,
93                 Double_t v4,
94                 Double_t reactionPlaneAngle,
95                 Double_t precision,
96                 Int_t maxNumberOfIterations=100 );
97   void AddFlow( Double_t v1,
98                 Double_t v2,
99                 Double_t v3,
100                 Double_t v4,
101                 Double_t v5,
102                 Double_t reactionPlaneAngle,
103                 Double_t precision,
104                 Int_t maxNumberOfIterations=100 );
105   void AddFlow( Double_t v1,
106                 Double_t v2,
107                 Double_t v3,
108                 Double_t v4,
109                 Double_t v5,
110                 Double_t rp1,
111                 Double_t rp2,
112                 Double_t rp3,
113                 Double_t rp4,
114                 Double_t rp5,
115                 Double_t precision,
116                 Int_t maxNumberOfIterations=100 );
117
118   const TBits* GetFlowBits() const {return &fFlowBits;}
119
120   void  SetID(Int_t i) {fID=i;}
121   Int_t GetID() const {return fID;}
122
123  private:
124   AliFlowTrackSimple(Double_t phi, Double_t eta, Double_t pt, Double_t weight, Int_t charge);
125   Double_t fEta;         // eta
126   Double_t fPt;          // pt
127   Double_t fPhi;         // phi
128   Double_t fTrackWeight; // weight
129   Int_t fCharge;         //charge
130   TBits    fFlowBits;    // bits to set if track is selected
131   TBits    fSubEventBits;// bits to set if track is selected for a subevent
132   Int_t    fID;          // Unique track ID, point back to the ESD track
133
134   ClassDef(AliFlowTrackSimple,1)                 // macro for rootcint
135
136 };
137
138 //Getters
139 inline Double_t AliFlowTrackSimple::Eta() const { 
140   return this->fEta; }
141 inline Double_t AliFlowTrackSimple::Pt() const {  
142   return this->fPt;}
143 inline Double_t AliFlowTrackSimple::Phi() const { 
144   return this->fPhi; }
145 inline Double_t AliFlowTrackSimple::Weight() const { 
146   return this->fTrackWeight; }
147 inline Int_t AliFlowTrackSimple::Charge() const { 
148   return this->fCharge; }
149 //TBits
150 inline Bool_t AliFlowTrackSimple::InRPSelection() const { 
151   return this->fFlowBits.TestBitNumber(kRP); }
152 inline Bool_t AliFlowTrackSimple::InPOISelection() const { 
153   return this->fFlowBits.TestBitNumber(kPOI); }
154 inline Bool_t AliFlowTrackSimple::InSubevent(Int_t i) const { 
155   return this->fSubEventBits.TestBitNumber(i); }
156
157 //Setters
158 inline void AliFlowTrackSimple::SetEta(Double_t val) {
159   fEta = val; }
160 inline void AliFlowTrackSimple::SetPt(Double_t val) {
161   fPt = val; }
162 inline void AliFlowTrackSimple::SetPhi(Double_t val) {
163   fPhi = val; }
164 inline void AliFlowTrackSimple::SetWeight(Double_t val) {
165   fTrackWeight = val; }
166 inline void AliFlowTrackSimple::SetCharge(Int_t val) {
167   fCharge = val; }
168 //TBits
169 inline void AliFlowTrackSimple::SetForRPSelection(Bool_t val) {
170   fFlowBits.SetBitNumber(kRP,val); }
171 inline void AliFlowTrackSimple::SetForPOISelection(Bool_t val) {
172   fFlowBits.SetBitNumber(kPOI,val); }
173 inline void AliFlowTrackSimple::SetForSubevent(Int_t i) {
174   fSubEventBits.SetBitNumber(i,kTRUE); }
175
176 #endif
177