Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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#include "TNamed.h"
15
16// forward declarations
17class TGeoManager;
19class TGeoVolume;
20
21class TGeoParallelWorld : public TNamed {
22protected:
23 TGeoManager *fGeoManager; // base geometry
24 TObjArray *fPaths; // array of paths
25 Bool_t fUseOverlaps; // Activated if user defined overlapping candidates
26 Bool_t fIsClosed; //! Closed flag
27 TGeoVolume *fVolume; //! helper volume
28 TGeoPhysicalNode *fLastState; //! Last PN touched
29 TObjArray *fPhysical; //! array of physical nodes
30
33
34public:
35 // constructors
37 : TNamed(),
38 fGeoManager(nullptr),
39 fPaths(nullptr),
42 fVolume(nullptr),
43 fLastState(nullptr),
44 fPhysical(nullptr)
45 {
46 }
47 TGeoParallelWorld(const char *name, TGeoManager *mgr);
48
49 // destructor
50 ~TGeoParallelWorld() override;
51 // API for adding components nodes
52 void AddNode(const char *path);
53 // Activate/deactivate overlap usage
54 void SetUseOverlaps(Bool_t flag) { fUseOverlaps = flag; }
56 void ResetOverlaps() const;
57 // Adding overlap candidates can highly improve performance.
58 void AddOverlap(TGeoVolume *vol, Bool_t activate = kTRUE);
59 void AddOverlap(const char *volname, Bool_t activate = kTRUE);
60 // The normal PW mode (without declaring overlaps) does detect them
62
63 // Closing a parallel geometry is mandatory
65 // Refresh structures in case of re-alignment
67
68 // Navigation interface
70 TGeoPhysicalNode *FindNextBoundary(Double_t point[3], Double_t dir[3], Double_t &step, Double_t stepmax = 1.E30);
71 Double_t Safety(Double_t point[3], Double_t safmax = 1.E30);
72
73 // Getters
74 TGeoManager *GetGeometry() const { return fGeoManager; }
75 Bool_t IsClosed() const { return fIsClosed; }
76 TGeoVolume *GetVolume() const { return fVolume; }
77
78 // Utilities
79 void CheckOverlaps(Double_t ovlp = 0.001); // default 10 microns
80 void Draw(Option_t *option) override;
81
82 ClassDefOverride(TGeoParallelWorld, 3) // parallel world base class
83};
84
85#endif
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
double Double_t
Definition RtypesCore.h:59
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t option
char name[80]
Definition TGX11.cxx:110
The manager class for any TGeo geometry.
Definition TGeoManager.h:44
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.
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.
~TGeoParallelWorld() override
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:43
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
An array of TObjects.
Definition TObjArray.h:31
th1 Draw()