Logo ROOT   6.10/09
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
18 class TGeoManager;
19 class TGeoPhysicalNode;
20 class TGeoVolume;
21 
22 class TGeoParallelWorld : public TNamed
23 {
24 protected :
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 
36 public:
37  // constructors
38  TGeoParallelWorld() : TNamed(),fGeoManager(0),fPaths(0),fUseOverlaps(kFALSE),fIsClosed(kFALSE),fVolume(0),fLastState(0),fPhysical(0) {}
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
58  void RefreshPhysicalNodes();
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
66  TGeoManager *GetGeometry() const {return fGeoManager;}
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 
An array of TObjects.
Definition: TObjArray.h:37
virtual ~TGeoParallelWorld()
Destructor.
The manager class for any TGeo geometry.
Definition: TGeoManager.h:37
Double_t Safety(Double_t point[3], Double_t safmax=1.E30)
Compute safety for the parallel world.
const char Option_t
Definition: RtypesCore.h:62
void AddNode(const char *path)
Add a node normally to this world. Overlapping nodes not allowed.
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition: TGeoVolume.h:48
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.
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
TGeoPhysicalNode * FindNode(Double_t point[3])
Finds physical node containing the point.
Int_t PrintDetectedOverlaps() const
Print the overlaps which were detected during real tracking.
Bool_t IsUsingOverlaps() const
#define ClassDef(name, id)
Definition: Rtypes.h:297
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
TGeoVolume * fVolume
Closed flag.
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 CheckOverlaps(Double_t ovlp=0.001)
Check overlaps within a tolerance value.
void Draw(Option_t *option)
Draw the parallel world.
Physical nodes are the actual 'touchable' objects in the geometry, representing a path of positioned ...
void SetUseOverlaps(Bool_t flag)
void RefreshPhysicalNodes()
Refresh the node pointers and re-voxelize.
TObjArray * fPhysical
Last PN touched.
TGeoManager * fGeoManager
const Bool_t kFALSE
Definition: RtypesCore.h:92
Bool_t IsClosed() const
double Double_t
Definition: RtypesCore.h:55
Bool_t CloseGeometry()
The main geometry must be closed.
TGeoParallelWorld & operator=(const TGeoParallelWorld &)
TGeoVolume * GetVolume() const
Base class for a flat parallel geometry.
const Bool_t kTRUE
Definition: RtypesCore.h:91
void ResetOverlaps() const
Reset overlapflag for all volumes in geometry.
TGeoManager * GetGeometry() const
TGeoPhysicalNode * fLastState
helper volume