Logo ROOT   6.08/07
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 #ifndef ROOT_TGeoVolume
16 #include "TGeoVolume.h"
17 #endif
18 
19 // forward declarations
20 class TGeoManager;
21 class TGeoPhysicalNode;
22 class TGeoVolume;
23 
24 class TGeoParallelWorld : public TNamed
25 {
26 protected :
27  TGeoManager *fGeoManager; // base geometry
28  TObjArray *fPaths; // array of paths
29  Bool_t fUseOverlaps; // Activated if user defined overlapping candidates
30  Bool_t fIsClosed; //! Closed flag
31  TGeoVolume *fVolume; //! helper volume
32  TGeoPhysicalNode *fLastState; //! Last PN touched
33  TObjArray *fPhysical; //! array of physical nodes
34 
37 
38 public:
39  // constructors
40  TGeoParallelWorld() : TNamed(),fGeoManager(0),fPaths(0),fUseOverlaps(kFALSE),fIsClosed(kFALSE),fVolume(0),fLastState(0),fPhysical(0) {}
41  TGeoParallelWorld(const char *name, TGeoManager *mgr);
42 
43  // destructor
44  virtual ~TGeoParallelWorld();
45  // API for adding components nodes
46  void AddNode(const char *path);
47  // Activate/deactivate overlap usage
48  void SetUseOverlaps(Bool_t flag) {fUseOverlaps = flag;}
50  void ResetOverlaps() const;
51  // Adding overlap candidates can highly improve performance.
52  void AddOverlap(TGeoVolume *vol, Bool_t activate=kTRUE);
53  void AddOverlap(const char *volname, Bool_t activate=kTRUE);
54  // The normal PW mode (without declaring overlaps) does detect them
56 
57  // Closing a parallel geometry is mandatory
59  // Refresh structures in case of re-alignment
60  void RefreshPhysicalNodes();
61 
62  // Navigation interface
64  TGeoPhysicalNode *FindNextBoundary(Double_t point[3], Double_t dir[3], Double_t &step, Double_t stepmax=1.E30);
65  Double_t Safety(Double_t point[3], Double_t safmax=1.E30);
66 
67  // Getters
68  TGeoManager *GetGeometry() const {return fGeoManager;}
69  Bool_t IsClosed() const {return fIsClosed;}
70  TGeoVolume *GetVolume() const {return fVolume;}
71 
72  // Utilities
73  void CheckOverlaps(Double_t ovlp=0.001); // default 10 microns
74  void Draw(Option_t *option);
75 
76  ClassDef(TGeoParallelWorld, 3) // parallel world base class
77 };
78 
79 #endif
80 
An array of TObjects.
Definition: TObjArray.h:39
virtual ~TGeoParallelWorld()
Destructor.
The manager class for any TGeo geometry.
Definition: TGeoManager.h:38
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:61
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
const Bool_t kFALSE
Definition: Rtypes.h:92
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:254
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
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
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
const Bool_t kTRUE
Definition: Rtypes.h:91
Base class for a flat parallel geometry.
void ResetOverlaps() const
Reset overlapflag for all volumes in geometry.
TGeoManager * GetGeometry() const
char name[80]
Definition: TGX11.cxx:109
TGeoPhysicalNode * fLastState
helper volume