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