]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/FLOW/AliFlowCommon/AliFlowTrackSimple.h
3e0f113e11ac78bafe31c44886d0a39e5128ab99
[u/mrichter/AliRoot.git] / PWG2 / FLOW / AliFlowCommon / 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   AliFlowTrackSimple();
21   AliFlowTrackSimple(const TParticle* p);
22   AliFlowTrackSimple(const AliFlowTrackSimple& aTrack);
23   AliFlowTrackSimple(Double_t phi, Double_t eta, Double_t pt, Double_t weight);
24   virtual AliFlowTrackSimple& operator=(const AliFlowTrackSimple& aTrack);
25   virtual  ~AliFlowTrackSimple();
26   virtual AliFlowTrackSimple* Clone(const char* option="") const;
27   
28   Bool_t  IsFolder() const {return kTRUE;};
29   //  void Browse(TBrowser *b); 
30   virtual void Print(Option_t* option = "") const;
31
32   Double_t Eta() const; 
33   Double_t Pt()  const; 
34   Double_t Phi() const;
35   Double_t Weight() const; 
36
37   Bool_t InRPSelection() const; 
38   Bool_t InPOISelection() const; 
39   Bool_t InSubevent(Int_t i) const;
40   Bool_t IsDead() const {return (fFlowBits.CountBits()==0);}
41       
42   void SetEta(Double_t eta);
43   void SetPt(Double_t pt); 
44   void SetPhi(Double_t phi);
45   void SetWeight(Double_t weight);
46   void SetForRPSelection(Bool_t b=kTRUE); 
47   void SetForPOISelection(Bool_t b=kTRUE); 
48   void SetForSubevent(Int_t i); 
49   void ResetFlowTags() {fFlowBits.ResetAllBits();}
50   void ResetSubEventTags() {fSubEventBits.ResetAllBits();}
51   
52   void ResolutionPt(Double_t resolution);
53
54   void AddV1( Double_t v1,
55               Double_t reactionPlaneAngle,
56               Double_t precision,
57               Int_t maxNumberOfIterations=100 );
58   void AddV2( Double_t v2,
59               Double_t reactionPlaneAngle,
60               Double_t precision,
61               Int_t maxNumberOfIterations=100 );
62   void AddV4( Double_t v4,
63               Double_t reactionPlaneAngle,
64               Double_t precision,
65               Int_t maxNumberOfIterations=100 );
66   void AddFlow( Double_t v1,
67                 Double_t v2,
68                 Double_t v4,
69                 Double_t reactionPlaneAngle,
70                 Double_t precision,
71                 Int_t maxNumberOfIterations=100 );
72     
73   const TBits* GetFlowBits() const {return &fFlowBits;}
74
75  private:
76   Double_t fEta;         // eta
77   Double_t fPt;          // pt
78   Double_t fPhi;         // phi
79   Double_t fTrackWeight; // weight
80   TBits    fFlowBits;    // bits to set if track is selected
81   TBits    fSubEventBits;// bits to set if track is selected for a subevent
82
83   ClassDef(AliFlowTrackSimple,1)                 // macro for rootcint
84
85 };
86
87 //Setters
88 inline Double_t AliFlowTrackSimple::Eta() const { 
89   return this->fEta; }
90 inline Double_t AliFlowTrackSimple::Pt() const {  
91   return this->fPt;}
92 inline Double_t AliFlowTrackSimple::Phi() const { 
93   return this->fPhi; }
94 inline Double_t AliFlowTrackSimple::Weight() const { 
95   return this->fTrackWeight; }
96 //TBits
97 inline Bool_t AliFlowTrackSimple::InRPSelection() const { 
98   return this->fFlowBits.TestBitNumber(0); }
99 inline Bool_t AliFlowTrackSimple::InPOISelection() const { 
100   return this->fFlowBits.TestBitNumber(1); }
101 inline Bool_t AliFlowTrackSimple::InSubevent(Int_t i) const { 
102   return this->fSubEventBits.TestBitNumber(i); }
103
104 //Getters
105 inline void AliFlowTrackSimple::SetEta(Double_t val) {
106   fEta = val; }
107 inline void AliFlowTrackSimple::SetPt(Double_t val) {
108   fPt = val; }
109 inline void AliFlowTrackSimple::SetPhi(Double_t val) {
110   fPhi = val; }
111 inline void AliFlowTrackSimple::SetWeight(Double_t val) {
112   fTrackWeight = val; }
113 //TBits
114 inline void AliFlowTrackSimple::SetForRPSelection(Bool_t val) {
115   fFlowBits.SetBitNumber(0,val); }
116 inline void AliFlowTrackSimple::SetForPOISelection(Bool_t val) {
117   fFlowBits.SetBitNumber(1,val); }
118 inline void AliFlowTrackSimple::SetForSubevent(Int_t i) {
119   fSubEventBits.SetBitNumber(i,kTRUE); }
120
121 #endif
122