Logo ROOT   6.08/07
Reference Guide
TGeoTrack.h
Go to the documentation of this file.
1 // @(#)root/geom:$Id$
2 // Author: Andrei Gheata 2003/04/10
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TGeoTrack
13 #define ROOT_TGeoTrack
14 
15 #ifndef ROOT_TVirtualGeoTrack
16 #include "TVirtualGeoTrack.h"
17 #endif
18 
19 #ifndef ROOT_TPolyLine3D
20 #include "TPolyLine3D.h"
21 #endif
22 
23 class TPolyMarker3D;
24 
25 /////////////////////////////////////////////////////////////////////////////
26 // TGeoTrack - Tracks attached to a geometry. //
27 // Tracks are 3D objects made of points and they store a //
28 // pointer to a TParticle. The geometry manager holds a list //
29 // of all tracks that will be deleted on destruction of //
30 // gGeoManager. //
31 // //
32 /////////////////////////////////////////////////////////////////////////////
33 
35 {
36 public:
37 
42  kGeoPType = BIT(10),
44 };
45 
46 private :
47  Int_t fPointsSize; // capacity of points array
48  Int_t fNpoints; // number of stored points
49  Double_t *fPoints; //[fNpoints] array of points (x,y,z,t) belonging to this track
50 
51 protected:
52  TGeoTrack(const TGeoTrack&);
53  TGeoTrack& operator=(const TGeoTrack&);
54 
55 public:
56  TGeoTrack();
57  TGeoTrack(Int_t id, Int_t pdgcode, TVirtualGeoTrack *parent=0, TObject *particle=0);
58  virtual ~TGeoTrack();
59 
60  virtual TVirtualGeoTrack *AddDaughter(Int_t id, Int_t pdgcode, TObject *particle=0);
61  virtual Int_t AddDaughter(TVirtualGeoTrack *other);
62  virtual void AddPoint(Double_t x, Double_t y, Double_t z, Double_t t);
63  virtual void AnimateTrack(Double_t tmin=0, Double_t tmax=5E-8, Double_t nframes=200, Option_t *option="/*"); // *MENU*
64  void Browse(TBrowser *b);
65  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
66  virtual void Draw(Option_t *option=""); // *MENU*
67  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
68  virtual char *GetObjectInfo(Int_t px, Int_t py) const;
69  virtual Int_t GetNpoints() const {return (fNpoints>>2);}
70  virtual Int_t GetPoint(Int_t i, Double_t &x, Double_t &y, Double_t &z, Double_t &t) const;
71  virtual const Double_t *GetPoint(Int_t i) const;
72  Int_t GetPoint(Double_t tof, Double_t *point, Int_t istart=0) const;
73  Bool_t IsFolder() const {return (GetNdaughters()>0)?kTRUE:kFALSE;}
74  virtual void Paint(Option_t *option="");
75  virtual void PaintCollect(Double_t time, Double_t *box);
76  virtual void PaintCollectTrack(Double_t time, Double_t *box);
77  void PaintMarker(Double_t *point, Option_t *option="");
78  virtual void PaintTrack(Option_t *option="");
79  virtual void Print(Option_t *option="") const; // *MENU*
80  virtual void ResetTrack();
81  Int_t SearchPoint(Double_t time, Int_t istart=0) const;
82  void SetBits(Bool_t is_default=kTRUE, Bool_t is_onelevel=kFALSE,
83  Bool_t is_all=kFALSE, Bool_t is_type=kFALSE);
84  Int_t Size(Int_t &imin, Int_t &imax);
85  virtual void Sizeof3D() const;
86 
87  ClassDef(TGeoTrack, 1) // geometry tracks class
88 };
89 
90 #endif
91 
92 
93 
94 
Int_t SearchPoint(Double_t time, Int_t istart=0) const
Search index of track point having the closest time tag smaller than TIME.
Definition: TGeoTrack.cxx:676
TGeoTrack()
-*-*-*-*-*-*-*-*-*-*Tracks default constructor-*-*-*-*-*-*-*-* *-* ========================== ...
Definition: TGeoTrack.cxx:37
virtual void PaintCollectTrack(Double_t time, Double_t *box)
Paint just this track.
Definition: TGeoTrack.cxx:479
const char Option_t
Definition: RtypesCore.h:62
#define BIT(n)
Definition: Rtypes.h:120
virtual void PaintCollect(Double_t time, Double_t *box)
Paint track and daughters.
Definition: TGeoTrack.cxx:452
Int_t fPointsSize
Definition: TGeoTrack.h:47
virtual void Draw(Option_t *option="")
Draw this track overimposed on a geometry, according to option.
Definition: TGeoTrack.cxx:315
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Definition: fillpatterns.C:1
virtual void Paint(Option_t *option="")
Paint this track (and descendents) with current attributes.
Definition: TGeoTrack.cxx:421
virtual void ResetTrack()
Reset data for this track.
Definition: TGeoTrack.cxx:714
virtual TVirtualGeoTrack * AddDaughter(Int_t id, Int_t pdgcode, TObject *particle=0)
Add a daughter track to this.
Definition: TGeoTrack.cxx:105
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:254
EGeoParticleActions
Definition: TGeoTrack.h:38
Base class for user-defined tracks attached to a geometry.
TGeoTrack & operator=(const TGeoTrack &)
Assignment operator. NOT TO BE CALLED.
Definition: TGeoTrack.cxx:82
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Event treatment.
Definition: TGeoTrack.cxx:353
virtual void PaintTrack(Option_t *option="")
Paint this track with its current attributes.
Definition: TGeoTrack.cxx:515
virtual void Print(Option_t *option="") const
Print some info about the track.
Definition: TGeoTrack.cxx:643
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:41
virtual Int_t GetPoint(Int_t i, Double_t &x, Double_t &y, Double_t &z, Double_t &t) const
Get coordinates for point I on the track.
Definition: TGeoTrack.cxx:374
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Returns distance to track primitive for picking.
Definition: TGeoTrack.cxx:242
virtual void AddPoint(Double_t x, Double_t y, Double_t z, Double_t t)
Add a point on the track.
Definition: TGeoTrack.cxx:203
Int_t Size(Int_t &imin, Int_t &imax)
Return the number of points within the time interval specified by TGeoManager class and the correspon...
Definition: TGeoTrack.cxx:659
virtual void AnimateTrack(Double_t tmin=0, Double_t tmax=5E-8, Double_t nframes=200, Option_t *option="/*")
Draw animation of this track.
Definition: TGeoTrack.cxx:129
Double_t E()
Definition: TMath.h:54
Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects)...
Definition: TGeoTrack.h:73
Int_t fNpoints
Definition: TGeoTrack.h:48
Double_t * fPoints
Definition: TGeoTrack.h:49
double Double_t
Definition: RtypesCore.h:55
void Browse(TBrowser *b)
How-to-browse for a track.
Definition: TGeoTrack.cxx:226
Double_t y[n]
Definition: legend1.C:17
Mother of all ROOT objects.
Definition: TObject.h:37
you should not use this method at all Int_t Int_t z
Definition: TRolke.cxx:630
virtual char * GetObjectInfo(Int_t px, Int_t py) const
Get some info about the track.
Definition: TGeoTrack.cxx:362
A 3D polymarker.
Definition: TPolyMarker3D.h:40
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Definition: TRolke.cxx:630
virtual ~TGeoTrack()
Destructor.
Definition: TGeoTrack.cxx:96
virtual Int_t GetNpoints() const
Definition: TGeoTrack.h:69
Int_t GetNdaughters() const
const Bool_t kTRUE
Definition: Rtypes.h:91
virtual void Sizeof3D() const
Returns 3D size for the track.
Definition: TGeoTrack.cxx:707
void PaintMarker(Double_t *point, Option_t *option="")
Paint current point of the track as marker.
Definition: TGeoTrack.cxx:497
void SetBits(Bool_t is_default=kTRUE, Bool_t is_onelevel=kFALSE, Bool_t is_all=kFALSE, Bool_t is_type=kFALSE)
Set drawing bits for this track.
Definition: TGeoTrack.cxx:695