G4Root Version 6.6
|
GEANT4 navigator using directly a TGeo geometry. More...
#include <TG4RootNavigator.h>
Public Member Functions | |
TG4RootNavigator () | |
TG4RootNavigator (TG4RootDetectorConstruction *dc) | |
virtual | ~TG4RootNavigator () |
void | SetDetectorConstruction (TG4RootDetectorConstruction *dc) |
G4NavigationHistory * | GetHistory () |
Return the navigation history. | |
virtual G4double | ComputeStep (const G4ThreeVector &pGlobalPoint, const G4ThreeVector &pDirection, const G4double pCurrentProposedStepLength, G4double &pNewSafety) |
virtual G4VPhysicalVolume * | ResetHierarchyAndLocate (const G4ThreeVector &point, const G4ThreeVector &direction, const G4TouchableHistory &h) |
virtual G4VPhysicalVolume * | LocateGlobalPointAndSetup (const G4ThreeVector &point, const G4ThreeVector *direction=0, const G4bool pRelativeSearch=true, const G4bool ignoreDirection=true) |
virtual void | LocateGlobalPointWithinVolume (const G4ThreeVector &position) |
virtual G4double | ComputeSafety (const G4ThreeVector &globalpoint, const G4double pProposedMaxLength) |
virtual G4double | ComputeSafety (const G4ThreeVector &globalpoint, const G4double pProposedMaxLength, const G4bool keepState) |
virtual G4TouchableHandle | CreateTouchableHistoryHandle () const |
virtual G4ThreeVector | GetLocalExitNormal (G4bool *valid) |
virtual G4ThreeVector | GetGlobalExitNormal (const G4ThreeVector &point, G4bool *valid) |
void | SetG4TrackingManager (G4TrackingManager *trackingManager) |
Set current G4TrackingManager. | |
void | SetGeometryRestoreFunction (std::function< Bool_t(Int_t)> restoreGeoStateFunction) |
Protected Attributes | |
TGeoManager * | fGeometry |
TGeo geometry manager. | |
TGeoNavigator * | fNavigator |
TGeo navigator. | |
TG4RootDetectorConstruction * | fDetConstruction |
Bool_t | fStepEntering |
Next step is entering daughter. | |
Bool_t | fStepExiting |
Next step is exiting current volume. | |
G4ThreeVector | fNextPoint |
Crossing point with next boundary. | |
G4ThreeVector | fSafetyOrig |
Last computed safety origin. | |
G4double | fLastSafety |
Last computed safety. | |
Int_t | fNzeroSteps |
Number of zero steps in ComputeStep. | |
G4TrackingManager * | fG4TrackingManager |
Store pointer to G4TrackingManager. | |
std::function< Bool_t(Int_t)> | fRestoreGeoStateFunction |
Private Member Functions | |
G4VPhysicalVolume * | SynchronizeHistory () |
TGeoNode * | SynchronizeGeoManager () |
GEANT4 navigator using directly a TGeo geometry.
All navigation methods requred by G4 tracking are implemented by this class by invoking the corresponding functionality of ROOT geometry modeler.
Definition at line 40 of file TG4RootNavigator.h.
TG4RootNavigator::TG4RootNavigator | ( | ) |
Dummy ctor.
Definition at line 35 of file TG4RootNavigator.cxx.
TG4RootNavigator::TG4RootNavigator | ( | TG4RootDetectorConstruction * | dc | ) |
Default ctor.
Definition at line 53 of file TG4RootNavigator.cxx.
|
virtual |
Destructor.
Definition at line 74 of file TG4RootNavigator.cxx.
|
private |
Synchronize the current navigation history according the state of TGeoManager Do the minimum possible work in case states are already (or almost) in sync. Returns current physical volume
Definition at line 299 of file TG4RootNavigator.cxx.
Referenced by LocateGlobalPointAndSetup(), and ResetHierarchyAndLocate().
|
private |
Synchronize the current state of TGeoManager with the current navigation history. Do the minimum possible work in case states are already (or almost) in sync. Returns current logical node.
Definition at line 248 of file TG4RootNavigator.cxx.
Referenced by ResetHierarchyAndLocate().
void TG4RootNavigator::SetDetectorConstruction | ( | TG4RootDetectorConstruction * | dc | ) |
Setter for detector construction. Root geometry manager pointer is taken from it and must be valid.
Definition at line 80 of file TG4RootNavigator.cxx.
Referenced by TG4RootDetectorConstruction::Construct(), and TG4RootNavigator().
|
inline |
Return the navigation history.
Definition at line 70 of file TG4RootNavigator.h.
Referenced by TG4RootNavMgr::PrintG4State().
|
virtual |
Calculate the distance to the next boundary intersected along the specified NORMALISED vector direction and from the specified point in the global coordinate system. LocateGlobalPointAndSetup or LocateGlobalPointWithinVolume must have been called with the same global point prior to this call. The isotropic distance to the nearest boundary is also calculated (usually an underestimate). The current proposed Step length is used to avoid intersection calculations: if it can be determined that the nearest boundary is >pCurrentProposedStepLength away, kInfinity is returned together with the computed isotropic safety distance. Geometry must be closed.
Definition at line 97 of file TG4RootNavigator.cxx.
|
virtual |
Resets the geometrical hierarchy and search for the volumes deepest in the hierarchy containing the point in the global coordinate space. The direction is used to check if a volume is entered. The search begin is the geometrical hierarchy at the location of the last located point, or the endpoint of the previous Step if SetGeometricallyLimitedStep() has been called immediately before.
Important Note: In order to call this the geometry MUST be closed.
In case of TGeo-based geometry all volumes look as normal positioned, so there is no need to reset the hierarchy. The state of TGeo needs however to be synchronized.
Definition at line 213 of file TG4RootNavigator.cxx.
|
virtual |
Locate the point in the hierarchy return 0 if outside The direction is required
Flags on exit: (comments to be completed) fEntering - True if entering ‘daughter’ volume (or replica) whether daughter of last mother directly or daughter of that volume's ancestor.
Definition at line 342 of file TG4RootNavigator.cxx.
Referenced by TG4RootNavMgr::LocateGlobalPointAndSetup().
|
virtual |
Notify the Navigator that a track has moved to the new Global point 'position', that is known to be within the current safety. No check is performed to ensure that it is within the volume. This method can be called instead of LocateGlobalPointAndSetup ONLY if the caller is certain that the new global point (position) is inside the same volume as the previous position. Usually this can be guaranteed only if the point is within safety. fLastLocatedPointLocal = ComputeLocalPoint(pGlobalPoint); G4cout << "LocateGlobalPointWithinVolume: POINT: " << pGlobalPoint << G4endl;
Definition at line 433 of file TG4RootNavigator.cxx.
|
virtual |
Calculate the isotropic distance to the nearest boundary from the specified point in the global coordinate system. The globalpoint utilised must be within the current volume. The value returned is usually an underestimate. The proposed maximum length is used to avoid volume safety calculations. The geometry must be closed.
TO CHANGE TGeoManager::Safety To take into account pProposedMaxLength fEnteredDaughter = kFALSE; fExitedMother = kFALSE; fStepEntering = kFALSE; fStepExiting = kFALSE;
Definition at line 468 of file TG4RootNavigator.cxx.
Referenced by ComputeSafety().
|
virtual |
Compute safety and keep state on demand.
Definition at line 459 of file TG4RootNavigator.cxx.
|
virtual |
Returns a reference counted handle to a touchable history.
Definition at line 515 of file TG4RootNavigator.cxx.
|
virtual |
Returns Exit Surface Normal and validity too. It can only be called if the Navigator's last Step has crossed a volume geometrical boundary. It returns the Normal to the surface pointing out of the volume that was left behind and/or into the volume that was entered. (The normal is in the coordinate system of the final volume.) This function takes full care about how to calculate this normal, but if the surfaces are not convex it will return valid=false.
Definition at line 522 of file TG4RootNavigator.cxx.
|
virtual |
Definition at line 551 of file TG4RootNavigator.cxx.
void TG4RootNavigator::SetG4TrackingManager | ( | G4TrackingManager * | trackingManager | ) |
Set current G4TrackingManager.
Definition at line 583 of file TG4RootNavigator.cxx.
Referenced by TG4RootNavMgr::SetG4TrackingManager().
void TG4RootNavigator::SetGeometryRestoreFunction | ( | std::function< Bool_t(Int_t)> | restoreGeoStateFunction | ) |
Store and call the given function to request the restoring of the geometry status. Returns true if the geometry was restored, otherwise the node has to be found manually.
Definition at line 589 of file TG4RootNavigator.cxx.
Referenced by TG4RootNavMgr::SetGeometryRestoreFunction().
|
protected |
TGeo geometry manager.
Definition at line 44 of file TG4RootNavigator.h.
Referenced by SetDetectorConstruction().
|
protected |
TGeo navigator.
Definition at line 45 of file TG4RootNavigator.h.
Referenced by ComputeSafety(), ComputeStep(), GetGlobalExitNormal(), GetLocalExitNormal(), LocateGlobalPointAndSetup(), LocateGlobalPointWithinVolume(), ResetHierarchyAndLocate(), SetDetectorConstruction(), SynchronizeGeoManager(), and SynchronizeHistory().
|
protected |
G4Root detector construction
Definition at line 46 of file TG4RootNavigator.h.
Referenced by SetDetectorConstruction(), SynchronizeGeoManager(), and SynchronizeHistory().
|
protected |
Next step is entering daughter.
Definition at line 49 of file TG4RootNavigator.h.
Referenced by ComputeStep(), LocateGlobalPointAndSetup(), LocateGlobalPointWithinVolume(), and ResetHierarchyAndLocate().
|
protected |
Next step is exiting current volume.
Definition at line 50 of file TG4RootNavigator.h.
Referenced by ComputeStep(), LocateGlobalPointAndSetup(), LocateGlobalPointWithinVolume(), and ResetHierarchyAndLocate().
|
protected |
Crossing point with next boundary.
Definition at line 51 of file TG4RootNavigator.h.
Referenced by ComputeSafety(), ComputeStep(), and LocateGlobalPointAndSetup().
|
protected |
Last computed safety origin.
Definition at line 52 of file TG4RootNavigator.h.
Referenced by ComputeSafety(), ComputeStep(), and TG4RootNavigator().
|
protected |
Last computed safety.
Definition at line 53 of file TG4RootNavigator.h.
Referenced by ComputeSafety(), and ComputeStep().
|
protected |
Number of zero steps in ComputeStep.
Definition at line 54 of file TG4RootNavigator.h.
Referenced by ComputeStep().
|
protected |
Store pointer to G4TrackingManager.
Definition at line 55 of file TG4RootNavigator.h.
Referenced by LocateGlobalPointAndSetup(), and SetG4TrackingManager().
|
protected |
Function pointer to restore geometry
Definition at line 56 of file TG4RootNavigator.h.
Referenced by LocateGlobalPointAndSetup(), and SetGeometryRestoreFunction().