]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG/FLOW/Base/AliFlowTrackSimple.h
AOD handeling, added mass to the flowtracks, new task to reuse flowevent
[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   Double_t Mass() const;
46   Int_t PID() const {return 0;}
47   
48   Bool_t InRPSelection() const; 
49   Bool_t InPOISelection() const; 
50   Bool_t InSubevent(Int_t i) const;
51   Bool_t IsDead() const {return (fFlowBits.CountBits()==0);}
52       
53   void SetEta(Double_t eta);
54   void SetPt(Double_t pt); 
55   void SetPhi(Double_t phi);
56   void SetWeight(Double_t weight);
57   void SetCharge(Int_t charge);
58   void SetMass(Double_t mass);
59   void SetForRPSelection(Bool_t b=kTRUE); 
60   void SetForPOISelection(Bool_t b=kTRUE); 
61   void TagRP(Bool_t b=kTRUE) {SetForRPSelection(b);} 
62   void TagPOI(Bool_t b=kTRUE) {SetForPOISelection(b);} 
63   void Tag(Int_t n, Bool_t b=kTRUE) {fFlowBits.SetBitNumber(n,b);}
64   void CheckTag(Int_t n) {fFlowBits.TestBitNumber(n);}
65   void SetForSubevent(Int_t i); 
66   void ResetFlowTags() {fFlowBits.ResetAllBits();}
67   void ResetSubEventTags() {fSubEventBits.ResetAllBits();}
68   void Clear(Option_t* o="");
69   
70   void ResolutionPt(Double_t resolution);
71
72   void AddV1( Double_t v1,
73               Double_t reactionPlaneAngle,
74               Double_t precision,
75               Int_t maxNumberOfIterations=100 );
76   void AddV2( Double_t v2,
77               Double_t reactionPlaneAngle,
78               Double_t precision,
79               Int_t maxNumberOfIterations=100 );
80   void AddV3( Double_t v3,
81               Double_t reactionPlaneAngle,
82               Double_t precision,
83               Int_t maxNumberOfIterations=100 );
84   void AddV4( Double_t v4,
85               Double_t reactionPlaneAngle,
86               Double_t precision,
87               Int_t maxNumberOfIterations=100 );
88   void AddV5( Double_t v5,
89               Double_t reactionPlaneAngle,
90               Double_t precision,
91               Int_t maxNumberOfIterations=100 );
92   void AddFlow( Double_t v1,
93                 Double_t v2,
94                 Double_t v3,
95                 Double_t v4,
96                 Double_t reactionPlaneAngle,
97                 Double_t precision,
98                 Int_t maxNumberOfIterations=100 );
99   void AddFlow( Double_t v1,
100                 Double_t v2,
101                 Double_t v3,
102                 Double_t v4,
103                 Double_t v5,
104                 Double_t reactionPlaneAngle,
105                 Double_t precision,
106                 Int_t maxNumberOfIterations=100 );
107   void AddFlow( Double_t v1,
108                 Double_t v2,
109                 Double_t v3,
110                 Double_t v4,
111                 Double_t v5,
112                 Double_t rp1,
113                 Double_t rp2,
114                 Double_t rp3,
115                 Double_t rp4,
116                 Double_t rp5,
117                 Double_t precision,
118                 Int_t maxNumberOfIterations=100 );
119
120   const TBits* GetFlowBits() const {return &fFlowBits;}
121
122   void  SetID(Int_t i) {fID=i;}
123   Int_t GetID() const {return fID;}
124
125  private:
126   AliFlowTrackSimple(Double_t phi, Double_t eta, Double_t pt, Double_t weight, Int_t charge, Double_t mass=-1);
127   Double_t fEta;         // eta
128   Double_t fPt;          // pt
129   Double_t fPhi;         // phi
130   Double_t fTrackWeight; // weight
131   Int_t fCharge;         //charge
132   Double_t fMass;        // mass
133   TBits    fFlowBits;    // bits to set if track is selected
134   TBits    fSubEventBits;// bits to set if track is selected for a subevent
135   Int_t    fID;          // Unique track ID, point back to the ESD track
136
137   ClassDef(AliFlowTrackSimple,2)                 // macro for rootcint
138
139 };
140
141 //Getters
142 inline Double_t AliFlowTrackSimple::Eta() const { 
143   return this->fEta; }
144 inline Double_t AliFlowTrackSimple::Pt() const {  
145   return this->fPt;}
146 inline Double_t AliFlowTrackSimple::Phi() const { 
147   return this->fPhi; }
148 inline Double_t AliFlowTrackSimple::Weight() const { 
149   return this->fTrackWeight; }
150 inline Int_t AliFlowTrackSimple::Charge() const { 
151   return this->fCharge; }
152 inline Double_t AliFlowTrackSimple::Mass() const { 
153   return this->fMass; }
154 //TBits
155 inline Bool_t AliFlowTrackSimple::InRPSelection() const { 
156   return this->fFlowBits.TestBitNumber(kRP); }
157 inline Bool_t AliFlowTrackSimple::InPOISelection() const { 
158   return this->fFlowBits.TestBitNumber(kPOI); }
159 inline Bool_t AliFlowTrackSimple::InSubevent(Int_t i) const { 
160   return this->fSubEventBits.TestBitNumber(i); }
161
162 //Setters
163 inline void AliFlowTrackSimple::SetEta(Double_t val) {
164   fEta = val; }
165 inline void AliFlowTrackSimple::SetPt(Double_t val) {
166   fPt = val; }
167 inline void AliFlowTrackSimple::SetPhi(Double_t val) {
168   fPhi = val; }
169 inline void AliFlowTrackSimple::SetWeight(Double_t val) {
170   fTrackWeight = val; }
171 inline void AliFlowTrackSimple::SetCharge(Int_t val) {
172   fCharge = val; }
173 inline void AliFlowTrackSimple::SetMass(Double_t val) {
174   fMass = val; }
175 //TBits
176 inline void AliFlowTrackSimple::SetForRPSelection(Bool_t val) {
177   fFlowBits.SetBitNumber(kRP,val); }
178 inline void AliFlowTrackSimple::SetForPOISelection(Bool_t val) {
179   fFlowBits.SetBitNumber(kPOI,val); }
180 inline void AliFlowTrackSimple::SetForSubevent(Int_t i) {
181   fSubEventBits.SetBitNumber(i,kTRUE); }
182
183 #endif
184