G4Root
Version 6.8
Toggle main menu visibility
Loading...
Searching...
No Matches
g4root
include
TG4RootNavigator.h
Go to the documentation of this file.
1
// @(#)root/g4root:$Id$
2
// Author: Andrei Gheata 07/08/06
3
4
/*************************************************************************
5
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6
* All rights reserved. *
7
* *
8
* For the licensing terms see $ROOTSYS/LICENSE. *
9
* For the list of contributors see $ROOTSYS/README/CREDITS. *
10
*************************************************************************/
11
16
17
#ifndef ROOT_TG4RootNavigator
18
#define ROOT_TG4RootNavigator
19
20
#include <functional>
21
22
#include "G4Navigator.hh"
23
24
#include <Rtypes.h>
25
26
class
TGeoManager;
27
class
TGeoNavigator;
28
class
TGeoNode;
29
class
TG4RootDetectorConstruction
;
30
class
G4TrackingManager;
31
39
40
class
TG4RootNavigator
:
public
G4Navigator
41
{
42
43
protected
:
44
TGeoManager*
fGeometry
;
45
TGeoNavigator*
fNavigator
;
46
TG4RootDetectorConstruction
*
fDetConstruction
;
48
49
Bool_t
fStepEntering
;
50
Bool_t
fStepExiting
;
51
G4ThreeVector
fNextPoint
;
52
G4ThreeVector
fSafetyOrig
;
53
G4double
fLastSafety
;
54
Int_t
fNzeroSteps
;
55
G4TrackingManager*
fG4TrackingManager
;
56
std::function<Bool_t(Int_t)>
fRestoreGeoStateFunction
;
58
private
:
59
G4VPhysicalVolume*
SynchronizeHistory
();
60
TGeoNode*
SynchronizeGeoManager
();
61
62
public
:
63
TG4RootNavigator
();
64
TG4RootNavigator
(
TG4RootDetectorConstruction
* dc);
65
virtual
~TG4RootNavigator
();
66
67
void
SetDetectorConstruction
(
TG4RootDetectorConstruction
* dc);
68
70
G4NavigationHistory*
GetHistory
() {
return
&fHistory; }
71
72
// Virtual methods for navigation
73
virtual
G4double
ComputeStep
(
const
G4ThreeVector& pGlobalPoint,
74
const
G4ThreeVector& pDirection,
const
G4double pCurrentProposedStepLength,
75
G4double& pNewSafety);
76
virtual
G4VPhysicalVolume*
ResetHierarchyAndLocate
(
const
G4ThreeVector& point,
77
const
G4ThreeVector& direction,
const
G4TouchableHistory& h);
78
virtual
G4VPhysicalVolume*
LocateGlobalPointAndSetup
(
79
const
G4ThreeVector& point,
const
G4ThreeVector* direction = 0,
80
const
G4bool pRelativeSearch =
true
,
const
G4bool ignoreDirection =
true
);
81
virtual
void
LocateGlobalPointWithinVolume
(
const
G4ThreeVector& position);
82
// virtual void LocateGlobalPointAndUpdateTouchableHandle(
83
// const G4ThreeVector& position,
84
// const G4ThreeVector& direction,
85
// G4TouchableHandle& oldTouchableToUpdate,
86
// const G4bool RelativeSearch = true);
87
virtual
G4double
ComputeSafety
(
88
const
G4ThreeVector& globalpoint,
const
G4double pProposedMaxLength);
89
virtual
G4double
ComputeSafety
(
const
G4ThreeVector& globalpoint,
90
const
G4double pProposedMaxLength,
const
G4bool keepState);
91
virtual
G4TouchableHandle
CreateTouchableHistoryHandle
()
const
;
92
virtual
G4ThreeVector
GetLocalExitNormal
(G4bool* valid);
93
virtual
G4ThreeVector
GetGlobalExitNormal
(
94
const
G4ThreeVector& point, G4bool* valid);
95
// Return Exit Surface Normal and validity too.
96
// Can only be called if the Navigator's last Step has crossed a
97
// volume geometrical boundary.
98
// It returns the Normal to the surface pointing out of the volume that
99
// was left behind and/or into the volume that was entered.
100
// Convention:
101
// The *local* normal is in the coordinate system of the *final* volume.
102
// Restriction:
103
// Normals are not available for replica volumes (returns valid= false)
104
// These methods takes full care about how to calculate this normal,
105
// but if the surfaces are not convex it will return valid=false.
106
108
void
SetG4TrackingManager
(G4TrackingManager* trackingManager);
109
113
void
SetGeometryRestoreFunction
(
114
std::function<Bool_t(Int_t)> restoreGeoStateFunction);
115
116
// ClassDef(TG4RootNavigator,0) // Class defining a G4Navigator based on
117
// ROOT geometry
118
};
119
#endif
G4Navigator
TG4RootDetectorConstruction
Builder creating a pseudo G4 geometry starting from a TGeo geometry.
Definition
TG4RootDetectorConstruction.h:58
TG4RootNavigator::~TG4RootNavigator
virtual ~TG4RootNavigator()
Definition
TG4RootNavigator.cxx:74
TG4RootNavigator::SynchronizeHistory
G4VPhysicalVolume * SynchronizeHistory()
Definition
TG4RootNavigator.cxx:299
TG4RootNavigator::fLastSafety
G4double fLastSafety
Last computed safety.
Definition
TG4RootNavigator.h:53
TG4RootNavigator::SetG4TrackingManager
void SetG4TrackingManager(G4TrackingManager *trackingManager)
Set current G4TrackingManager.
Definition
TG4RootNavigator.cxx:583
TG4RootNavigator::ComputeSafety
virtual G4double ComputeSafety(const G4ThreeVector &globalpoint, const G4double pProposedMaxLength)
Definition
TG4RootNavigator.cxx:468
TG4RootNavigator::fDetConstruction
TG4RootDetectorConstruction * fDetConstruction
Definition
TG4RootNavigator.h:46
TG4RootNavigator::GetLocalExitNormal
virtual G4ThreeVector GetLocalExitNormal(G4bool *valid)
Definition
TG4RootNavigator.cxx:522
TG4RootNavigator::LocateGlobalPointWithinVolume
virtual void LocateGlobalPointWithinVolume(const G4ThreeVector &position)
TG4RootNavigator::CreateTouchableHistoryHandle
virtual G4TouchableHandle CreateTouchableHistoryHandle() const
Definition
TG4RootNavigator.cxx:515
TG4RootNavigator::GetHistory
G4NavigationHistory * GetHistory()
Return the navigation history.
Definition
TG4RootNavigator.h:70
TG4RootNavigator::SynchronizeGeoManager
TGeoNode * SynchronizeGeoManager()
Definition
TG4RootNavigator.cxx:248
TG4RootNavigator::fGeometry
TGeoManager * fGeometry
TGeo geometry manager.
Definition
TG4RootNavigator.h:44
TG4RootNavigator::fNavigator
TGeoNavigator * fNavigator
TGeo navigator.
Definition
TG4RootNavigator.h:45
TG4RootNavigator::TG4RootNavigator
TG4RootNavigator()
Definition
TG4RootNavigator.cxx:35
TG4RootNavigator::SetGeometryRestoreFunction
void SetGeometryRestoreFunction(std::function< Bool_t(Int_t)> restoreGeoStateFunction)
Definition
TG4RootNavigator.cxx:589
TG4RootNavigator::fNzeroSteps
Int_t fNzeroSteps
Number of zero steps in ComputeStep.
Definition
TG4RootNavigator.h:54
TG4RootNavigator::GetGlobalExitNormal
virtual G4ThreeVector GetGlobalExitNormal(const G4ThreeVector &point, G4bool *valid)
Definition
TG4RootNavigator.cxx:551
TG4RootNavigator::ResetHierarchyAndLocate
virtual G4VPhysicalVolume * ResetHierarchyAndLocate(const G4ThreeVector &point, const G4ThreeVector &direction, const G4TouchableHistory &h)
Definition
TG4RootNavigator.cxx:213
TG4RootNavigator::fNextPoint
G4ThreeVector fNextPoint
Crossing point with next boundary.
Definition
TG4RootNavigator.h:51
TG4RootNavigator::fSafetyOrig
G4ThreeVector fSafetyOrig
Last computed safety origin.
Definition
TG4RootNavigator.h:52
TG4RootNavigator::LocateGlobalPointAndSetup
virtual G4VPhysicalVolume * LocateGlobalPointAndSetup(const G4ThreeVector &point, const G4ThreeVector *direction=0, const G4bool pRelativeSearch=true, const G4bool ignoreDirection=true)
Definition
TG4RootNavigator.cxx:342
TG4RootNavigator::fG4TrackingManager
G4TrackingManager * fG4TrackingManager
Store pointer to G4TrackingManager.
Definition
TG4RootNavigator.h:55
TG4RootNavigator::fRestoreGeoStateFunction
std::function< Bool_t(Int_t)> fRestoreGeoStateFunction
Definition
TG4RootNavigator.h:56
TG4RootNavigator::ComputeStep
virtual G4double ComputeStep(const G4ThreeVector &pGlobalPoint, const G4ThreeVector &pDirection, const G4double pCurrentProposedStepLength, G4double &pNewSafety)
Definition
TG4RootNavigator.cxx:97
TG4RootNavigator::fStepExiting
Bool_t fStepExiting
Next step is exiting current volume.
Definition
TG4RootNavigator.h:50
TG4RootNavigator::SetDetectorConstruction
void SetDetectorConstruction(TG4RootDetectorConstruction *dc)
Definition
TG4RootNavigator.cxx:80
TG4RootNavigator::fStepEntering
Bool_t fStepEntering
Next step is entering daughter.
Definition
TG4RootNavigator.h:49
Generated on
for G4Root by
1.17.0