ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TGeoManager.h
Go to the documentation of this file.
1 // @(#)root/geom:$Id$
2 // Author: Andrei Gheata 25/10/01
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_TGeoManager
13 #define ROOT_TGeoManager
14 
15 #ifndef ROOT_TObjArray
16 #include "TObjArray.h"
17 #endif
18 #ifndef ROOT_TGeoNavigator
19 #include "TGeoNavigator.h"
20 #endif
21 
22 // forward declarations
23 class TVirtualGeoTrack;
24 class TGeoNode;
25 class TGeoPhysicalNode;
26 class TGeoPNEntry;
27 class TGeoVolume;
28 class TGeoVolumeMulti;
29 class TGeoMatrix;
30 class TGeoHMatrix;
31 class TGeoMaterial;
32 class TGeoMedium;
33 class TGeoShape;
34 class TVirtualGeoPainter;
35 class THashList;
36 class TGeoParallelWorld;
37 
38 ////////////////////////////////////////////////////////////////////////////
39 // //
40 // TGeoManager - The manager class for any TGeo geometry. Provides user //
41 // interface for geometry creation, navigation, state querying, //
42 // visualization, IO, geometry checking and other utilities. //
43 // //
44 ////////////////////////////////////////////////////////////////////////////
45 
46 class TGeoManager : public TNamed
47 {
48 protected:
49  static Bool_t fgLock; //! Lock preventing a second geometry to be loaded
50  static Int_t fgVerboseLevel; //! Verbosity level for Info messages (no IO).
51  static Int_t fgMaxLevel; //! Maximum level in geometry
52  static Int_t fgMaxDaughters; //! Maximum number of daughters
53  static Int_t fgMaxXtruVert; //! Maximum number of Xtru vertices
54 
55  TGeoManager(const TGeoManager&);
57 
58 private :
59  Double_t fPhimin; //! lowest range for phi cut
60  Double_t fPhimax; //! highest range for phi cut
61  Double_t fTmin; //! lower time limit for tracks drawing
62  Double_t fTmax; //! upper time limit for tracks drawing
63  Int_t fNNodes; // total number of physical nodes
64  TString fPath; //! path to current node
65  TString fParticleName; //! particles to be drawn
66  Double_t fVisDensity; // transparency threshold by density
67  Int_t fExplodedView; // exploded view mode
68  Int_t fVisOption; // global visualization option
69  Int_t fVisLevel; // maximum visualization depth
70  Int_t fNsegments; // number of segments to approximate circles
71  Int_t fNtracks; // number of tracks
72  Int_t fMaxVisNodes; // maximum number of visible nodes
73  TVirtualGeoTrack *fCurrentTrack; //! current track
74  Int_t fNpdg; // number of different pdg's stored
75  Int_t fPdgId[1024]; // pdg conversion table
76  Bool_t fClosed; //! flag that geometry is closed
77  Bool_t fLoopVolumes; //! flag volume lists loop
78  Bool_t fStreamVoxels; // flag to allow voxelization I/O
79  Bool_t fIsGeomReading; //! flag set when reading geometry
80  Bool_t fIsGeomCleaning; //! flag to notify that the manager is being destructed
81  Bool_t fPhiCut; // flag for phi cuts
82  Bool_t fTimeCut; // time cut for tracks
83  Bool_t fDrawExtra; //! flag that the list of physical nodes has to be drawn
84  Bool_t fMatrixTransform; //! flag for using GL matrix
85  Bool_t fMatrixReflection; //! flag for GL reflections
86  Bool_t fActivity; //! switch ON/OFF volume activity (default OFF - all volumes active))
87  Bool_t fIsNodeSelectable; //! flag that nodes are the selected objects in pad rather than volumes
88  TVirtualGeoPainter *fPainter; //! current painter
89 
90  TObjArray *fMatrices; //-> list of local transformations
91  TObjArray *fShapes; //-> list of shapes
92  TObjArray *fVolumes; //-> list of volumes
93  TObjArray *fPhysicalNodes; //-> list of physical nodes
94  TObjArray *fGShapes; //! list of runtime shapes
95  TObjArray *fGVolumes; //! list of runtime volumes
96  TObjArray *fTracks; //-> list of tracks attached to geometry
97  TObjArray *fPdgNames; //-> list of pdg names for tracks
98 // TObjArray *fNavigators; //! list of navigators
99  TList *fMaterials; //-> list of materials
100  TList *fMedia; //-> list of tracking media
101  TObjArray *fNodes; //-> current branch of nodes
102  TObjArray *fOverlaps; //-> list of geometrical overlaps
103  UChar_t *fBits; //! bits used for voxelization
104  // Map of navigatorr arrays per thread
105  typedef std::map<Long_t, TGeoNavigatorArray *> NavigatorsMap_t;
106  typedef NavigatorsMap_t::iterator NavigatorsMapIt_t;
107  typedef std::map<Long_t, Int_t> ThreadsMap_t;
108  typedef ThreadsMap_t::const_iterator ThreadsMapIt_t;
109 
110  NavigatorsMap_t fNavigators; //! Map between thread id's and navigator arrays
111  static ThreadsMap_t *fgThreadId; //! Thread id's map
112  static Int_t fgNumThreads; //! Number of registered threads
113  static Bool_t fgLockNavigators; //! Lock existing navigators
114  TGeoNavigator *fCurrentNavigator; //! current navigator
115  TGeoVolume *fCurrentVolume; //! current volume
116  TGeoVolume *fTopVolume; //! top level volume in geometry
117  TGeoNode *fTopNode; //! top physical node
118  TGeoVolume *fMasterVolume; // master volume
119  TGeoHMatrix *fGLMatrix; // matrix to be used for view transformations
120  TObjArray *fUniqueVolumes; //-> list of unique volumes
121  TGeoShape *fClippingShape; //! clipping shape for raytracing
122  TGeoElementTable *fElementTable; //! table of elements
123 
124  Int_t *fNodeIdArray; //! array of node id's
125  Int_t fNLevel; // maximum accepted level in geometry
126  TGeoVolume *fPaintVolume; //! volume currently painted
127  THashList *fHashVolumes; //! hash list of volumes providing fast search
128  THashList *fHashGVolumes; //! hash list of group volumes providing fast search
129  THashList *fHashPNE; //-> hash list of phisical node entries
130  mutable TObjArray *fArrayPNE; //! array of phisical node entries
131  Int_t fSizePNEId; // size of the array of unique ID's for PN entries
132  Int_t fNPNEId; // number of PN entries having a unique ID
133  Int_t *fKeyPNEId; //[fSizePNEId] array of uid values for PN entries
134  Int_t *fValuePNEId; //[fSizePNEId] array of pointers to PN entries with ID's
135  Int_t fMaxThreads; //! Max number of threads
136  Bool_t fMultiThread; //! Flag for multi-threading
137  Bool_t fUsePWNav; // Activate usage of parallel world in navigation
138  TGeoParallelWorld *fParallelWorld; // Parallel world
139 //--- private methods
141  void Init();
142  Bool_t InitArrayPNE() const;
143  Bool_t InsertPNEId(Int_t uid, Int_t ientry);
145  void UpdateElements();
146  void Voxelize(Option_t *option = 0);
147 
148 public:
149  // constructors
150  TGeoManager();
151  TGeoManager(const char *name, const char *title);
152  // destructor
153  virtual ~TGeoManager();
154  //--- adding geometrical objects
155  Int_t AddMaterial(const TGeoMaterial *material);
156  Int_t AddOverlap(const TNamed *ovlp);
157  Int_t AddTransformation(const TGeoMatrix *matrix);
158  Int_t AddShape(const TGeoShape *shape);
159  Int_t AddTrack(Int_t id, Int_t pdgcode, TObject *particle=0);
161  Int_t AddVolume(TGeoVolume *volume);
163  void ClearOverlaps();
164  void RegisterMatrix(const TGeoMatrix *matrix);
165  void SortOverlaps();
166  //--- browsing and tree navigation
167  void Browse(TBrowser *b);
168  void SetVisibility(TObject *obj, Bool_t vis);
169  virtual Bool_t cd(const char *path=""); // *MENU*
170  Bool_t CheckPath(const char *path) const;
171  void CdNode(Int_t nodeid);
172  void CdDown(Int_t index);
173  void CdUp();
174  void CdTop();
175  void CdNext();
176  void GetBranchNames(Int_t *names) const;
177  void GetBranchNumbers(Int_t *copyNumbers, Int_t *volumeNumbers) const;
178  void GetBranchOnlys(Int_t *isonly) const;
180  const char *GetPdgName(Int_t pdg) const;
181  void SetPdgName(Int_t pdg, const char *name);
182  Bool_t IsFolder() const { return kTRUE; }
183  //--- visualization settings
184  virtual void Edit(Option_t *option=""); // *MENU*
185  void BombTranslation(const Double_t *tr, Double_t *bombtr);
186  void UnbombTranslation(const Double_t *tr, Double_t *bombtr);
187  void ClearAttributes(); // *MENU*
188  void DefaultAngles(); // *MENU*
189  void DefaultColors(); // *MENU*
191  Int_t GetNsegments() const;
194  Int_t GetBombMode() const {return fExplodedView;}
195  void GetBombFactors(Double_t &bombx, Double_t &bomby, Double_t &bombz, Double_t &bombr) const;
197  Bool_t GetTminTmax(Double_t &tmin, Double_t &tmax) const;
198  Double_t GetTmax() const {return fTmax;}
201  Int_t GetVisLevel() const;
202  Int_t GetVisOption() const;
203  Bool_t IsInPhiRange() const;
204  Bool_t IsDrawingExtra() const {return fDrawExtra;}
206  Bool_t IsVisLeaves() const {return (fVisOption==1)?kTRUE:kFALSE;}
207  void ModifiedPad() const;
208  void OptimizeVoxels(const char *filename="tgeovox.C"); // *MENU*
209  void SetClipping(Bool_t flag=kTRUE) {SetClippingShape(((flag)?fClippingShape:0));} // *MENU*
210  void SetClippingShape(TGeoShape *clip);
211  void SetExplodedView(Int_t iopt=0); // *MENU*
212  void SetPhiRange(Double_t phimin=0., Double_t phimax=360.);
213  void SetNsegments(Int_t nseg); // *MENU*
215  void SetBombFactors(Double_t bombx=1.3, Double_t bomby=1.3, Double_t bombz=1.3, Double_t bombr=1.3); // *MENU*
217  void SetTopVisible(Bool_t vis=kTRUE);
218  void SetTminTmax(Double_t tmin=0, Double_t tmax=999);
221  void SetVisDensity(Double_t dens=0.01); // *MENU*
222  void SetVisLevel(Int_t level=3); // *MENU*
223  void SetVisOption(Int_t option=0);
224  void ViewLeaves(Bool_t flag=kTRUE); // *TOGGLE* *GETTER=IsVisLeaves
225  void SaveAttributes(const char *filename="tgeoatt.C"); // *MENU*
226  void RestoreMasterVolume(); // *MENU*
227  void SetMaxVisNodes(Int_t maxnodes=10000); // *MENU*
228  //--- geometry checking
229  void AnimateTracks(Double_t tmin=0, Double_t tmax=5E-8, Int_t nframes=200, Option_t *option="/*"); // *MENU*
230  void CheckBoundaryErrors(Int_t ntracks=1000000, Double_t radius=-1.); // *MENU*
231  void CheckBoundaryReference(Int_t icheck=-1);
232  void CheckGeometryFull(Int_t ntracks=1000000, Double_t vx=0., Double_t vy=0., Double_t vz=0., Option_t *option="ob"); // *MENU*
233  void CheckGeometry(Option_t *option="");
234  void CheckOverlaps(Double_t ovlp=0.1, Option_t *option=""); // *MENU*
235  void CheckPoint(Double_t x=0,Double_t y=0, Double_t z=0, Option_t *option=""); // *MENU*
236  void CheckShape(TGeoShape *shape, Int_t testNo, Int_t nsamples, Option_t *option);
237  void ConvertReflections();
238  void DrawCurrentPoint(Int_t color=2); // *MENU*
239  void DrawTracks(Option_t *option=""); // *MENU*
241  const char *GetParticleName() const {return fParticleName.Data();}
242  void DrawPath(const char *path, Option_t *option="");
243  void PrintOverlaps() const; // *MENU*
244  void RandomPoints(const TGeoVolume *vol, Int_t npoints=10000, Option_t *option="");
245  void RandomRays(Int_t nrays=1000, Double_t startx=0, Double_t starty=0, Double_t startz=0, const char *target_vol=0, Bool_t check_norm=kFALSE);
246  TGeoNode *SamplePoints(Int_t npoints, Double_t &dist, Double_t epsil=1E-5,
247  const char *g3path="");
248  void SetNmeshPoints(Int_t npoints=1000);
249  void SetCheckedNode(TGeoNode *node);
250  void Test(Int_t npoints=1000000, Option_t *option=""); // *MENU*
251  void TestOverlaps(const char* path=""); // *MENU*
252  Double_t Weight(Double_t precision=0.01, Option_t *option="va"); // *MENU*
253 
254  //--- GEANT3-like geometry creation
255  TGeoVolume *Division(const char *name, const char *mother, Int_t iaxis, Int_t ndiv,
256  Double_t start, Double_t step, Int_t numed=0, Option_t *option="");
257  void Matrix(Int_t index, Double_t theta1, Double_t phi1,
258  Double_t theta2, Double_t phi2,
259  Double_t theta3, Double_t phi3);
260  TGeoMaterial *Material(const char *name, Double_t a, Double_t z, Double_t dens, Int_t uid, Double_t radlen=0, Double_t intlen=0);
261  TGeoMaterial *Mixture(const char *name, Float_t *a, Float_t *z, Double_t dens,
262  Int_t nelem, Float_t *wmat, Int_t uid);
263  TGeoMaterial *Mixture(const char *name, Double_t *a, Double_t *z, Double_t dens,
264  Int_t nelem, Double_t *wmat, Int_t uid);
265  TGeoMedium *Medium(const char *name, Int_t numed, Int_t nmat, Int_t isvol,
266  Int_t ifield, Double_t fieldm, Double_t tmaxfd,
267  Double_t stemax, Double_t deemax, Double_t epsil,
268  Double_t stmin);
269  void Node(const char *name, Int_t nr, const char *mother,
270  Double_t x, Double_t y, Double_t z, Int_t irot,
271  Bool_t isOnly, Float_t *upar, Int_t npar=0);
272  void Node(const char *name, Int_t nr, const char *mother,
273  Double_t x, Double_t y, Double_t z, Int_t irot,
274  Bool_t isOnly, Double_t *upar, Int_t npar=0);
275  TGeoVolume *Volume(const char *name, const char *shape, Int_t nmed,
276  Float_t *upar, Int_t npar=0);
277  TGeoVolume *Volume(const char *name, const char *shape, Int_t nmed,
278  Double_t *upar, Int_t npar=0);
279  void SetVolumeAttribute(const char *name, const char *att, Int_t val);
280  //--- geometry building
281  void BuildDefaultMaterials();
282  void CloseGeometry(Option_t *option="d");
283  Bool_t IsClosed() const {return fClosed;}
284  TGeoVolume *MakeArb8(const char *name, TGeoMedium *medium,
285  Double_t dz, Double_t *vertices=0);
286  TGeoVolume *MakeBox(const char *name, TGeoMedium *medium,
287  Double_t dx, Double_t dy, Double_t dz);
288  TGeoVolume *MakeCone(const char *name, TGeoMedium *medium,
289  Double_t dz, Double_t rmin1, Double_t rmax1,
290  Double_t rmin2, Double_t rmax2);
291  TGeoVolume *MakeCons(const char *name, TGeoMedium *medium,
292  Double_t dz, Double_t rmin1, Double_t rmax1,
293  Double_t rmin2, Double_t rmax2,
294  Double_t phi1, Double_t phi2);
295  TGeoVolume *MakeCtub(const char *name, TGeoMedium *medium,
296  Double_t rmin, Double_t rmax, Double_t dz, Double_t phi1, Double_t phi2,
297  Double_t lx, Double_t ly, Double_t lz, Double_t tx, Double_t ty, Double_t tz);
298  TGeoVolume *MakeEltu(const char *name, TGeoMedium *medium,
299  Double_t a, Double_t b, Double_t dz);
300  TGeoVolume *MakeGtra(const char *name, TGeoMedium *medium,
302  Double_t bl1, Double_t tl1, Double_t alpha1, Double_t h2, Double_t bl2,
303  Double_t tl2, Double_t alpha2);
304  TGeoVolume *MakePara(const char *name, TGeoMedium *medium,
305  Double_t dx, Double_t dy, Double_t dz,
307  TGeoVolume *MakePcon(const char *name, TGeoMedium *medium,
308  Double_t phi, Double_t dphi, Int_t nz);
309  TGeoVolume *MakeParaboloid(const char *name, TGeoMedium *medium,
310  Double_t rlo, Double_t rhi, Double_t dz);
311  TGeoVolume *MakeHype(const char *name, TGeoMedium *medium,
312  Double_t rin, Double_t stin, Double_t rout, Double_t stout, Double_t dz);
313  TGeoVolume *MakePgon(const char *name, TGeoMedium *medium,
314  Double_t phi, Double_t dphi, Int_t nedges, Int_t nz);
315  TGeoVolume *MakeSphere(const char *name, TGeoMedium *medium,
316  Double_t rmin, Double_t rmax,
317  Double_t themin=0, Double_t themax=180,
318  Double_t phimin=0, Double_t phimax=360);
319  TGeoVolume *MakeTorus(const char *name, TGeoMedium *medium, Double_t r,
320  Double_t rmin, Double_t rmax, Double_t phi1=0, Double_t dphi=360);
321  TGeoVolume *MakeTrap(const char *name, TGeoMedium *medium,
323  Double_t bl1, Double_t tl1, Double_t alpha1, Double_t h2, Double_t bl2,
324  Double_t tl2, Double_t alpha2);
325  TGeoVolume *MakeTrd1(const char *name, TGeoMedium *medium,
326  Double_t dx1, Double_t dx2, Double_t dy, Double_t dz);
327  TGeoVolume *MakeTrd2(const char *name, TGeoMedium *medium,
328  Double_t dx1, Double_t dx2, Double_t dy1, Double_t dy2,
329  Double_t dz);
330  TGeoVolume *MakeTube(const char *name, TGeoMedium *medium,
331  Double_t rmin, Double_t rmax, Double_t dz);
332  TGeoVolume *MakeTubs(const char *name, TGeoMedium *medium,
333  Double_t rmin, Double_t rmax, Double_t dz,
334  Double_t phi1, Double_t phi2);
335  TGeoVolume *MakeXtru(const char *name, TGeoMedium *medium,
336  Int_t nz);
337 
338  TGeoPNEntry *SetAlignableEntry(const char *unique_name, const char *path, Int_t uid=-1);
339  TGeoPNEntry *GetAlignableEntry(const char *name) const;
340  TGeoPNEntry *GetAlignableEntry(Int_t index) const;
342  Int_t GetNAlignable(Bool_t with_uid=kFALSE) const;
343  TGeoPhysicalNode *MakeAlignablePN(const char *name);
345  TGeoPhysicalNode *MakePhysicalNode(const char *path=0);
346  void ClearPhysicalNodes(Bool_t mustdelete=kFALSE);
347  void RefreshPhysicalNodes(Bool_t lock=kTRUE);
348  TVirtualGeoTrack *MakeTrack(Int_t id, Int_t pdgcode, TObject *particle);
350  TGeoVolumeMulti *MakeVolumeMulti(const char *name, TGeoMedium *medium);
351  void SetTopVolume(TGeoVolume *vol);
352 
353  //--- geometry queries
354  TGeoNode *CrossBoundaryAndLocate(Bool_t downwards, TGeoNode *skipnode);
355  TGeoNode *FindNextBoundary(Double_t stepmax=TGeoShape::Big(),const char *path="", Bool_t frombdr=kFALSE);
356  TGeoNode *FindNextDaughterBoundary(Double_t *point, Double_t *dir, Int_t &idaughter, Bool_t compmatrix=kFALSE);
358  TGeoNode *FindNode(Bool_t safe_start=kTRUE);
360  Double_t *FindNormal(Bool_t forward=kTRUE);
362  TGeoNode *InitTrack(const Double_t *point, const Double_t *dir);
364  void ResetState();
365  Double_t Safety(Bool_t inside=kFALSE);
366  TGeoNode *SearchNode(Bool_t downwards=kFALSE, const TGeoNode *skipnode=0);
372  Int_t GetNtracks() const {return fNtracks;}
376  TVirtualGeoTrack *GetTrack(Int_t index) {return (index<fNtracks)?(TVirtualGeoTrack*)fTracks->At(index):0;}
377  Int_t GetTrackIndex(Int_t id) const;
383  Int_t GetSafeLevel() const;
387  void InspectState() const;
411 
412 
413  //--- cleaning
414  void CleanGarbage();
415  void ClearShape(const TGeoShape *shape);
417  void ClearNavigators();
418  void RemoveMaterial(Int_t index);
419  void RemoveNavigator(const TGeoNavigator *nav);
420  void ResetUserData();
421 
422 
423  //--- utilities
424  Int_t CountNodes(const TGeoVolume *vol=0, Int_t nlevels=10000, Int_t option=0);
425  void CountLevels();
426  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
427  static Int_t Parse(const char* expr, TString &expr1, TString &expr2, TString &expr3);
428  Int_t ReplaceVolume(TGeoVolume *vorig, TGeoVolume *vnew);
429  Int_t TransformVolumeToAssembly(const char *vname);
430  UChar_t *GetBits() {return fBits;}
431  virtual Int_t GetByteCount(Option_t *option=0);
432  void SetAllIndex();
433  static Int_t GetMaxDaughters();
434  static Int_t GetMaxLevels();
435  static Int_t GetMaxXtruVert();
436  Int_t GetMaxThreads() const {return fMaxThreads-1;}
437  void SetMaxThreads(Int_t nthreads);
440  static void SetNavigatorsLock(Bool_t flag);
441  static Int_t ThreadId();
442  static Int_t GetNumThreads();
443  static void ClearThreadsMap();
444  void ClearThreadData() const;
445  void CreateThreadData() const;
446 
447  //--- I/O
448  virtual Int_t Export(const char *filename, const char *name="", Option_t *option="vg");
449  static void LockGeometry();
450  static void UnlockGeometry();
451  static Int_t GetVerboseLevel();
452  static void SetVerboseLevel(Int_t vl);
453  static TGeoManager *Import(const char *filename, const char *name="", Option_t *option="");
454  static Bool_t IsLocked();
457 
458  //--- list getters
464  TList *GetListOfMedia() const {return fMedia;}
467  TObjArray *GetListOfShapes() const {return fShapes;}
470  TObjArray *GetListOfTracks() const {return fTracks;}
473 
474  //--- modeler state getters/setters
475  void DoBackupState();
476  void DoRestoreState();
477  TGeoNode *GetNode(Int_t level) const {return (TGeoNode*)fNodes->UncheckedAt(level);}
480  TGeoNode *GetMother(Int_t up=1) const {return GetCurrentNavigator()->GetMother(up);}
484  TGeoHMatrix *GetGLMatrix() const {return fGLMatrix;}
487  Int_t GetCurrentNodeId() const;
492  const Double_t *GetCldir() const {return GetCurrentNavigator()->GetCldir();}
493  const Double_t *GetNormal() const {return GetCurrentNavigator()->GetNormal();}
495  Int_t GetMaxLevel() const {return fNLevel;}
496  const char *GetPath() const;
499  TGeoVolume *GetTopVolume() const {return fTopVolume;}
500  TGeoNode *GetTopNode() const {return fTopNode;}
508 
509  //--- point/vector reference frame conversion
510  void LocalToMaster(const Double_t *local, Double_t *master) const {GetCurrentNavigator()->LocalToMaster(local, master);}
511  void LocalToMasterVect(const Double_t *local, Double_t *master) const {GetCurrentNavigator()->LocalToMasterVect(local, master);}
512  void LocalToMasterBomb(const Double_t *local, Double_t *master) const {GetCurrentNavigator()->LocalToMasterBomb(local, master);}
513  void MasterToLocal(const Double_t *master, Double_t *local) const {GetCurrentNavigator()->MasterToLocal(master, local);}
514  void MasterToLocalVect(const Double_t *master, Double_t *local) const {GetCurrentNavigator()->MasterToLocalVect(master, local);}
515  void MasterToLocalBomb(const Double_t *master, Double_t *local) const {GetCurrentNavigator()->MasterToLocalBomb(master, local);}
516  void MasterToTop(const Double_t *master, Double_t *top) const;
517  void TopToMaster(const Double_t *top, Double_t *master) const;
518 
519  //--- general use getters/setters
521  TGeoVolume *FindVolumeFast(const char*name, Bool_t multi=kFALSE);
522  TGeoMaterial *GetMaterial(const char *matname) const;
523  TGeoMaterial *GetMaterial(Int_t id) const;
524  TGeoMedium *GetMedium(const char *medium) const;
525  TGeoMedium *GetMedium(Int_t numed) const;
526  Int_t GetMaterialIndex(const char *matname) const;
527 // TGeoShape *GetShape(const char *name) const;
528  TGeoVolume *GetVolume(const char*name) const;
529  TGeoVolume *GetVolume(Int_t uid) const {return (TGeoVolume*)fUniqueVolumes->At(uid);}
530  Int_t GetUID(const char *volname) const;
531  Int_t GetNNodes() {if (!fNNodes) CountNodes(); return fNNodes;}
533 // void SetCache(const TGeoNodeCache *cache) {fCache = (TGeoNodeCache*)cache;}
535  virtual ULong_t SizeOf(const TGeoNode *node, Option_t *option); // size of the geometry in memory
536  void SelectTrackingMedia();
537 
538  //--- stack manipulation
539  Int_t PushPath(Int_t startlevel=0) {return GetCurrentNavigator()->PushPath(startlevel);}
541  Bool_t PopPath(Int_t index) {return GetCurrentNavigator()->PopPath(index);}
542  Int_t PushPoint(Int_t startlevel=0) {return GetCurrentNavigator()->PushPoint(startlevel);}
544  Bool_t PopPoint(Int_t index) {return GetCurrentNavigator()->PopPoint(index);}
545  void PopDummy(Int_t ipop=9999) {return GetCurrentNavigator()->PopDummy(ipop);}
546 
547  //--- parallel world navigation
550  void SetUseParallelWorldNav(Bool_t flag);
552 
553  ClassDef(TGeoManager, 14) // geometry manager
554 };
555 
557 
558 #endif
559 
const int nx
Definition: kalman.C:16
void SetTopVisible(Bool_t vis=kTRUE)
make top volume visible on screen
TObjArray * fShapes
Definition: TGeoManager.h:91
TGeoVolumeMulti * MakeVolumeMulti(const char *name, TGeoMedium *medium)
Make a TGeoVolumeMulti handling a list of volumes.
void CheckPoint(Double_t x=0, Double_t y=0, Double_t z=0, Option_t *option="")
Classify a given point. See TGeoChecker::CheckPoint().
const Double_t * GetLastPoint() const
Definition: TGeoManager.h:375
Int_t GetNodeId() const
void SetLastPoint(Double_t x, Double_t y, Double_t z)
Definition: TGeoManager.h:504
Double_t fPhimin
Definition: TGeoManager.h:59
TVirtualGeoTrack * GetCurrentTrack()
Definition: TGeoManager.h:373
const Double_t * GetNormal() const
std::map< Long_t, TGeoNavigatorArray * > NavigatorsMap_t
bits used for voxelization
Definition: TGeoManager.h:105
void MasterToLocalVect(const Double_t *master, Double_t *local) const
Definition: TGeoManager.h:514
TGeoNode * SamplePoints(Int_t npoints, Double_t &dist, Double_t epsil=1E-5, const char *g3path="")
shoot npoints randomly in a box of 1E-5 arround current point.
TList * fMedia
Definition: TGeoManager.h:100
void CheckGeometryFull(Int_t ntracks=1000000, Double_t vx=0., Double_t vy=0., Double_t vz=0., Option_t *option="ob")
Geometry checking.
double dist(Rotation3D const &r1, Rotation3D const &r2)
Definition: 3DDistances.cxx:48
void SetCurrentDirection(Double_t nx, Double_t ny, Double_t nz)
Definition: TGeoManager.h:506
TObjArray * fVolumes
Definition: TGeoManager.h:92
Int_t GetNmany() const
An array of TObjects.
Definition: TObjArray.h:39
TGeoHMatrix * fGLMatrix
Definition: TGeoManager.h:119
TGeoPhysicalNode * MakePhysicalNode(const char *path=0)
Makes a physical node corresponding to a path.
Bool_t IsExiting() const
Definition: TGeoManager.h:403
TGeoNode * InitTrack(const Double_t *point, const Double_t *dir)
Initialize current point and current direction vector (normalized) in MARS.
void DoRestoreState()
Restore a backed-up state without affecting the cache stack.
void CheckGeometry(Option_t *option="")
Perform last checks on the geometry.
void CheckShape(TGeoShape *shape, Int_t testNo, Int_t nsamples, Option_t *option)
Test for shape navigation methods.
TGeoVolume * MakeGtra(const char *name, TGeoMedium *medium, Double_t dz, Double_t theta, Double_t phi, Double_t twist, Double_t h1, Double_t bl1, Double_t tl1, Double_t alpha1, Double_t h2, Double_t bl2, Double_t tl2, Double_t alpha2)
Make in one step a volume pointing to a twisted trapezoid shape with given medium.
TList * GetListOfMaterials() const
Definition: TGeoManager.h:463
TGeoVolume * MakeCone(const char *name, TGeoMedium *medium, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2)
Make in one step a volume pointing to a cone shape with given medium.
Int_t GetNsegments() const
Get number of segments approximating circles.
Bool_t IsStartSafe() const
Bool_t fActivity
flag for GL reflections
Definition: TGeoManager.h:86
void ClearAttributes()
Reset all attributes to default ones.
TGeoVolume * GetMasterVolume() const
Definition: TGeoManager.h:498
TGeoVolume * MakeCons(const char *name, TGeoMedium *medium, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2, Double_t phi1, Double_t phi2)
Make in one step a volume pointing to a cone segment shape with given medium.
void SetCurrentDirection(Double_t *dir)
Definition: TGeoManager.h:505
void SetAllIndex()
Assigns uid's for all materials,media and matrices.
TGeoNavigatorArray * GetListOfNavigators() const
Get list of navigators for the calling thread.
Bool_t fMatrixTransform
flag that the list of physical nodes has to be drawn
Definition: TGeoManager.h:84
Bool_t IsNullStep() const
void SetCldirChecked(Double_t *dir)
TVector3 cross(const TVector3 &v1, const TVector3 &v2)
Definition: CsgOps.cxx:816
void SetOutside(Bool_t flag=kTRUE)
float Float_t
Definition: RtypesCore.h:53
void GetBranchNumbers(Int_t *copyNumbers, Int_t *volumeNumbers) const
Fill node copy numbers of current branch into an array.
Float_t theta
Definition: shapesAnim.C:5
Int_t GetStackLevel() const
Definition: TGeoManager.h:497
void BombTranslation(const Double_t *tr, Double_t *bombtr)
Get the new 'bombed' translation vector according current exploded view mode.
const char Option_t
Definition: RtypesCore.h:62
TGeoNode * GetNode(Int_t level) const
Definition: TGeoManager.h:477
Double_t Safety(Bool_t inside=kFALSE)
Compute safe distance from the current point.
virtual void Delete(Option_t *option="")
Remove all objects from the array AND delete all heap based objects.
Definition: TObjArray.cxx:329
Int_t ReplaceVolume(TGeoVolume *vorig, TGeoVolume *vnew)
Replaces all occurences of VORIG with VNEW in the geometry tree.
TGeoMaterial * Mixture(const char *name, Float_t *a, Float_t *z, Double_t dens, Int_t nelem, Float_t *wmat, Int_t uid)
Create mixture OR COMPOUND IMAT as composed by THE BASIC nelem materials defined by arrays A...
TGeoNode * SearchNode(Bool_t downwards=kFALSE, const TGeoNode *skipnode=0)
Returns the deepest node containing fPoint, which must be set a priori.
void SetParticleName(const char *pname)
Definition: TGeoManager.h:240
void Test(Int_t npoints=1000000, Option_t *option="")
Check time of finding "Where am I" for n points.
void CdUp()
Go one level up in geometry.
TGeoNode * GetNextNode() const
Definition: TGeoManager.h:479
void CheckOverlaps(Double_t ovlp=0.1, Option_t *option="")
Check all geometry for illegal overlaps within a limit OVLP.
THashList * fHashVolumes
volume currently painted
Definition: TGeoManager.h:127
Double_t GetLastSafety() const
TVirtualGeoTrack * GetTrack(Int_t index)
Definition: TGeoManager.h:376
void Init()
Initialize manager class.
static Int_t fgMaxDaughters
Maximum level in geometry.
Definition: TGeoManager.h:52
void SetCldirChecked(Double_t *dir)
Definition: TGeoManager.h:507
TGeoElementTable * GetElementTable()
Returns material table. Creates it if not existing.
NavigatorsMap_t::iterator NavigatorsMapIt_t
Definition: TGeoManager.h:106
TGeoHMatrix * GetMotherMatrix(Int_t up=1) const
tuple pname
Definition: tree.py:131
Bool_t IsCurrentOverlapping() const
const Double_t * GetCldirChecked() const
const Double_t * GetCurrentDirection() const
Bool_t fMatrixReflection
flag for using GL matrix
Definition: TGeoManager.h:85
TVirtualGeoTrack * fCurrentTrack
Definition: TGeoManager.h:73
static const char * filename()
Int_t fNtracks
Definition: TGeoManager.h:71
Int_t fNNodes
upper time limit for tracks drawing
Definition: TGeoManager.h:63
static Int_t GetVerboseLevel()
Set verbosity level (static function).
static void SetVerboseLevel(Int_t vl)
Return current verbosity level (static function).
Int_t fPdgId[1024]
Definition: TGeoManager.h:75
TGeoHMatrix * GetCurrentMatrix() const
Definition: TGeoManager.h:483
void SetTopVolume(TGeoVolume *vol)
Set the top volume and corresponding node as starting point of the geometry.
TGeoVolume * MakeTorus(const char *name, TGeoMedium *medium, Double_t r, Double_t rmin, Double_t rmax, Double_t phi1=0, Double_t dphi=360)
Make in one step a volume pointing to a torus shape with given medium.
std::map< Long_t, Int_t > ThreadsMap_t
Definition: TGeoManager.h:107
Bool_t IsActivityEnabled() const
Definition: TGeoManager.h:409
void ResetUserData()
Sets all pointers TGeoVolume::fField to NULL.
TGeoVolume * Volume(const char *name, const char *shape, Int_t nmed, Float_t *upar, Int_t npar=0)
Create a volume in GEANT3 style.
void ViewLeaves(Bool_t flag=kTRUE)
Set visualization option (leaves only OR all volumes)
Basic string class.
Definition: TString.h:137
void MasterToLocal(const Double_t *master, Double_t *local) const
Definition: TGeoManager.h:513
TObjArray * GetListOfShapes() const
Definition: TGeoManager.h:467
static void ClearThreadsMap()
Clear the current map of threads.
void ClearTracks()
Definition: TGeoManager.h:416
TObjArray * fUniqueVolumes
Definition: TGeoManager.h:120
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
TArc * a
Definition: textangle.C:12
Bool_t IsExiting() const
const Bool_t kFALSE
Definition: Rtypes.h:92
TGeoNode * fTopNode
top level volume in geometry
Definition: TGeoManager.h:117
Bool_t fIsNodeSelectable
switch ON/OFF volume activity (default OFF - all volumes active))
Definition: TGeoManager.h:87
void InspectState() const
Inspects path and all flags for the current state.
void OptimizeVoxels(const char *filename="tgeovox.C")
Optimize voxelization type for all volumes. Save best choice in a macro.
static Int_t Parse(const char *expr, TString &expr1, TString &expr2, TString &expr3)
Parse a string boolean expression and do a syntax check.
const char * GetParticleName() const
Definition: TGeoManager.h:241
Int_t fVisOption
Definition: TGeoManager.h:68
TVirtualGeoTrack * MakeTrack(Int_t id, Int_t pdgcode, TObject *particle)
Makes a primary track but do not attach it to the list of tracks.
Bool_t PopPoint(Int_t index)
Definition: TGeoManager.h:544
TGeoVolume * MakeTrd1(const char *name, TGeoMedium *medium, Double_t dx1, Double_t dx2, Double_t dy, Double_t dz)
Make in one step a volume pointing to a TGeoTrd1 shape with given medium.
TGeoShape * fClippingShape
Definition: TGeoManager.h:121
Bool_t fDrawExtra
Definition: TGeoManager.h:83
Float_t py
Definition: hprod.C:33
Int_t GetNAlignable(Bool_t with_uid=kFALSE) const
Retreives number of PN entries with or without UID.
TObjArray * fPdgNames
Definition: TGeoManager.h:97
void SetBombFactors(Double_t bombx=1.3, Double_t bomby=1.3, Double_t bombz=1.3, Double_t bombr=1.3)
Set factors that will "bomb" all translations in cartesian and cylindrical coordinates.
void AnimateTracks(Double_t tmin=0, Double_t tmax=5E-8, Int_t nframes=200, Option_t *option="/*")
Draw animation of tracks.
Bool_t IsCheckingOverlaps() const
static void SetNavigatorsLock(Bool_t flag)
Set the lock for navigators.
TGeoVolume * MakeHype(const char *name, TGeoMedium *medium, Double_t rin, Double_t stin, Double_t rout, Double_t stout, Double_t dz)
Make in one step a volume pointing to a tube shape with given medium.
TGeoVolume * GetVolume(Int_t uid) const
Definition: TGeoManager.h:529
TObjArray * fArrayPNE
Definition: TGeoManager.h:130
TObjArray * fGShapes
Definition: TGeoManager.h:94
void SetVisibility(TObject *obj, Bool_t vis)
Set visibility for a volume.
Bool_t IsSameLocation(Double_t x, Double_t y, Double_t z, Bool_t change=kFALSE)
Checks if point (x,y,z) is still in the current node.
TGeoHMatrix * GetHMatrix()
Return stored current matrix (global matrix of the next touched node).
void SetVisDensity(Double_t dens=0.01)
Set density threshold.
void LocalToMasterBomb(const Double_t *local, Double_t *master) const
static Int_t GetNumThreads()
Returns number of threads that were set to use geometry.
TObjArray * fOverlaps
Definition: TGeoManager.h:102
Int_t fNsegments
Definition: TGeoManager.h:70
void SetCurrentPoint(Double_t x, Double_t y, Double_t z)
Definition: TGeoManager.h:503
Bool_t fIsGeomCleaning
flag set when reading geometry
Definition: TGeoManager.h:80
TObjArray * fMatrices
current painter
Definition: TGeoManager.h:90
void ResetState()
Reset current state flags.
Int_t PushPath(Int_t startlevel=0)
Definition: TGeoManager.h:539
const char * Data() const
Definition: TString.h:349
TGeoParallelWorld * fParallelWorld
Definition: TGeoManager.h:138
TGeoVolume * MakeSphere(const char *name, TGeoMedium *medium, Double_t rmin, Double_t rmax, Double_t themin=0, Double_t themax=180, Double_t phimin=0, Double_t phimax=360)
Make in one step a volume pointing to a sphere shape with given medium.
TGeoParallelWorld * GetParallelWorld() const
Definition: TGeoManager.h:549
virtual Int_t Export(const char *filename, const char *name="", Option_t *option="vg")
Export this geometry to a file.
TGeoVolume * MakeParaboloid(const char *name, TGeoMedium *medium, Double_t rlo, Double_t rhi, Double_t dz)
Make in one step a volume pointing to a tube shape with given medium.
TVirtualGeoTrack * GetParentTrackOfId(Int_t id) const
Get parent track with a given ID.
Double_t x[n]
Definition: legend1.C:17
Bool_t IsStepExiting() const
Definition: TGeoManager.h:405
TGeoPNEntry * SetAlignableEntry(const char *unique_name, const char *path, Int_t uid=-1)
Creates an aligneable object with unique name corresponding to a path and adds it to the list of alig...
void UpdateElements()
Update element flags when geometry is loaded from a file.
Bool_t IsMatrixTransform() const
Definition: TGeoManager.h:390
#define ClassDef(name, id)
Definition: Rtypes.h:254
static Bool_t fgLock
Definition: TGeoManager.h:49
void SetVolumeAttribute(const char *name, const char *att, Int_t val)
Set volume attributes in G3 style.
void RandomRays(Int_t nrays=1000, Double_t startx=0, Double_t starty=0, Double_t startz=0, const char *target_vol=0, Bool_t check_norm=kFALSE)
Randomly shoot nrays and plot intersections with surfaces for current top node.
THashList implements a hybrid collection class consisting of a hash table and a list to store TObject...
Definition: THashList.h:36
TGeoVolume * MakeBox(const char *name, TGeoMedium *medium, Double_t dx, Double_t dy, Double_t dz)
Make in one step a volume pointing to a box shape with given medium.
void SetCurrentTrack(Int_t i)
Definition: TGeoManager.h:370
Bool_t IsStartSafe() const
Definition: TGeoManager.h:395
Int_t AddTrack(Int_t id, Int_t pdgcode, TObject *particle=0)
Add a track to the list of tracks.
Int_t GetNNodes()
Definition: TGeoManager.h:531
const Double_t * GetCldir() const
void PopDummy(Int_t ipop=9999)
void SetCurrentPoint(Double_t *point)
Definition: TGeoManager.h:502
TGeoNode * GetTopNode() const
Definition: TGeoManager.h:500
TObjArray * GetListOfNodes()
Definition: TGeoManager.h:459
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
void LocalToMaster(const Double_t *local, Double_t *master) const
Definition: TGeoManager.h:510
void SetMatrixReflection(Bool_t flag=kTRUE)
Definition: TGeoManager.h:399
void CdDown(Int_t index)
Make a daughter of current node current.
const int ny
Definition: kalman.C:17
void CleanGarbage()
Clean temporary volumes and shapes from garbage collection.
void LocalToMasterVect(const Double_t *local, Double_t *master) const
Definition: TGeoManager.h:511
THashList * fHashGVolumes
hash list of volumes providing fast search
Definition: TGeoManager.h:128
Int_t GetVisLevel() const
Returns current depth to which geometry is drawn.
Bool_t IsClosed() const
Definition: TGeoManager.h:283
void ClearShape(const TGeoShape *shape)
Remove a shape from the list of shapes.
Double_t fTmax
lower time limit for tracks drawing
Definition: TGeoManager.h:62
static Bool_t IsLocked()
Check lock state.
THashList * fHashPNE
hash list of group volumes providing fast search
Definition: TGeoManager.h:129
void Browse(TBrowser *b)
Describe how to browse this object.
TVirtualGeoPainter * GetPainter() const
Definition: TGeoManager.h:193
TList * GetListOfMedia() const
Definition: TGeoManager.h:464
void SortOverlaps()
Sort overlaps by decreasing overlap distance. Extrusions comes first.
void SetNodeSelectable(Bool_t flag=kTRUE)
Definition: TGeoManager.h:220
Bool_t IsOutside() const
TGeoNavigator * fCurrentNavigator
Lock existing navigators.
Definition: TGeoManager.h:114
TGeoVolume * MakeXtru(const char *name, TGeoMedium *medium, Int_t nz)
Make a TGeoXtru-shaped volume with nz planes.
Bool_t IsOnBoundary() const
void SetStartSafe(Bool_t flag=kTRUE)
static Int_t GetMaxDaughters()
Return maximum number of daughters of a volume used in the geometry.
void CheckBoundaryErrors(Int_t ntracks=1000000, Double_t radius=-1.)
Check pushes and pulls needed to cross the next boundary with respect to the position given by FindNe...
Int_t AddVolume(TGeoVolume *volume)
Add a volume to the list. Returns index of the volume in list.
void LocalToMasterBomb(const Double_t *local, Double_t *master) const
Definition: TGeoManager.h:512
TGeoVolume * fTopVolume
current volume
Definition: TGeoManager.h:116
Int_t GetVirtualLevel()
Find level of virtuality of current overlapping node (number of levels up having the same tracking me...
TH2D * h2
Definition: fit2dHist.C:45
TGeoVolume * MakeEltu(const char *name, TGeoMedium *medium, Double_t a, Double_t b, Double_t dz)
Make in one step a volume pointing to a tube shape with given medium.
Int_t fNPNEId
Definition: TGeoManager.h:132
static Int_t fgNumThreads
Thread id's map.
Definition: TGeoManager.h:112
Bool_t InsertPNEId(Int_t uid, Int_t ientry)
Insert a PN entry in the sorted array of indexes.
ThreadsMap_t::const_iterator ThreadsMapIt_t
Definition: TGeoManager.h:108
void SetOutside(Bool_t flag=kTRUE)
Definition: TGeoManager.h:410
TGeoNode * GetCurrentNode() const
Definition: TGeoManager.h:486
void SetClippingShape(TGeoShape *clip)
Set a user-defined shape as clipping for ray tracing.
TGeoVolume * GetPaintVolume() const
Definition: TGeoManager.h:199
void DisableInactiveVolumes()
Definition: TGeoManager.h:368
TGeoVolume * MakeArb8(const char *name, TGeoMedium *medium, Double_t dz, Double_t *vertices=0)
Make an TGeoArb8 volume.
void SetMaxVisNodes(Int_t maxnodes=10000)
set the maximum number of visible nodes.
Bool_t IsCurrentOverlapping() const
Definition: TGeoManager.h:401
TVirtualGeoTrack * GetTrackOfId(Int_t id) const
Get track with a given ID.
TGeoVolume * MakePcon(const char *name, TGeoMedium *medium, Double_t phi, Double_t dphi, Int_t nz)
Make in one step a volume pointing to a polycone shape with given medium.
void RestoreMasterVolume()
Restore the master volume of the geometry.
Bool_t fPhiCut
flag to notify that the manager is being destructed
Definition: TGeoManager.h:81
TH1F * h1
Definition: legend1.C:5
NavigatorsMap_t fNavigators
Definition: TGeoManager.h:110
Bool_t fIsGeomReading
Definition: TGeoManager.h:79
Int_t fVisLevel
Definition: TGeoManager.h:69
TGeoVolume * GetTopVolume() const
Definition: TGeoManager.h:499
Float_t z[5]
Definition: Ifit.C:16
TGeoVolume * MakePara(const char *name, TGeoMedium *medium, Double_t dx, Double_t dy, Double_t dz, Double_t alpha, Double_t theta, Double_t phi)
Make in one step a volume pointing to a paralelipiped shape with given medium.
Int_t TransformVolumeToAssembly(const char *vname)
Transform all volumes named VNAME to assemblies. The volumes must be virtual.
Int_t GetUID(const char *volname) const
Retreive unique id for a volume name. Return -1 if name not found.
void SetCurrentTrack(TVirtualGeoTrack *track)
Definition: TGeoManager.h:371
static Int_t fgVerboseLevel
Lock preventing a second geometry to be loaded.
Definition: TGeoManager.h:50
void MasterToLocalVect(const Double_t *master, Double_t *local) const
void RefreshPhysicalNodes(Bool_t lock=kTRUE)
Refresh physical nodes to reflect the actual geometry paths after alignment was applied.
Int_t fMaxThreads
Definition: TGeoManager.h:135
Int_t * fKeyPNEId
Definition: TGeoManager.h:133
Bool_t fLoopVolumes
flag that geometry is closed
Definition: TGeoManager.h:77
void SetStep(Double_t step)
TGeoMaterial * FindDuplicateMaterial(const TGeoMaterial *mat) const
Find if a given material duplicates an existing one.
const Double_t * GetCldir() const
Definition: TGeoManager.h:492
A doubly linked list.
Definition: TList.h:47
void PopDummy(Int_t ipop=9999)
Definition: TGeoManager.h:545
TGeoPhysicalNode * MakeAlignablePN(const char *name)
Make a physical node from the path pointed by an alignable object with a given name.
Int_t GetMaxVisNodes() const
Definition: TGeoManager.h:196
void CreateThreadData() const
Create thread private data for all geometry objects.
TGeoHMatrix * GetMotherMatrix(Int_t up=1) const
Definition: TGeoManager.h:481
Bool_t CheckPath(const char *path) const
Check if a geometry path is valid without changing the state of the current navigator.
Double_t GetLastSafety() const
Definition: TGeoManager.h:385
TObject * UncheckedAt(Int_t i) const
Definition: TObjArray.h:91
Int_t PushPoint(Int_t startlevel=0)
Definition: TGeoManager.h:542
void SelectTrackingMedia()
Define different tracking media.
TObjArray * GetListOfVolumes() const
Definition: TGeoManager.h:465
Int_t AddOverlap(const TNamed *ovlp)
Add an illegal overlap/extrusion to the list.
TGeoVolumeAssembly * MakeVolumeAssembly(const char *name)
Make an assembly of volumes.
Double_t fTmin
highest range for phi cut
Definition: TGeoManager.h:61
void RemoveNavigator(const TGeoNavigator *nav)
Clear a single navigator.
TObjArray * fPhysicalNodes
Definition: TGeoManager.h:93
Bool_t IsNullStep() const
Definition: TGeoManager.h:408
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:41
Bool_t fTimeCut
Definition: TGeoManager.h:82
Bool_t IsSamePoint(Double_t x, Double_t y, Double_t z) const
Check if a new point with given coordinates is the same as the last located one.
Int_t GetBombMode() const
Definition: TGeoManager.h:194
const Double_t * GetNormal() const
Definition: TGeoManager.h:493
Int_t CountNodes(const TGeoVolume *vol=0, Int_t nlevels=10000, Int_t option=0)
Count the total number of nodes starting from a volume, nlevels down.
Bool_t PopPath()
void SetDrawExtraPaths(Bool_t flag=kTRUE)
Definition: TGeoManager.h:219
Int_t fNLevel
array of node id's
Definition: TGeoManager.h:125
Int_t * fNodeIdArray
table of elements
Definition: TGeoManager.h:124
const Double_t * GetCurrentPoint() const
Definition: TGeoManager.h:488
void SetCurrentPoint(const Double_t *point)
Int_t GetStackLevel() const
TGeoPNEntry * GetAlignableEntry(const char *name) const
Retreives an existing alignable object.
void Matrix(Int_t index, Double_t theta1, Double_t phi1, Double_t theta2, Double_t phi2, Double_t theta3, Double_t phi3)
Create rotation matrix named 'mat<index>'.
ROOT::R::TRInterface & r
Definition: Object.C:4
static void LockGeometry()
Lock current geometry so that no other geometry can be imported.
TGeoMedium * Medium(const char *name, Int_t numed, Int_t nmat, Int_t isvol, Int_t ifield, Double_t fieldm, Double_t tmaxfd, Double_t stemax, Double_t deemax, Double_t epsil, Double_t stmin)
Create tracking medium.
Bool_t IsStepExiting() const
TObjArray * GetListOfTracks() const
Definition: TGeoManager.h:470
Int_t GetLevel() const
TGeoNode * Step(Bool_t is_geom=kTRUE, Bool_t cross=kTRUE)
Make a rectiliniar step of length fStep from current point (fPoint) on current direction (fDirection)...
TPaveLabel title(3, 27.1, 15, 28.7,"ROOT Environment and Tools")
Int_t GetLevel() const
Definition: TGeoManager.h:494
const Double_t * GetLastPoint() const
TGeoNode * FindNextBoundaryAndStep(Double_t stepmax=TGeoShape::Big(), Bool_t compsafe=kFALSE)
Compute distance to next boundary within STEPMAX.
void DefaultColors()
Set default volume colors according to A of material.
Int_t fExplodedView
Definition: TGeoManager.h:67
TGeoNavigator * AddNavigator()
Add a navigator in the list of navigators.
Double_t GetTmax() const
Definition: TGeoManager.h:198
TGeoManager()
Default constructor.
void SetStep(Double_t step)
Definition: TGeoManager.h:400
void SetMatrixTransform(Bool_t on=kTRUE)
Definition: TGeoManager.h:398
Int_t GetNmany() const
Definition: TGeoManager.h:179
Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects)...
Definition: TGeoManager.h:182
Double_t * FindNormalFast()
Computes fast normal to next crossed boundary, assuming that the current point is close enough to the...
TGeoVolume * MakePgon(const char *name, TGeoMedium *medium, Double_t phi, Double_t dphi, Int_t nedges, Int_t nz)
Make in one step a volume pointing to a polygone shape with given medium.
static Int_t fgMaxLevel
Verbosity level for Info messages (no IO).
Definition: TGeoManager.h:51
void CdNode(Int_t nodeid)
Change current path to point to the node having this id.
Bool_t PopPoint()
Definition: TGeoManager.h:543
Double_t fPhimax
lowest range for phi cut
Definition: TGeoManager.h:60
void SetPdgName(Int_t pdg, const char *name)
Set a name for a particle having a given pdg.
Bool_t IsDrawingExtra() const
Definition: TGeoManager.h:204
void GetBombFactors(Double_t &bombx, Double_t &bomby, Double_t &bombz, Double_t &bombr) const
Retrieve cartesian and radial bomb factors.
TGeoShape * GetClippingShape() const
Definition: TGeoManager.h:190
Int_t fMaxVisNodes
Definition: TGeoManager.h:72
Bool_t IsOutside() const
Definition: TGeoManager.h:406
void DrawCurrentPoint(Int_t color=2)
Draw current point in the same view.
TGeoNode * GetMother(Int_t up=1) const
Definition: TGeoManager.h:480
Bool_t IsSameLocation() const
Definition: TGeoManager.h:393
Double_t E()
Definition: TMath.h:54
Int_t fNpdg
current track
Definition: TGeoManager.h:74
Bool_t IsOnBoundary() const
Definition: TGeoManager.h:407
Bool_t IsCleaning() const
Definition: TGeoManager.h:456
void SetLastPoint(Double_t x, Double_t y, Double_t z)
TObjArray * fTracks
list of runtime volumes
Definition: TGeoManager.h:96
TGeoMedium * GetMedium(const char *medium) const
Search for a named tracking medium. All trailing blanks stripped.
TGeoVolume * MakeTrap(const char *name, TGeoMedium *medium, Double_t dz, Double_t theta, Double_t phi, Double_t h1, Double_t bl1, Double_t tl1, Double_t alpha1, Double_t h2, Double_t bl2, Double_t tl2, Double_t alpha2)
Make in one step a volume pointing to a trapezoid shape with given medium.
TGeoNodeCache * GetCache() const
const Double_t * GetCldirChecked() const
Definition: TGeoManager.h:491
Int_t GetTrackIndex(Int_t id) const
Get index for track id, -1 if not found.
Double_t fVisDensity
particles to be drawn
Definition: TGeoManager.h:66
const Double_t * GetCurrentDirection() const
Definition: TGeoManager.h:489
virtual Int_t GetByteCount(Option_t *option=0)
Get total size of geometry in bytes.
void SetLoopVolumes(Bool_t flag=kTRUE)
Definition: TGeoManager.h:144
TGeoNavigator * GetCurrentNavigator() const
Returns current navigator for the calling thread.
Bool_t PopPath()
Definition: TGeoManager.h:540
void CloseGeometry(Option_t *option="d")
Closing geometry implies checking the geometry validity, fixing shapes with negative parameters (run-...
TList * fMaterials
Definition: TGeoManager.h:99
Double_t GetSafeDistance() const
Bool_t IsStepEntering() const
Definition: TGeoManager.h:404
Int_t * fValuePNEId
Definition: TGeoManager.h:134
void DrawTracks(Option_t *option="")
Draw tracks over the geometry, according to option.
void SetCheckedNode(TGeoNode *node)
Assign a given node to be checked for ovelaps. Any other overlaps will be ignored.
TGeoVolume * MakeTrd2(const char *name, TGeoMedium *medium, Double_t dx1, Double_t dx2, Double_t dy1, Double_t dy2, Double_t dz)
Make in one step a volume pointing to a TGeoTrd2 shape with given medium.
const char * GetPdgName(Int_t pdg) const
Get name for given pdg code;.
Bool_t fStreamVoxels
flag volume lists loop
Definition: TGeoManager.h:78
TGeoVolume * Division(const char *name, const char *mother, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step, Int_t numed=0, Option_t *option="")
Create a new volume by dividing an existing one (GEANT3 like)
Long64_t entry
void SetUseParallelWorldNav(Bool_t flag)
Activate/deactivate usage of parallel world navigation.
void ClearThreadData() const
const Double_t * GetCurrentPoint() const
TObjArray * GetListOfMatrices() const
Definition: TGeoManager.h:462
void DrawPath(const char *path, Option_t *option="")
Draw current path.
virtual ~TGeoManager()
Destructor.
void SetMultiThread(Bool_t flag=kTRUE)
Definition: TGeoManager.h:438
TObjArray * fNodes
Definition: TGeoManager.h:101
void RandomPoints(const TGeoVolume *vol, Int_t npoints=10000, Option_t *option="")
Draw random points in the bounding box of a volume.
TGeoNode * FindNode(Bool_t safe_start=kTRUE)
Returns deepest node containing current point.
TObjArray * fGVolumes
list of runtime shapes
Definition: TGeoManager.h:95
void MasterToLocalBomb(const Double_t *master, Double_t *local) const
Definition: TGeoManager.h:515
TGeoNodeCache * GetCache() const
Definition: TGeoManager.h:532
Int_t GetSafeLevel() const
Go upwards the tree until a non-overlaping node.
Float_t phi
Definition: shapesAnim.C:6
TGeoVolume * fCurrentVolume
current navigator
Definition: TGeoManager.h:115
Int_t PushPath(Int_t startlevel=0)
TGeoMaterial * Material(const char *name, Double_t a, Double_t z, Double_t dens, Int_t uid, Double_t radlen=0, Double_t intlen=0)
Create material with given A, Z and density, having an unique id.
void DefaultAngles()
Set default angles for a given view.
Bool_t PopPoint()
virtual Bool_t cd(const char *path="")
Browse the tree of nodes starting from fTopNode according to pathname.
TGeoPhysicalNode * GetPhysicalNode(Int_t i) const
Definition: TGeoManager.h:501
void TestOverlaps(const char *path="")
Geometry overlap checker based on sampling.
Double_t Weight(Double_t precision=0.01, Option_t *option="va")
Estimate weight of volume VOL with a precision SIGMA(W)/W better than PRECISION.
Double_t GetStep() const
Definition: TGeoManager.h:386
Int_t GetVisOption() const
Returns current depth to which geometry is drawn.
static Int_t GetMaxLevels()
Return maximum number of levels used in the geometry.
TObjArray * GetListOfGVolumes() const
Definition: TGeoManager.h:466
void TopToMaster(const Double_t *top, Double_t *master) const
Convert coordinates from top volume frame to master.
void MasterToLocalBomb(const Double_t *master, Double_t *local) const
TGeoVolume * MakeTubs(const char *name, TGeoMedium *medium, Double_t rmin, Double_t rmax, Double_t dz, Double_t phi1, Double_t phi2)
Make in one step a volume pointing to a tube segment shape with given medium.
TGeoHMatrix * GetGLMatrix() const
Definition: TGeoManager.h:484
void SetCurrentDirection(const Double_t *dir)
void DoBackupState()
Backup the current state without affecting the cache stack.
Bool_t IsNodeSelectable() const
Definition: TGeoManager.h:205
R__EXTERN TGeoManager * gGeoManager
Definition: TGeoManager.h:556
void RemoveMaterial(Int_t index)
Remove material at given index.
Bool_t GotoSafeLevel()
Go upwards the tree until a non-overlaping node.
Int_t PushPoint(Int_t startlevel=0)
double Double_t
Definition: RtypesCore.h:55
Int_t GetMaxLevel() const
Definition: TGeoManager.h:495
TGeoNode * GetMother(Int_t up=1) const
TGeoVolume * GetVolume(const char *name) const
Search for a named volume. All trailing blanks stripped.
TVirtualGeoPainter * fPainter
flag that nodes are the selected objects in pad rather than volumes
Definition: TGeoManager.h:88
Double_t GetSafeDistance() const
Definition: TGeoManager.h:384
void Voxelize(Option_t *option=0)
Voxelize all non-divided volumes.
Bool_t IsMultiThread() const
Definition: TGeoManager.h:439
Int_t GetNodeId() const
Definition: TGeoManager.h:478
void SetPaintVolume(TGeoVolume *vol)
Definition: TGeoManager.h:216
virtual ULong_t SizeOf(const TGeoNode *node, Option_t *option)
computes the total size in bytes of the branch starting with node.
void dir(char *path=0)
Definition: rootalias.C:30
void ModifiedPad() const
Send "Modified" signal to painter.
void CdTop()
Make top level node the current node.
unsigned long ULong_t
Definition: RtypesCore.h:51
void RegisterMatrix(const TGeoMatrix *matrix)
Register a matrix to the list of matrices.
void SetPhiRange(Double_t phimin=0., Double_t phimax=360.)
Set cut phi range.
Double_t y[n]
Definition: legend1.C:17
TGeoVolume * GetCurrentVolume() const
Definition: TGeoManager.h:490
static Bool_t fgLockNavigators
Number of registered threads.
Definition: TGeoManager.h:113
TObjArray * GetListOfPhysicalNodes()
Definition: TGeoManager.h:460
TVirtualGeoTrack * FindTrackWithId(Int_t id) const
Search the track hierarchy to find the track with the given id.
Bool_t fUsePWNav
Flag for multi-threading.
Definition: TGeoManager.h:137
Bool_t IsEntering() const
Definition: TGeoManager.h:402
Bool_t SetCurrentNavigator(Int_t index)
Switch to another existing navigator for the calling thread.
Bool_t fClosed
Definition: TGeoManager.h:76
Bool_t IsAnimatingTracks() const
Definition: TGeoManager.h:388
void SetTminTmax(Double_t tmin=0, Double_t tmax=999)
Set time cut interval for drawing tracks.
Bool_t IsInPhiRange() const
True if current node is in phi range.
TGeoHMatrix * GetCurrentMatrix() const
static Double_t Big()
Definition: TGeoShape.h:98
Int_t AddShape(const TGeoShape *shape)
Add a shape to the list. Returns index of the shape in list.
Bool_t PopPath(Int_t index)
Definition: TGeoManager.h:541
static ThreadsMap_t * fgThreadId
Map between thread id's and navigator arrays.
Definition: TGeoManager.h:111
void SetCheckingOverlaps(Bool_t flag=kTRUE)
Definition: TGeoManager.h:396
#define name(a, b)
Definition: linkTestLib0.cpp:5
TGeoVolume * MakeTube(const char *name, TGeoMedium *medium, Double_t rmin, Double_t rmax, Double_t dz)
Make in one step a volume pointing to a tube shape with given medium.
Bool_t IsLoopingVolumes() const
Definition: TGeoManager.h:140
void ConvertReflections()
Convert all reflections in geometry to normal rotations + reflected shapes.
Mother of all ROOT objects.
Definition: TObject.h:58
TGeoNode * FindNextBoundary(Double_t stepmax=TGeoShape::Big(), const char *path="", Bool_t frombdr=kFALSE)
Find distance to next boundary and store it in fStep.
Bool_t IsCheckingOverlaps() const
Definition: TGeoManager.h:389
#define R__EXTERN
Definition: DllImport.h:27
Float_t px
Definition: hprod.C:33
Bool_t IsParallelWorldNav() const
Definition: TGeoManager.h:551
void CountLevels()
Count maximum number of nodes per volume, maximum depth and maximum number of xtru vertices...
void ClearOverlaps()
Clear the list of overlaps.
void SetCheckingOverlaps(Bool_t flag=kTRUE)
void Node(const char *name, Int_t nr, const char *mother, Double_t x, Double_t y, Double_t z, Int_t irot, Bool_t isOnly, Float_t *upar, Int_t npar=0)
Create a node called <name_nr> pointing to the volume called <name> as daughter of the volume called ...
void SetNsegments(Int_t nseg)
Set number of segments for approximating circles in drawing.
void SetMaxThreads(Int_t nthreads)
Set maximum number of threads for navigation.
void SetExplodedView(Int_t iopt=0)
Set type of exploding view (see TGeoPainter::SetExplodedView())
virtual void Edit(Option_t *option="")
Append a pad for this geometry.
Bool_t IsMatrixReflection() const
Definition: TGeoManager.h:391
void SetVisLevel(Int_t level=3)
set default level down to which visualization is performed
TGeoElementTable * fElementTable
clipping shape for raytracing
Definition: TGeoManager.h:122
TString fPath
Definition: TGeoManager.h:64
void SaveAttributes(const char *filename="tgeoatt.C")
Save current attributes in a macro.
TGeoManager & operator=(const TGeoManager &)
assignment operator
static Int_t ThreadId()
Translates the current thread id to an ordinal number.
Int_t fSizePNEId
array of phisical node entries
Definition: TGeoManager.h:131
TGeoNode * GetNextNode() const
TGeoVolume * FindVolumeFast(const char *name, Bool_t multi=kFALSE)
Fast search for a named volume. All trailing blanks stripped.
void SetClipping(Bool_t flag=kTRUE)
Definition: TGeoManager.h:209
Double_t * FindNormal(Bool_t forward=kTRUE)
Computes normal vector to the next surface that will be or was already crossed when propagating on a ...
void CdNext()
Do a cd to the node found next by FindNextBoundary.
Bool_t IsEntering() const
Int_t GetCurrentNodeId() const
Get the unique ID of the current node.
TGeoVolume * MakeCtub(const char *name, TGeoMedium *medium, Double_t rmin, Double_t rmax, Double_t dz, Double_t phi1, Double_t phi2, Double_t lx, Double_t ly, Double_t lz, Double_t tx, Double_t ty, Double_t tz)
Make in one step a volume pointing to a tube segment shape with given medium.
void BuildDefaultMaterials()
Now just a shortcut for GetElementTable.
Int_t GetMaxThreads() const
Definition: TGeoManager.h:436
TGeoPNEntry * GetAlignableEntryByUID(Int_t uid) const
Retreives an existing alignable object having a preset UID.
TObjArray * GetListOfGShapes() const
Definition: TGeoManager.h:468
#define NULL
Definition: Rtypes.h:82
void SetAnimateTracks(Bool_t flag=kTRUE)
Definition: TGeoManager.h:534
Int_t AddMaterial(const TGeoMaterial *material)
Add a material to the list. Returns index of the material in list.
Bool_t fMultiThread
Max number of threads.
Definition: TGeoManager.h:136
UChar_t * fBits
Definition: TGeoManager.h:103
void SetStartSafe(Bool_t flag=kTRUE)
Definition: TGeoManager.h:397
TString fParticleName
path to current node
Definition: TGeoManager.h:65
TObjArray * GetListOfUVolumes() const
Definition: TGeoManager.h:469
Int_t AddTransformation(const TGeoMatrix *matrix)
Add a matrix to the list. Returns index of the matrix in list.
const char * GetPath() const
Get path to the current node in the form /node0/node1/...
static Int_t GetMaxXtruVert()
Return maximum number of vertices for an xtru shape used.
void EnableInactiveVolumes()
Definition: TGeoManager.h:369
TGeoVolume * fPaintVolume
Definition: TGeoManager.h:126
unsigned char UChar_t
Definition: RtypesCore.h:34
void LocalToMasterVect(const Double_t *local, Double_t *master) const
void GetBranchOnlys(Int_t *isonly) const
Fill node copy numbers of current branch into an array.
void GetBranchNames(Int_t *names) const
Fill volume names of current branch into an array.
TObjArray * GetListOfOverlaps()
Definition: TGeoManager.h:461
TGeoParallelWorld * CreateParallelWorld(const char *name)
Create a parallel world for prioritized navigation.
Bool_t IsVisLeaves() const
Definition: TGeoManager.h:206
Bool_t IsStreamingVoxels() const
Definition: TGeoManager.h:455
TObject * At(Int_t idx) const
Definition: TObjArray.h:167
UChar_t * GetBits()
Definition: TGeoManager.h:430
void ClearNavigators()
Clear all navigators.
void UnbombTranslation(const Double_t *tr, Double_t *bombtr)
Get the new 'unbombed' translation vector according current exploded view mode.
Double_t GetStep() const
void PrintOverlaps() const
Prints the current list of overlaps.
TGeoNode * FindNextDaughterBoundary(Double_t *point, Double_t *dir, Int_t &idaughter, Bool_t compmatrix=kFALSE)
Computes as fStep the distance to next daughter of the current volume.
Int_t GetMaterialIndex(const char *matname) const
Return index of named material.
TGeoNode * GetCurrentNode() const
const Bool_t kTRUE
Definition: Rtypes.h:91
TGeoVolume * fMasterVolume
top physical node
Definition: TGeoManager.h:118
TObject * obj
static TGeoManager * Import(const char *filename, const char *name="", Option_t *option="")
static function Import a geometry from a gdml or ROOT file
void LocalToMaster(const Double_t *local, Double_t *master) const
void SetVisOption(Int_t option=0)
set drawing mode : option=0 (default) all nodes drawn down to vislevel option=1 leaves and nodes at v...
TVirtualGeoPainter * GetGeomPainter()
Make a default painter if none present. Returns pointer to it.
Bool_t IsStepEntering() const
TGeoMaterial * GetMaterial(const char *matname) const
Search for a named material. All trailing blanks stripped.
static void UnlockGeometry()
Unlock current geometry.
Bool_t GetTminTmax(Double_t &tmin, Double_t &tmax) const
Get time cut for drawing tracks.
TGeoVolume * GetCurrentVolume() const
Int_t GetNtracks() const
Definition: TGeoManager.h:372
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute mouse actions on this manager.
Bool_t InitArrayPNE() const
Initialize PNE array for fast access via index and unique-id.
Double_t GetVisDensity() const
Definition: TGeoManager.h:200
void ClearPhysicalNodes(Bool_t mustdelete=kFALSE)
Clear the current list of physical nodes, so that we can start over with a new list.
void SetNmeshPoints(Int_t npoints=1000)
Set the number of points to be generated on the shape outline when checking for overlaps.
void MasterToLocal(const Double_t *master, Double_t *local) const
static Int_t fgMaxXtruVert
Maximum number of daughters.
Definition: TGeoManager.h:53
void MasterToTop(const Double_t *master, Double_t *top) const
Convert coordinates from master volume frame to top.
TVirtualGeoTrack * GetLastTrack()
Definition: TGeoManager.h:374
void CheckBoundaryReference(Int_t icheck=-1)
Check the boundary errors reference file created by CheckBoundaryErrors method.
TGeoNode * CrossBoundaryAndLocate(Bool_t downwards, TGeoNode *skipnode)
Cross next boundary and locate within current node The current point must be on the boundary of fCurr...