ROOT logo
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
/* $Id$ */

#ifndef ALIFLOWTRACKSIMPLE_H
#define ALIFLOWTRACKSIMPLE_H

#include "TObject.h"
#include "TBits.h"
class TParticle;

// AliFlowTrackSimple:
// A simple track class to the the AliFlowEventSimple for flow analysis
// author: N. van der Kolk (kolk@nikhef.nl)
// mods: Mikolaj Krzewicki (mikolaj.krzewicki@cern.ch)

class AliFlowTrackSimple: public TObject {

public:
  enum poiTypes { kInvalid=-1,
                 kRP=0,
                 kPOI=1,
                 kPOI1=2,
                 kPOI2=3,
               };

  AliFlowTrackSimple();
  AliFlowTrackSimple(TParticle* p);
  AliFlowTrackSimple(const AliFlowTrackSimple& aTrack);
  AliFlowTrackSimple& operator=(const AliFlowTrackSimple& aTrack);
  virtual  ~AliFlowTrackSimple();
  virtual AliFlowTrackSimple* Clone(const char* option="") const;
  
  Bool_t  IsFolder() const {return kTRUE;};
  //  void Browse(TBrowser *b); 
  virtual void Print(Option_t* option = "") const;

  void Set(TParticle* p);

  Double_t Eta() const; 
  Double_t Pt()  const; 
  Double_t Phi() const;
  Double_t Weight() const; 
  Int_t Charge() const;
  Double_t Mass() const;
  Int_t PID() const {return 0;}
  
  Bool_t InRPSelection() const; 
  Bool_t InPOISelection(Int_t poiType=1) const; 
  Bool_t IsPOItype(Int_t poiType) const;
  void SetPOItype(Int_t poiType, Bool_t b=kTRUE);
  Bool_t InSubevent(Int_t i) const;
  void TagRP(Bool_t b=kTRUE) {SetForRPSelection(b);} 
  void TagPOI(Bool_t b=kTRUE) {SetForPOISelection(b);} 
  void Tag(Int_t n, Bool_t b=kTRUE) {fPOItype.SetBitNumber(n,b);}
  Bool_t CheckTag(Int_t n) {return fPOItype.TestBitNumber(n);}
  void SetForSubevent(Int_t i); 
  void ResetPOItype() {fPOItype.ResetAllBits();}
  void ResetSubEventTags() {fSubEventBits.ResetAllBits();}
  Bool_t IsDead() const {return (fPOItype.CountBits()==0);}
      
  void SetEta(Double_t eta);
  void SetPt(Double_t pt); 
  void SetPhi(Double_t phi);
  void SetWeight(Double_t weight);
  void SetCharge(Int_t charge);
  void SetMass(Double_t mass);
  void SetForRPSelection(Bool_t b=kTRUE); 
  void SetForPOISelection(Bool_t b=kTRUE); 
  virtual void Clear(Option_t* o="");
  
  void ResolutionPt(Double_t resolution);

  void AddV1( Double_t v1,
              Double_t reactionPlaneAngle,
              Double_t precision,
              Int_t maxNumberOfIterations=100 );
  void AddV2( Double_t v2,
              Double_t reactionPlaneAngle,
              Double_t precision,
              Int_t maxNumberOfIterations=100 );
  void AddV3( Double_t v3,
              Double_t reactionPlaneAngle,
              Double_t precision,
              Int_t maxNumberOfIterations=100 );
  void AddV4( Double_t v4,
              Double_t reactionPlaneAngle,
              Double_t precision,
              Int_t maxNumberOfIterations=100 );
  void AddV5( Double_t v5,
              Double_t reactionPlaneAngle,
              Double_t precision,
              Int_t maxNumberOfIterations=100 );
  void AddFlow( Double_t v1,
                Double_t v2,
                Double_t v3,
                Double_t v4,
                Double_t reactionPlaneAngle,
                Double_t precision,
                Int_t maxNumberOfIterations=100 );
  void AddFlow( Double_t v1,
                Double_t v2,
                Double_t v3,
                Double_t v4,
                Double_t v5,
                Double_t reactionPlaneAngle,
                Double_t precision,
                Int_t maxNumberOfIterations=100 );
  void AddFlow( Double_t v1,
                Double_t v2,
                Double_t v3,
                Double_t v4,
                Double_t v5,
                Double_t rp1,
                Double_t rp2,
                Double_t rp3,
                Double_t rp4,
                Double_t rp5,
                Double_t precision,
                Int_t maxNumberOfIterations=100 );

  const TBits* GetPOItype() const {return &fPOItype;}
  const TBits* GetFlowBits() const {return GetPOItype();}

  void  SetID(Int_t i) {fID=i;}
  Int_t GetID() const {return fID;}

  virtual Int_t GetNDaughters() const {return 0;}
  virtual void  AddDaughter(Int_t /*value*/) {}
  virtual Int_t GetIDDaughter(Int_t /*value*/) const {return 0;}
  virtual void SetDaughter(Int_t /*value*/, AliFlowTrackSimple* /*track*/) {}
  virtual AliFlowTrackSimple *GetDaughter(Int_t /*value*/) const {return NULL;}

 private:
  AliFlowTrackSimple(Double_t phi, Double_t eta, Double_t pt, Double_t weight, Int_t charge, Double_t mass=-1);
  Double_t fEta;         // eta
  Double_t fPt;          // pt
  Double_t fPhi;         // phi
  Double_t fTrackWeight; // weight
  Int_t    fCharge;      //charge
  Double_t fMass;        // mass
  TBits    fPOItype;    // bits to set if track is selected
  TBits    fSubEventBits;// bits to set if track is selected for a subevent
  Int_t    fID;          // Unique track ID, point back to the ESD track

  ClassDef(AliFlowTrackSimple,2)                 // macro for rootcint

};

//Getters
inline Double_t AliFlowTrackSimple::Eta() const { 
  return this->fEta; }
inline Double_t AliFlowTrackSimple::Pt() const {  
  return this->fPt;}
inline Double_t AliFlowTrackSimple::Phi() const { 
  return this->fPhi; }
inline Double_t AliFlowTrackSimple::Weight() const { 
  return this->fTrackWeight; }
inline Int_t AliFlowTrackSimple::Charge() const { 
  return this->fCharge; }
inline Double_t AliFlowTrackSimple::Mass() const { 
  return this->fMass; }
//TBits
inline Bool_t AliFlowTrackSimple::InRPSelection() const { 
  return fPOItype.TestBitNumber(kRP); }
inline Bool_t AliFlowTrackSimple::InPOISelection(Int_t poiType) const { 
  return fPOItype.TestBitNumber(poiType); }
inline Bool_t AliFlowTrackSimple::IsPOItype(Int_t poiType) const {
  return fPOItype.TestBitNumber(poiType); }
inline Bool_t AliFlowTrackSimple::InSubevent(Int_t i) const { 
  return this->fSubEventBits.TestBitNumber(i); }

//Setters
inline void AliFlowTrackSimple::SetEta(Double_t val) {
  fEta = val; }
inline void AliFlowTrackSimple::SetPt(Double_t val) {
  fPt = val; }
inline void AliFlowTrackSimple::SetPhi(Double_t val) {
  fPhi = val; }
inline void AliFlowTrackSimple::SetWeight(Double_t val) {
  fTrackWeight = val; }
inline void AliFlowTrackSimple::SetCharge(Int_t val) {
  fCharge = val; }
inline void AliFlowTrackSimple::SetMass(Double_t val) {
  fMass = val; }

  //TBits
inline void AliFlowTrackSimple::SetForRPSelection(Bool_t val) {
  fPOItype.SetBitNumber(kRP,val); }
inline void AliFlowTrackSimple::SetForPOISelection(Bool_t val) {
  fPOItype.SetBitNumber(kPOI,val); }
inline void AliFlowTrackSimple::SetForSubevent(Int_t i) {
  fSubEventBits.SetBitNumber(i,kTRUE); }

inline void AliFlowTrackSimple::SetPOItype(Int_t poiType, Bool_t b) {
  fPOItype.SetBitNumber(poiType,b); }

#endif

 AliFlowTrackSimple.h:1
 AliFlowTrackSimple.h:2
 AliFlowTrackSimple.h:3
 AliFlowTrackSimple.h:4
 AliFlowTrackSimple.h:5
 AliFlowTrackSimple.h:6
 AliFlowTrackSimple.h:7
 AliFlowTrackSimple.h:8
 AliFlowTrackSimple.h:9
 AliFlowTrackSimple.h:10
 AliFlowTrackSimple.h:11
 AliFlowTrackSimple.h:12
 AliFlowTrackSimple.h:13
 AliFlowTrackSimple.h:14
 AliFlowTrackSimple.h:15
 AliFlowTrackSimple.h:16
 AliFlowTrackSimple.h:17
 AliFlowTrackSimple.h:18
 AliFlowTrackSimple.h:19
 AliFlowTrackSimple.h:20
 AliFlowTrackSimple.h:21
 AliFlowTrackSimple.h:22
 AliFlowTrackSimple.h:23
 AliFlowTrackSimple.h:24
 AliFlowTrackSimple.h:25
 AliFlowTrackSimple.h:26
 AliFlowTrackSimple.h:27
 AliFlowTrackSimple.h:28
 AliFlowTrackSimple.h:29
 AliFlowTrackSimple.h:30
 AliFlowTrackSimple.h:31
 AliFlowTrackSimple.h:32
 AliFlowTrackSimple.h:33
 AliFlowTrackSimple.h:34
 AliFlowTrackSimple.h:35
 AliFlowTrackSimple.h:36
 AliFlowTrackSimple.h:37
 AliFlowTrackSimple.h:38
 AliFlowTrackSimple.h:39
 AliFlowTrackSimple.h:40
 AliFlowTrackSimple.h:41
 AliFlowTrackSimple.h:42
 AliFlowTrackSimple.h:43
 AliFlowTrackSimple.h:44
 AliFlowTrackSimple.h:45
 AliFlowTrackSimple.h:46
 AliFlowTrackSimple.h:47
 AliFlowTrackSimple.h:48
 AliFlowTrackSimple.h:49
 AliFlowTrackSimple.h:50
 AliFlowTrackSimple.h:51
 AliFlowTrackSimple.h:52
 AliFlowTrackSimple.h:53
 AliFlowTrackSimple.h:54
 AliFlowTrackSimple.h:55
 AliFlowTrackSimple.h:56
 AliFlowTrackSimple.h:57
 AliFlowTrackSimple.h:58
 AliFlowTrackSimple.h:59
 AliFlowTrackSimple.h:60
 AliFlowTrackSimple.h:61
 AliFlowTrackSimple.h:62
 AliFlowTrackSimple.h:63
 AliFlowTrackSimple.h:64
 AliFlowTrackSimple.h:65
 AliFlowTrackSimple.h:66
 AliFlowTrackSimple.h:67
 AliFlowTrackSimple.h:68
 AliFlowTrackSimple.h:69
 AliFlowTrackSimple.h:70
 AliFlowTrackSimple.h:71
 AliFlowTrackSimple.h:72
 AliFlowTrackSimple.h:73
 AliFlowTrackSimple.h:74
 AliFlowTrackSimple.h:75
 AliFlowTrackSimple.h:76
 AliFlowTrackSimple.h:77
 AliFlowTrackSimple.h:78
 AliFlowTrackSimple.h:79
 AliFlowTrackSimple.h:80
 AliFlowTrackSimple.h:81
 AliFlowTrackSimple.h:82
 AliFlowTrackSimple.h:83
 AliFlowTrackSimple.h:84
 AliFlowTrackSimple.h:85
 AliFlowTrackSimple.h:86
 AliFlowTrackSimple.h:87
 AliFlowTrackSimple.h:88
 AliFlowTrackSimple.h:89
 AliFlowTrackSimple.h:90
 AliFlowTrackSimple.h:91
 AliFlowTrackSimple.h:92
 AliFlowTrackSimple.h:93
 AliFlowTrackSimple.h:94
 AliFlowTrackSimple.h:95
 AliFlowTrackSimple.h:96
 AliFlowTrackSimple.h:97
 AliFlowTrackSimple.h:98
 AliFlowTrackSimple.h:99
 AliFlowTrackSimple.h:100
 AliFlowTrackSimple.h:101
 AliFlowTrackSimple.h:102
 AliFlowTrackSimple.h:103
 AliFlowTrackSimple.h:104
 AliFlowTrackSimple.h:105
 AliFlowTrackSimple.h:106
 AliFlowTrackSimple.h:107
 AliFlowTrackSimple.h:108
 AliFlowTrackSimple.h:109
 AliFlowTrackSimple.h:110
 AliFlowTrackSimple.h:111
 AliFlowTrackSimple.h:112
 AliFlowTrackSimple.h:113
 AliFlowTrackSimple.h:114
 AliFlowTrackSimple.h:115
 AliFlowTrackSimple.h:116
 AliFlowTrackSimple.h:117
 AliFlowTrackSimple.h:118
 AliFlowTrackSimple.h:119
 AliFlowTrackSimple.h:120
 AliFlowTrackSimple.h:121
 AliFlowTrackSimple.h:122
 AliFlowTrackSimple.h:123
 AliFlowTrackSimple.h:124
 AliFlowTrackSimple.h:125
 AliFlowTrackSimple.h:126
 AliFlowTrackSimple.h:127
 AliFlowTrackSimple.h:128
 AliFlowTrackSimple.h:129
 AliFlowTrackSimple.h:130
 AliFlowTrackSimple.h:131
 AliFlowTrackSimple.h:132
 AliFlowTrackSimple.h:133
 AliFlowTrackSimple.h:134
 AliFlowTrackSimple.h:135
 AliFlowTrackSimple.h:136
 AliFlowTrackSimple.h:137
 AliFlowTrackSimple.h:138
 AliFlowTrackSimple.h:139
 AliFlowTrackSimple.h:140
 AliFlowTrackSimple.h:141
 AliFlowTrackSimple.h:142
 AliFlowTrackSimple.h:143
 AliFlowTrackSimple.h:144
 AliFlowTrackSimple.h:145
 AliFlowTrackSimple.h:146
 AliFlowTrackSimple.h:147
 AliFlowTrackSimple.h:148
 AliFlowTrackSimple.h:149
 AliFlowTrackSimple.h:150
 AliFlowTrackSimple.h:151
 AliFlowTrackSimple.h:152
 AliFlowTrackSimple.h:153
 AliFlowTrackSimple.h:154
 AliFlowTrackSimple.h:155
 AliFlowTrackSimple.h:156
 AliFlowTrackSimple.h:157
 AliFlowTrackSimple.h:158
 AliFlowTrackSimple.h:159
 AliFlowTrackSimple.h:160
 AliFlowTrackSimple.h:161
 AliFlowTrackSimple.h:162
 AliFlowTrackSimple.h:163
 AliFlowTrackSimple.h:164
 AliFlowTrackSimple.h:165
 AliFlowTrackSimple.h:166
 AliFlowTrackSimple.h:167
 AliFlowTrackSimple.h:168
 AliFlowTrackSimple.h:169
 AliFlowTrackSimple.h:170
 AliFlowTrackSimple.h:171
 AliFlowTrackSimple.h:172
 AliFlowTrackSimple.h:173
 AliFlowTrackSimple.h:174
 AliFlowTrackSimple.h:175
 AliFlowTrackSimple.h:176
 AliFlowTrackSimple.h:177
 AliFlowTrackSimple.h:178
 AliFlowTrackSimple.h:179
 AliFlowTrackSimple.h:180
 AliFlowTrackSimple.h:181
 AliFlowTrackSimple.h:182
 AliFlowTrackSimple.h:183
 AliFlowTrackSimple.h:184
 AliFlowTrackSimple.h:185
 AliFlowTrackSimple.h:186
 AliFlowTrackSimple.h:187
 AliFlowTrackSimple.h:188
 AliFlowTrackSimple.h:189
 AliFlowTrackSimple.h:190
 AliFlowTrackSimple.h:191
 AliFlowTrackSimple.h:192
 AliFlowTrackSimple.h:193
 AliFlowTrackSimple.h:194
 AliFlowTrackSimple.h:195
 AliFlowTrackSimple.h:196
 AliFlowTrackSimple.h:197
 AliFlowTrackSimple.h:198
 AliFlowTrackSimple.h:199