Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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#include "TVirtualGeoTrack.h"
16
17/////////////////////////////////////////////////////////////////////////////
18// TGeoTrack - Tracks attached to a geometry. //
19// Tracks are 3D objects made of points and they store a //
20// pointer to a TParticle. The geometry manager holds a list //
21// of all tracks that will be deleted on destruction of //
22// gGeoManager. //
23// //
24/////////////////////////////////////////////////////////////////////////////
25
27public:
33 kGeoPDrawn = BIT(11)
34 };
35
36private:
37 Int_t fPointsSize; // capacity of points array
38 Int_t fNpoints; // number of stored points
39 Double_t *fPoints; //[fNpoints] array of points (x,y,z,t) belonging to this track
40
41protected:
42 TGeoTrack(const TGeoTrack &) = delete;
43 TGeoTrack &operator=(const TGeoTrack &) = delete;
44
45public:
46 TGeoTrack();
47 TGeoTrack(Int_t id, Int_t pdgcode, TVirtualGeoTrack *parent = nullptr, TObject *particle = nullptr);
48 ~TGeoTrack() override;
49
50 TVirtualGeoTrack *AddDaughter(Int_t id, Int_t pdgcode, TObject *particle = nullptr) override;
51 Int_t AddDaughter(TVirtualGeoTrack *other) override;
52 void AddPoint(Double_t x, Double_t y, Double_t z, Double_t t) override;
53 virtual void
54 AnimateTrack(Double_t tmin = 0, Double_t tmax = 5E-8, Double_t nframes = 200, Option_t *option = "/*"); // *MENU*
55 void Browse(TBrowser *b) override;
56 Int_t DistancetoPrimitive(Int_t px, Int_t py) override;
57 void Draw(Option_t *option = "") override; // *MENU*
58 void ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
59 char *GetObjectInfo(Int_t px, Int_t py) const override;
60 Int_t GetNpoints() const override { return (fNpoints >> 2); }
61 Int_t GetPoint(Int_t i, Double_t &x, Double_t &y, Double_t &z, Double_t &t) const override;
62 const Double_t *GetPoint(Int_t i) const override;
63 Int_t GetPoint(Double_t tof, Double_t *point, Int_t istart = 0) const;
64 Bool_t IsFolder() const override { return (GetNdaughters() > 0) ? kTRUE : kFALSE; }
65 void Paint(Option_t *option = "") override;
66 void PaintCollect(Double_t time, Double_t *box) override;
67 void PaintCollectTrack(Double_t time, Double_t *box) override;
68 void PaintMarker(Double_t *point, Option_t *option = "");
69 void PaintTrack(Option_t *option = "") override;
70 void Print(Option_t *option = "") const override; // *MENU*
71 void ResetTrack() override;
72 Int_t SearchPoint(Double_t time, Int_t istart = 0) const;
73 void
74 SetBits(Bool_t is_default = kTRUE, Bool_t is_onelevel = kFALSE, Bool_t is_all = kFALSE, Bool_t is_type = kFALSE);
75 Int_t Size(Int_t &imin, Int_t &imax);
76 virtual void Sizeof3D() const;
77
78 ClassDefOverride(TGeoTrack, 1) // geometry tracks class
79};
80
81#endif
#define b(i)
Definition RSha256.hxx:100
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
double Double_t
Definition RtypesCore.h:59
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
const char Option_t
Definition RtypesCore.h:66
#define BIT(n)
Definition Rtypes.h:85
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t option
Using a TBrowser one can browse all ROOT objects.
Definition TBrowser.h:37
Int_t fPointsSize
Definition TGeoTrack.h:37
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Returns distance to track primitive for picking.
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Event treatment.
virtual void Sizeof3D() const
Returns 3D size for the track.
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...
Int_t SearchPoint(Double_t time, Int_t istart=0) const
Search index of track point having the closest time tag smaller than TIME.
TVirtualGeoTrack * AddDaughter(Int_t id, Int_t pdgcode, TObject *particle=nullptr) override
Add a daughter track to this.
Definition TGeoTrack.cxx:84
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.
Int_t GetPoint(Int_t i, Double_t &x, Double_t &y, Double_t &z, Double_t &t) const override
Get coordinates for point I on the track.
~TGeoTrack() override
Destructor.
Definition TGeoTrack.cxx:74
void Paint(Option_t *option="") override
Paint this track (and descendents) with current attributes.
void Browse(TBrowser *b) override
How-to-browse for a track.
Int_t GetNpoints() const override
Definition TGeoTrack.h:60
Double_t * fPoints
Definition TGeoTrack.h:39
void PaintCollect(Double_t time, Double_t *box) override
Paint track and daughters.
TGeoTrack()
Default constructor.
Definition TGeoTrack.cxx:40
TGeoTrack & operator=(const TGeoTrack &)=delete
void PaintMarker(Double_t *point, Option_t *option="")
Paint current point of the track as marker.
void ResetTrack() override
Reset data for this track.
EGeoParticleActions
Definition TGeoTrack.h:28
@ kGeoPDefault
Definition TGeoTrack.h:29
@ kGeoPOnelevel
Definition TGeoTrack.h:30
@ kGeoPAllDaughters
Definition TGeoTrack.h:31
void PaintTrack(Option_t *option="") override
Paint this track with its current attributes.
TGeoTrack(const TGeoTrack &)=delete
Bool_t IsFolder() const override
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
Definition TGeoTrack.h:64
virtual void AnimateTrack(Double_t tmin=0, Double_t tmax=5E-8, Double_t nframes=200, Option_t *option="/*")
Draw animation of this track.
void PaintCollectTrack(Double_t time, Double_t *box) override
Paint just this track.
void AddPoint(Double_t x, Double_t y, Double_t z, Double_t t) override
Add a point on the track.
char * GetObjectInfo(Int_t px, Int_t py) const override
Get some info about the track.
void Print(Option_t *option="") const override
Print some info about the track.
Int_t fNpoints
Definition TGeoTrack.h:38
Mother of all ROOT objects.
Definition TObject.h:41
Base class for user-defined tracks attached to a geometry.
Int_t GetNdaughters() const
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Definition fillpatterns.C:1
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
th1 Draw()