Logo ROOT  
Reference Guide
TGeoParallelWorld.h
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
3 * All rights reserved. *
4 * *
5 * For the licensing terms see $ROOTSYS/LICENSE. *
6 * For the list of contributors see $ROOTSYS/README/CREDITS. *
7 *************************************************************************/
8
9// Author: Andrei Gheata 30/06/14
10
11#ifndef ROOT_TGeoParallelWorld
12#define ROOT_TGeoParallelWorld
13
14
15#include "TGeoVolume.h"
16
17// forward declarations
18class TGeoManager;
20class TGeoVolume;
21
23{
24protected :
25 TGeoManager *fGeoManager; // base geometry
26 TObjArray *fPaths; // array of paths
27 Bool_t fUseOverlaps; // Activated if user defined overlapping candidates
28 Bool_t fIsClosed; //! Closed flag
29 TGeoVolume *fVolume; //! helper volume
30 TGeoPhysicalNode *fLastState; //! Last PN touched
31 TObjArray *fPhysical; //! array of physical nodes
32
35
36public:
37 // constructors
39 TGeoParallelWorld(const char *name, TGeoManager *mgr);
40
41 // destructor
42 virtual ~TGeoParallelWorld();
43 // API for adding components nodes
44 void AddNode(const char *path);
45 // Activate/deactivate overlap usage
46 void SetUseOverlaps(Bool_t flag) {fUseOverlaps = flag;}
48 void ResetOverlaps() const;
49 // Adding overlap candidates can highly improve performance.
50 void AddOverlap(TGeoVolume *vol, Bool_t activate=kTRUE);
51 void AddOverlap(const char *volname, Bool_t activate=kTRUE);
52 // The normal PW mode (without declaring overlaps) does detect them
54
55 // Closing a parallel geometry is mandatory
57 // Refresh structures in case of re-alignment
59
60 // Navigation interface
62 TGeoPhysicalNode *FindNextBoundary(Double_t point[3], Double_t dir[3], Double_t &step, Double_t stepmax=1.E30);
63 Double_t Safety(Double_t point[3], Double_t safmax=1.E30);
64
65 // Getters
67 Bool_t IsClosed() const {return fIsClosed;}
68 TGeoVolume *GetVolume() const {return fVolume;}
69
70 // Utilities
71 void CheckOverlaps(Double_t ovlp=0.001); // default 10 microns
72 void Draw(Option_t *option);
73
74 ClassDef(TGeoParallelWorld, 3) // parallel world base class
75};
76
77#endif
78
int Int_t
Definition: RtypesCore.h:43
const Bool_t kFALSE
Definition: RtypesCore.h:90
bool Bool_t
Definition: RtypesCore.h:61
double Double_t
Definition: RtypesCore.h:57
const Bool_t kTRUE
Definition: RtypesCore.h:89
const char Option_t
Definition: RtypesCore.h:64
#define ClassDef(name, id)
Definition: Rtypes.h:322
char name[80]
Definition: TGX11.cxx:109
The manager class for any TGeo geometry.
Definition: TGeoManager.h:43
Base class for a flat parallel geometry.
TGeoManager * fGeoManager
void SetUseOverlaps(Bool_t flag)
Double_t Safety(Double_t point[3], Double_t safmax=1.E30)
Compute safety for the parallel world.
TObjArray * fPhysical
Last PN touched.
TGeoVolume * GetVolume() const
Bool_t CloseGeometry()
The main geometry must be closed.
void AddNode(const char *path)
Add a node normally to this world. Overlapping nodes not allowed.
void Draw(Option_t *option)
Draw the parallel world.
TGeoPhysicalNode * FindNextBoundary(Double_t point[3], Double_t dir[3], Double_t &step, Double_t stepmax=1.E30)
Same functionality as TGeoNavigator::FindNextDaughterBoundary for the parallel world.
void ResetOverlaps() const
Reset overlapflag for all volumes in geometry.
TGeoManager * GetGeometry() const
Bool_t IsUsingOverlaps() const
TGeoPhysicalNode * FindNode(Double_t point[3])
Finds physical node containing the point.
virtual ~TGeoParallelWorld()
Destructor.
TGeoVolume * fVolume
Closed flag.
Int_t PrintDetectedOverlaps() const
Print the overlaps which were detected during real tracking.
void CheckOverlaps(Double_t ovlp=0.001)
Check overlaps within a tolerance value.
TGeoPhysicalNode * fLastState
helper volume
void AddOverlap(TGeoVolume *vol, Bool_t activate=kTRUE)
To use this optimization, the user should declare the full list of volumes which may overlap with any...
void RefreshPhysicalNodes()
Refresh the node pointers and re-voxelize.
TGeoParallelWorld & operator=(const TGeoParallelWorld &)=delete
TGeoParallelWorld(const TGeoParallelWorld &)=delete
array of physical nodes
Bool_t IsClosed() const
Physical nodes are the actual 'touchable' objects in the geometry, representing a path of positioned ...
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition: TGeoVolume.h:47
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
An array of TObjects.
Definition: TObjArray.h:37