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