ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 ////////////////////////////////////////////////////////////////////////////
25 // //
26 // TGeoParallelWorld - base class for a flat world that can be navigated //
27 // in parallel //
28 // //
29 ////////////////////////////////////////////////////////////////////////////
30 
31 class TGeoParallelWorld : public TNamed
32 {
33 protected :
34  TGeoManager *fGeoManager; // base geometry
35  TObjArray *fPaths; // array of paths
36  Bool_t fUseOverlaps; // Activated if user defined overlapping candidates
37  Bool_t fIsClosed; //! Closed flag
38  TGeoVolume *fVolume; //! helper volume
39  TGeoPhysicalNode *fLastState; //! Last PN touched
40  TObjArray *fPhysical; //! array of physical nodes
41 
44 
45 public:
46  // constructors
48  TGeoParallelWorld(const char *name, TGeoManager *mgr);
49 
50  // destructor
51  virtual ~TGeoParallelWorld();
52  // API for adding components nodes
53  void AddNode(const char *path);
54  // Activate/deactivate overlap usage
55  void SetUseOverlaps(Bool_t flag) {fUseOverlaps = flag;}
57  void ResetOverlaps() const;
58  // Adding overlap candidates can highly improve performance.
59  void AddOverlap(TGeoVolume *vol, Bool_t activate=kTRUE);
60  void AddOverlap(const char *volname, Bool_t activate=kTRUE);
61  // The normal PW mode (without declaring overlaps) does detect them
63 
64  // Closing a parallel geometry is mandatory
66  // Refresh structures in case of re-alignment
67  void RefreshPhysicalNodes();
68 
69  // Navigation interface
71  TGeoPhysicalNode *FindNextBoundary(Double_t point[3], Double_t dir[3], Double_t &step, Double_t stepmax=1.E30);
72  Double_t Safety(Double_t point[3], Double_t safmax=1.E30);
73 
74  // Getters
75  TGeoManager *GetGeometry() const {return fGeoManager;}
76  Bool_t IsClosed() const {return fIsClosed;}
77  TGeoVolume *GetVolume() const {return fVolume;}
78 
79  // Utilities
80  void CheckOverlaps(Double_t ovlp=0.001); // default 10 microns
81  void Draw(Option_t *option);
82 
83  ClassDef(TGeoParallelWorld, 3) // parallel world base clas
84 };
85 
86 #endif
87 
Bool_t IsUsingOverlaps() const
An array of TObjects.
Definition: TObjArray.h:39
virtual ~TGeoParallelWorld()
Destructor.
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
TGeoManager * GetGeometry() const
void AddNode(const char *path)
Add a node normally to this world. Overlapping nodes not allowed.
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
Bool_t IsClosed() const
const Bool_t kFALSE
Definition: Rtypes.h:92
TGeoPhysicalNode * FindNode(Double_t point[3])
Finds physical node containing the point.
#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...
TGeoVolume * GetVolume() const
void CheckOverlaps(Double_t ovlp=0.001)
Check overlaps within a tolerance value.
void Draw(Option_t *option)
Draw the parallel world.
void ResetOverlaps() const
Reset overlapflag for all volumes in geometry.
void SetUseOverlaps(Bool_t flag)
Int_t PrintDetectedOverlaps() const
Print the overlaps which were detected during real tracking.
void RefreshPhysicalNodes()
Refresh the node pointers and re-voxelize.
TObjArray * fPhysical
Last PN touched.
TGeoManager * fGeoManager
double Double_t
Definition: RtypesCore.h:55
void dir(char *path=0)
Definition: rootalias.C:30
Bool_t CloseGeometry()
The main geometry must be closed.
TGeoParallelWorld & operator=(const TGeoParallelWorld &)
#define name(a, b)
Definition: linkTestLib0.cpp:5
const Bool_t kTRUE
Definition: Rtypes.h:91
TGeoPhysicalNode * fLastState
helper volume