Mainly cosmetics.
[u/mrichter/AliRoot.git] / STEER / AliTrackReference.h
CommitLineData
aab9c8d5 1#ifndef ALITRACKREFERENCE_H
2#define ALITRACKREFERENCE_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
7
0742d588 8//
9// Track Reference object is created every time particle is
10// crossing detector bounds.
11// The object is created by Step Manager
12//
13
aab9c8d5 14#include "TObject.h"
2cad796f 15#include "TMath.h"
aab9c8d5 16
17class AliTrackReference : public TObject {
2d74ba4f 18
aab9c8d5 19public:
2d74ba4f 20
aab9c8d5 21 AliTrackReference();
2cad796f 22 AliTrackReference(Int_t label);
aab9c8d5 23 virtual ~AliTrackReference() {}
2d74ba4f 24
aab9c8d5 25 virtual Int_t GetTrack() const {return fTrack;}
26 virtual void SetTrack(Int_t track) {fTrack=track;}
4930c251 27 virtual void SetLength(Float_t length){fLength=length;}
2d74ba4f 28 virtual void SetTime(Float_t time) {fTime = time;}
1c0b669a 29 virtual Float_t GetLength() const {return fLength;}
30 virtual Float_t GetTime() const {return fTime;}
84856b02 31 virtual Int_t Label() const {return fTrack;}
32 virtual void SetLabel(Int_t track) {fTrack=track;}
33 virtual Float_t R() const {return TMath::Sqrt(fX*fX+fY*fY);}
34 virtual Float_t Pt() const {return TMath::Sqrt(fPx*fPx+fPy*fPy);}
35 virtual Float_t Phi() const {return TMath::Pi()+TMath::ATan2(-fPy,-fPx);}
b915b099 36 virtual Float_t Theta() const {return (fPz==0)?TMath::Pi()/2:TMath::ACos(fPz/P());}
aab9c8d5 37 virtual Float_t X() const {return fX;}
38 virtual Float_t Y() const {return fY;}
39 virtual Float_t Z() const {return fZ;}
40 virtual Float_t Px() const {return fPx;}
41 virtual Float_t Py() const {return fPy;}
42 virtual Float_t Pz() const {return fPz;}
b915b099 43 virtual Float_t P() const {return TMath::Sqrt(fPx*fPx+fPy*fPy+fPz*fPz);}
aab9c8d5 44 virtual void SetPosition(Float_t x, Float_t y, Float_t z){fX=x; fY=y; fZ=z;}
45 virtual void SetMomentum(Float_t px, Float_t py, Float_t pz){fPx=px; fPy=py; fPz=pz;}
2d74ba4f 46
9c9d2487 47 // Methods to get position of the track reference in
48 // in the TPC/TRD/TOF Tracking coordinate system
49
50 virtual Float_t PhiPos() const {return TMath::Pi()+TMath::ATan2(-fY, -fX);}
51 virtual Float_t Alpha() const
52 {return TMath::Pi()*(20*((((Int_t)(PhiPos()*180/TMath::Pi()))/20))+10)/180.;}
53 virtual Float_t LocalX() const {return fX*TMath::Cos(-Alpha()) - fY*TMath::Sin(-Alpha());}
54 virtual Float_t LocalY() const {return fX*TMath::Sin(-Alpha()) + fY*TMath::Cos(-Alpha());}
55
2d74ba4f 56
aab9c8d5 57protected:
58 Int_t fTrack; // Track number
59 Float_t fX; // X reference position of the track
60 Float_t fY; // Y reference position of the track
61 Float_t fZ; // Z reference position of the track
62 Float_t fPx; // momentum
63 Float_t fPy; // momentum
64 Float_t fPz; // momentum
2d74ba4f 65 Float_t fLength; // track lenght from its origin in cm
66 Float_t fTime; // time of flight in cm
aab9c8d5 67
14f9f6b4 68 ClassDef(AliTrackReference,3) //Base class for all Alice track references
aab9c8d5 69};
70#endif