00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TVirtualGeoTrack
00013 #define ROOT_TVirtualGeoTrack
00014
00015 #ifndef ROOT_TObjArray
00016 #include "TObjArray.h"
00017 #endif
00018
00019 #ifndef ROOT_TGeoAtt
00020 #include "TGeoAtt.h"
00021 #endif
00022
00023 #ifndef ROOT_TAttLine
00024 #include "TAttLine.h"
00025 #endif
00026
00027 #ifndef ROOT_TAttMarker
00028 #include "TAttMarker.h"
00029 #endif
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 class TVirtualGeoTrack : public TObject,
00042 public TGeoAtt,
00043 public TAttLine,
00044 public TAttMarker
00045 {
00046 protected:
00047 Int_t fPDG;
00048 Int_t fId;
00049 TVirtualGeoTrack *fParent;
00050 TObject *fParticle;
00051 TObjArray *fTracks;
00052
00053 TVirtualGeoTrack(const TVirtualGeoTrack&);
00054 TVirtualGeoTrack& operator=(const TVirtualGeoTrack&);
00055
00056 public:
00057 TVirtualGeoTrack();
00058 TVirtualGeoTrack(Int_t id, Int_t pdgcode, TVirtualGeoTrack *parent=0, TObject *particle=0);
00059 virtual ~TVirtualGeoTrack();
00060
00061 virtual TVirtualGeoTrack *AddDaughter(Int_t id, Int_t pdgcode, TObject *particle=0) = 0;
00062 virtual Int_t AddDaughter(TVirtualGeoTrack *other) = 0;
00063 virtual void AddPoint(Double_t x, Double_t y, Double_t z, Double_t t) = 0;
00064 virtual TVirtualGeoTrack *FindTrackWithId(Int_t id) const;
00065 Int_t GetId() const {return fId;}
00066 virtual Int_t GetDaughterId(Int_t index) const {return GetDaughter(index)->GetId();}
00067 TVirtualGeoTrack *GetDaughter(Int_t index) const {return (TVirtualGeoTrack*)fTracks->At(index);}
00068 TVirtualGeoTrack *GetMother() const {return fParent;}
00069 TObject *GetMotherParticle() const {return (fParent)?fParent->GetParticle():0;}
00070 virtual const char *GetName() const;
00071 Int_t GetNdaughters() const {return (fTracks)?fTracks->GetEntriesFast():0;}
00072 virtual Int_t GetNpoints() const = 0;
00073 Int_t GetParentId() const {return (fParent)?fParent->GetId():-1;}
00074 TObject *GetParticle() const {return fParticle;}
00075 Int_t GetPDG() const {return fPDG;}
00076 Int_t GetLastPoint(Double_t &x, Double_t &y, Double_t &z, Double_t &t) const {return GetPoint(GetNpoints()-1,x,y,z,t);}
00077 const Double_t *GetFirstPoint() const {return GetPoint(0);}
00078 const Double_t *GetLastPoint() const {return GetPoint(GetNpoints()-1);}
00079 virtual Int_t GetPoint(Int_t i, Double_t &x, Double_t &y, Double_t &z, Double_t &t) const = 0;
00080 virtual const Double_t *GetPoint(Int_t i) const = 0;
00081 Bool_t HasPoints() const {return (GetNpoints()==0)?kFALSE:kTRUE;}
00082 Bool_t IsInTimeRange() const;
00083 virtual void Paint(Option_t *option="") = 0;
00084 virtual void PaintCollect(Double_t , Double_t * ) {;}
00085 virtual void PaintCollectTrack(Double_t , Double_t * ) {;}
00086 virtual void PaintTrack(Option_t *option="") = 0;
00087 virtual void ResetTrack() = 0;
00088 void SetName(const char *name);
00089 virtual void SetParticle(TObject *particle) {fParticle=particle;}
00090 void SetParent(TVirtualGeoTrack *parent) {fParent = parent;}
00091 void SetId(Int_t id) {fId = id;}
00092 virtual void SetPDG(Int_t pdgcode) {fPDG = pdgcode;}
00093
00094 ClassDef(TVirtualGeoTrack, 1)
00095 };
00096
00097 #endif
00098
00099
00100
00101