Geant4-11
Public Member Functions | Private Member Functions | Private Attributes
G4FastTrack Class Reference

#include <G4FastTrack.hh>

Public Member Functions

 G4FastTrack (G4Envelope *anEnvelope, G4bool IsUnique)
 
const G4AffineTransformGetAffineTransformation () const
 
G4EnvelopeGetEnvelope () const
 
G4LogicalVolumeGetEnvelopeLogicalVolume () const
 
G4VPhysicalVolumeGetEnvelopePhysicalVolume () const
 
G4VSolidGetEnvelopeSolid () const
 
const G4AffineTransformGetInverseAffineTransformation () const
 
const G4TrackGetPrimaryTrack () const
 
G4ThreeVector GetPrimaryTrackLocalDirection () const
 
G4ThreeVector GetPrimaryTrackLocalMomentum () const
 
G4ThreeVector GetPrimaryTrackLocalPolarization () const
 
G4ThreeVector GetPrimaryTrackLocalPosition () const
 
G4bool OnTheBoundaryButExiting () const
 
void SetCurrentTrack (const G4Track &, const G4Navigator *a=0)
 
 ~G4FastTrack ()
 

Private Member Functions

void FRecordsAffineTransformation (const G4Navigator *)
 

Private Attributes

G4AffineTransform fAffineTransformation
 
G4bool fAffineTransformationDefined
 
G4EnvelopefEnvelope
 
G4LogicalVolumefEnvelopeLogicalVolume
 
G4VPhysicalVolumefEnvelopePhysicalVolume
 
G4VSolidfEnvelopeSolid
 
G4AffineTransform fInverseAffineTransformation
 
G4bool fIsUnique
 
G4ThreeVector fLocalTrackDirection
 
G4ThreeVector fLocalTrackMomentum
 
G4ThreeVector fLocalTrackPolarization
 
G4ThreeVector fLocalTrackPosition
 
const G4TrackfTrack
 

Detailed Description

Definition at line 76 of file G4FastTrack.hh.

Constructor & Destructor Documentation

◆ G4FastTrack()

G4FastTrack::G4FastTrack ( G4Envelope anEnvelope,
G4bool  IsUnique 
)

Definition at line 50 of file G4FastTrack.cc.

51 : fTrack ( nullptr ),
53 fEnvelope ( anEnvelope ),
54 fIsUnique ( IsUnique ),
55 fEnvelopeLogicalVolume ( nullptr ),
56 fEnvelopePhysicalVolume ( nullptr ),
57 fEnvelopeSolid ( nullptr )
58{}
G4bool fIsUnique
Definition: G4FastTrack.hh:169
G4VSolid * fEnvelopeSolid
Definition: G4FastTrack.hh:172
G4bool fAffineTransformationDefined
Definition: G4FastTrack.hh:167
G4LogicalVolume * fEnvelopeLogicalVolume
Definition: G4FastTrack.hh:170
G4VPhysicalVolume * fEnvelopePhysicalVolume
Definition: G4FastTrack.hh:171
const G4Track * fTrack
Definition: G4FastTrack.hh:160
G4Envelope * fEnvelope
Definition: G4FastTrack.hh:168

◆ ~G4FastTrack()

G4FastTrack::~G4FastTrack ( )

Definition at line 63 of file G4FastTrack.cc.

64{}

Member Function Documentation

◆ FRecordsAffineTransformation()

void G4FastTrack::FRecordsAffineTransformation ( const G4Navigator theNavigator)
private

Definition at line 111 of file G4FastTrack.cc.

112{
113
114 //--------------------------------------------------------
115 // Get the touchable history which represents the current
116 // volume hierachy the particle is in.
117 // Note that TouchableHistory allocated by the Navigator
118 // must be deleted by G4FastTrack.
119 //--------------------------------------------------------
120 const G4Navigator* NavigatorToUse;
121 if(theNavigator != 0 ) NavigatorToUse = theNavigator;
123
125
126 //-----------------------------------------------------
127 // Run accross the hierarchy to find the physical volume
128 // associated with the envelope
129 //-----------------------------------------------------
130 G4int depth = history->GetHistory()->GetDepth();
131 G4int idepth, Done = 0;
132 for (idepth = 0; idepth <= depth; idepth++)
133 {
134 G4VPhysicalVolume* currPV = history->GetHistory()->GetVolume(idepth);
135 G4LogicalVolume* currLV = currPV->GetLogicalVolume();
136 if ( (currLV->GetRegion() == fEnvelope) && (currLV->IsRootRegion()) )
137 {
139 fEnvelopeLogicalVolume = currLV;
140 fEnvelopeSolid = currLV->GetSolid();
141 Done = 1;
142 break;
143 }
144 }
145 //---------------------------------------------
146 //-- Verification: should be removed in future:
147 //---------------------------------------------
148 if ( !Done )
149 {
151 ed << "Can't find transformation for `" << fEnvelopePhysicalVolume->GetName() << "'" << G4endl;
152 G4Exception("G4FastTrack::FRecordsAffineTransformation()",
153 "FastSim011",
154 JustWarning, ed);
155 }
156 else
157 {
158 //-------------------------------------------------------
159 // Records the transformation and inverse transformation:
160 //-------------------------------------------------------
161 fAffineTransformation = history->GetHistory()->GetTransform(idepth);
163
165 }
166}
@ JustWarning
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
int G4int
Definition: G4Types.hh:85
#define G4endl
Definition: G4ios.hh:57
G4AffineTransform Inverse() const
G4AffineTransform fAffineTransformation
Definition: G4FastTrack.hh:177
G4AffineTransform fInverseAffineTransformation
Definition: G4FastTrack.hh:178
G4VSolid * GetSolid() const
G4bool IsRootRegion() const
G4Region * GetRegion() const
virtual G4TouchableHistoryHandle CreateTouchableHistoryHandle() const
static G4TransportationManager * GetTransportationManager()
G4Navigator * GetNavigatorForTracking() const
G4LogicalVolume * GetLogicalVolume() const
const G4String & GetName() const
def history()
Definition: g4zmq.py:84

References G4Navigator::CreateTouchableHistoryHandle(), fAffineTransformation, fAffineTransformationDefined, fEnvelope, fEnvelopeLogicalVolume, fEnvelopePhysicalVolume, fEnvelopeSolid, fInverseAffineTransformation, G4endl, G4Exception(), G4VPhysicalVolume::GetLogicalVolume(), G4VPhysicalVolume::GetName(), G4TransportationManager::GetNavigatorForTracking(), G4LogicalVolume::GetRegion(), G4LogicalVolume::GetSolid(), G4TransportationManager::GetTransportationManager(), g4zmq::history(), G4AffineTransform::Inverse(), G4LogicalVolume::IsRootRegion(), and JustWarning.

Referenced by SetCurrentTrack().

◆ GetAffineTransformation()

const G4AffineTransform * G4FastTrack::GetAffineTransformation ( ) const
inline

Definition at line 231 of file G4FastTrack.hh.

232{
233 return &fAffineTransformation;
234}

References fAffineTransformation.

◆ GetEnvelope()

G4Envelope * G4FastTrack::GetEnvelope ( ) const
inline

◆ GetEnvelopeLogicalVolume()

G4LogicalVolume * G4FastTrack::GetEnvelopeLogicalVolume ( ) const
inline

Definition at line 191 of file G4FastTrack.hh.

192{
194}

References fEnvelopeLogicalVolume.

◆ GetEnvelopePhysicalVolume()

G4VPhysicalVolume * G4FastTrack::GetEnvelopePhysicalVolume ( ) const
inline

Definition at line 196 of file G4FastTrack.hh.

197{
199}

References fEnvelopePhysicalVolume.

◆ GetEnvelopeSolid()

G4VSolid * G4FastTrack::GetEnvelopeSolid ( ) const
inline

◆ GetInverseAffineTransformation()

const G4AffineTransform * G4FastTrack::GetInverseAffineTransformation ( ) const
inline

◆ GetPrimaryTrack()

const G4Track * G4FastTrack::GetPrimaryTrack ( ) const
inline

◆ GetPrimaryTrackLocalDirection()

G4ThreeVector G4FastTrack::GetPrimaryTrackLocalDirection ( ) const
inline

Definition at line 221 of file G4FastTrack.hh.

222{
224}
G4ThreeVector fLocalTrackDirection
Definition: G4FastTrack.hh:175

References fLocalTrackDirection.

Referenced by GFlashShowerModel::CheckContainment(), GFlashShowerModel::ElectronDoIt(), and OnTheBoundaryButExiting().

◆ GetPrimaryTrackLocalMomentum()

G4ThreeVector G4FastTrack::GetPrimaryTrackLocalMomentum ( ) const
inline

Definition at line 216 of file G4FastTrack.hh.

217{
218 return fLocalTrackMomentum;
219}
G4ThreeVector fLocalTrackMomentum
Definition: G4FastTrack.hh:174

References fLocalTrackMomentum.

◆ GetPrimaryTrackLocalPolarization()

G4ThreeVector G4FastTrack::GetPrimaryTrackLocalPolarization ( ) const
inline

Definition at line 226 of file G4FastTrack.hh.

227{
229}
G4ThreeVector fLocalTrackPolarization
Definition: G4FastTrack.hh:176

References fLocalTrackPolarization.

◆ GetPrimaryTrackLocalPosition()

G4ThreeVector G4FastTrack::GetPrimaryTrackLocalPosition ( ) const
inline

Definition at line 211 of file G4FastTrack.hh.

212{
213 return fLocalTrackPosition;
214}
G4ThreeVector fLocalTrackPosition
Definition: G4FastTrack.hh:173

References fLocalTrackPosition.

Referenced by GFlashShowerModel::CheckContainment(), GFlashShowerModel::ElectronDoIt(), and OnTheBoundaryButExiting().

◆ OnTheBoundaryButExiting()

G4bool G4FastTrack::OnTheBoundaryButExiting ( ) const
inline

Definition at line 241 of file G4FastTrack.hh.

242{
243 // tests if particle are on the boundary and leaving.
244 return GetEnvelopeSolid()->
245 DistanceToOut(GetPrimaryTrackLocalPosition(),
247}
G4ThreeVector GetPrimaryTrackLocalPosition() const
Definition: G4FastTrack.hh:211
G4ThreeVector GetPrimaryTrackLocalDirection() const
Definition: G4FastTrack.hh:221
G4VSolid * GetEnvelopeSolid() const
Definition: G4FastTrack.hh:201

References GetEnvelopeSolid(), GetPrimaryTrackLocalDirection(), and GetPrimaryTrackLocalPosition().

Referenced by G4FastSimulationManager::PostStepGetFastSimulationManagerTrigger().

◆ SetCurrentTrack()

void G4FastTrack::SetCurrentTrack ( const G4Track track,
const G4Navigator a = 0 
)

Definition at line 70 of file G4FastTrack.cc.

72{
73
74 // -- Register track pointer (used everywhere):
75 fTrack = &track;
76
77 //-----------------------------------------------------
78 // First time the track enters the volume or if the
79 // Logical Volume was placed n-Times in the geometry :
80 //
81 // Records the Rotation+Translation for the Envelope !
82 // When the particle is inside or on the boundary, the
83 // NavigationHistory IS UP TO DATE.
84 //------------------------------------------------------
86
87 //-------------------------------------------
88 // Records local position/momentum/direction
89 // of the Track.
90 // They are accessible to the user through a
91 // set of Get functions and should be useful
92 // to decide to trigger or not.
93 //-------------------------------------------
94 // -- local position:
96 // -- local momentum:
98 // -- local direction:
100 // -- local polarization:
102}
Hep3Vector unit() const
G4ThreeVector TransformPoint(const G4ThreeVector &vec) const
G4ThreeVector TransformAxis(const G4ThreeVector &axis) const
void FRecordsAffineTransformation(const G4Navigator *)
Definition: G4FastTrack.cc:111
const G4ThreeVector & GetPosition() const
G4ThreeVector GetMomentum() const
const G4ThreeVector & GetPolarization() const

References fAffineTransformation, fAffineTransformationDefined, fIsUnique, fLocalTrackDirection, fLocalTrackMomentum, fLocalTrackPolarization, fLocalTrackPosition, FRecordsAffineTransformation(), fTrack, G4Track::GetMomentum(), G4Track::GetPolarization(), G4Track::GetPosition(), G4AffineTransform::TransformAxis(), G4AffineTransform::TransformPoint(), and CLHEP::Hep3Vector::unit().

Referenced by G4FastSimulationManager::AtRestGetFastSimulationManagerTrigger(), and G4FastSimulationManager::PostStepGetFastSimulationManagerTrigger().

Field Documentation

◆ fAffineTransformation

G4AffineTransform G4FastTrack::fAffineTransformation
private

◆ fAffineTransformationDefined

G4bool G4FastTrack::fAffineTransformationDefined
private

Definition at line 167 of file G4FastTrack.hh.

Referenced by FRecordsAffineTransformation(), and SetCurrentTrack().

◆ fEnvelope

G4Envelope* G4FastTrack::fEnvelope
private

Definition at line 168 of file G4FastTrack.hh.

Referenced by FRecordsAffineTransformation(), and GetEnvelope().

◆ fEnvelopeLogicalVolume

G4LogicalVolume* G4FastTrack::fEnvelopeLogicalVolume
private

Definition at line 170 of file G4FastTrack.hh.

Referenced by FRecordsAffineTransformation(), and GetEnvelopeLogicalVolume().

◆ fEnvelopePhysicalVolume

G4VPhysicalVolume* G4FastTrack::fEnvelopePhysicalVolume
private

Definition at line 171 of file G4FastTrack.hh.

Referenced by FRecordsAffineTransformation(), and GetEnvelopePhysicalVolume().

◆ fEnvelopeSolid

G4VSolid* G4FastTrack::fEnvelopeSolid
private

Definition at line 172 of file G4FastTrack.hh.

Referenced by FRecordsAffineTransformation(), and GetEnvelopeSolid().

◆ fInverseAffineTransformation

G4AffineTransform G4FastTrack::fInverseAffineTransformation
private

Definition at line 178 of file G4FastTrack.hh.

Referenced by FRecordsAffineTransformation(), and GetInverseAffineTransformation().

◆ fIsUnique

G4bool G4FastTrack::fIsUnique
private

Definition at line 169 of file G4FastTrack.hh.

Referenced by SetCurrentTrack().

◆ fLocalTrackDirection

G4ThreeVector G4FastTrack::fLocalTrackDirection
private

Definition at line 175 of file G4FastTrack.hh.

Referenced by GetPrimaryTrackLocalDirection(), and SetCurrentTrack().

◆ fLocalTrackMomentum

G4ThreeVector G4FastTrack::fLocalTrackMomentum
private

Definition at line 174 of file G4FastTrack.hh.

Referenced by GetPrimaryTrackLocalMomentum(), and SetCurrentTrack().

◆ fLocalTrackPolarization

G4ThreeVector G4FastTrack::fLocalTrackPolarization
private

Definition at line 176 of file G4FastTrack.hh.

Referenced by GetPrimaryTrackLocalPolarization(), and SetCurrentTrack().

◆ fLocalTrackPosition

G4ThreeVector G4FastTrack::fLocalTrackPosition
private

Definition at line 173 of file G4FastTrack.hh.

Referenced by GetPrimaryTrackLocalPosition(), and SetCurrentTrack().

◆ fTrack

const G4Track* G4FastTrack::fTrack
private

Definition at line 160 of file G4FastTrack.hh.

Referenced by GetPrimaryTrack(), and SetCurrentTrack().


The documentation for this class was generated from the following files: