48 fPhysical(new TObjArray(256))
67 if (
fIsClosed)
Fatal(
"AddNode",
"Cannot add nodes to a closed parallel geometry");
69 Error(
"AddNode",
"Path %s not valid.\nCannot add to parallel world!", path);
110 if (vol->IsOverlappingCandidate()) {
111 if (noverlaps==0)
Info(
"PrintDetectedOverlaps",
"List of detected volumes overlapping with the PW");
113 printf(
"volume: %s at index: %d\n", vol->GetName(), vol->GetNumber());
137 Error(
"CloseGeometry",
"List of paths is empty");
146 while ((vol=(
TGeoVolume*)next()))
if (vol->IsOverlappingCandidate()) novlp++;
147 Info(
"CloseGeometry",
"Number of declared overlaps: %d", novlp);
148 if (
fUseOverlaps)
Info(
"CloseGeometry",
"Parallel world will use declared overlaps");
149 else Info(
"CloseGeometry",
"Parallel world will detect overlaps with other volumes");
184 if (!
fIsClosed)
Fatal(
"FindNode",
"Parallel geometry must be closed first");
196 if (!check_list)
return 0;
200 for (
id=0;
id<ncheck;
id++) {
219 if (!
fIsClosed)
Fatal(
"FindNextBoundary",
"Parallel geometry must be closed first");
234 Int_t idaughter = -1;
242 for (i=0; i<nd; i++) {
245 if (voxels->
IsSafeVoxel(point, i, stepmax))
continue;
263 Int_t sumchecked = 0;
270 while ((sumchecked<nd) && (vlist=voxels->
GetNextVoxel(point, dir, ncheck, info))) {
271 for (i=0; i<ncheck; i++) {
281 if (snext < step - 1.
E-8) {
283 idaughter = vlist[i];
320 for (
Int_t id=0;
id<nd;
id++) {
324 if (dxyz0 > safe)
continue;
326 if (dxyz1 > safe)
continue;
328 if (dxyz2 > safe)
continue;
329 if (dxyz0>0) dxyz+=dxyz0*dxyz0;
330 if (dxyz1>0) dxyz+=dxyz1*dxyz1;
331 if (dxyz2>0) dxyz+=dxyz2*dxyz2;
332 if (dxyz >= safe*safe)
continue;
340 if (safnext < tolerance)
return 0.;
341 if (safnext < safe) safe = safnext;
Statefull info for the current geometry level.
virtual const char * GetName() const
Returns name of object.
virtual ~TGeoParallelWorld()
Destructor.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
The manager class for any TGeo geometry.
#define snext(osub1, osub2)
void Voxelize(Option_t *option)
build the voxels for this volume
Double_t Safety(Double_t point[3], Double_t safmax=1.E30)
Compute safety for the parallel world.
Collectable string class.
virtual void Delete(Option_t *option="")
Remove all objects from the array AND delete all heap based objects.
virtual Int_t * GetCheckList(const Double_t *point, Int_t &nelem, TGeoStateInfo &td)
get the list of daughter indices for which point is inside their bbox
void AddNode(const char *path)
Add a node normally to this world. Overlapping nodes not allowed.
TGeoNode * GetNode(const char *name) const
get the pointer to a daughter node
virtual void MasterToLocalVect(const Double_t *master, Double_t *local) const
Convert a vector from mother reference to local reference system.
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
virtual void Draw(Option_t *option="")
draw top volume according to option
virtual TObject * Remove(TObject *obj)
Remove object from array.
Matrix class used for computing global transformations Should NOT be used for node definition...
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.
TGeoNodeCache * GetCache() const
TGeoStateInfo * GetMakePWInfo(Int_t nd)
Get the PW info, if none create one.
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.
TObject * At(Int_t idx) const
virtual void SortCrossedVoxels(const Double_t *point, const Double_t *dir, TGeoStateInfo &td)
get the list in the next voxel crossed by a ray
TGeoVoxelFinder * GetVoxels() const
Getter for optimization structure.
virtual Int_t * GetNextVoxel(const Double_t *point, const Double_t *dir, Int_t &ncheck, TGeoStateInfo &td)
get the list of new candidates for the next voxel crossed by current ray printf("### GetNextVoxel\n")...
static Double_t Tolerance()
Int_t GetNdaughters() const
The TNamed class is the base class for all named ROOT classes.
TGeoVolume * fVolume
Closed flag.
TGeoVolume * GetCurrentVolume() const
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...
Special pool of reusable nodes.
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 ...
virtual void AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=0, Option_t *option="")
Add a TGeoNode to the list of nodes.
const char * GetName() const
Returns name of object.
Double_t * GetBoxes() const
void RefreshPhysicalNodes()
Refresh the node pointers and re-voxelize.
Int_t GetEntriesFast() const
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Bool_t CheckPath(const char *path) const
Check if a geometry path is valid without changing the state of the current navigator.
void CheckOverlaps(Double_t ovlp=0.1, Option_t *option="") const
Overlap checking tool.
TObjArray * fPhysical
Last PN touched.
Bool_t IsSafeVoxel(const Double_t *point, Int_t inode, Double_t minsafe) const
Computes squared distance from POINT to the voxel(s) containing node INODE.
virtual void AddAt(TObject *obj, Int_t idx)
Add object at position ids.
virtual Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=0) const =0
TGeoManager * fGeoManager
Bool_t Contains(const Double_t *point) const
virtual void MasterToLocal(const Double_t *master, Double_t *local) const
Convert the point coordinates from mother reference to local reference system.
Bool_t CloseGeometry()
The main geometry must be closed.
Finder class handling voxels.
virtual void ComputeBBox()=0
Class providing navigation API for TGeo geometries.
A node represent a volume positioned inside another.They store links to both volumes and to the TGeoM...
TGeoNavigator * GetCurrentNavigator() const
Returns current navigator for the calling thread.
Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const
computes the closest distance from given point to this shape
TObjArray * GetListOfVolumes() const
Bool_t IsOverlappingCandidate() const
void SetOverlappingCandidate(Bool_t flag)
Bool_t IsMatchingState(TGeoNavigator *nav) const
Checks if a given navigator state matches this physical node.
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
TGeoShape * GetShape() const
Base class for a flat parallel geometry.
TGeoVolume * GetVolume() const
void ResetOverlaps() const
Reset overlapflag for all volumes in geometry.
TGeoPhysicalNode * fLastState
helper volume