Geant4  10.02.p03
G4FastTrack Class Reference

#include <G4FastTrack.hh>

Collaboration diagram for G4FastTrack:

Public Member Functions

 G4FastTrack (G4Envelope *anEnvelope, G4bool IsUnique)
 
 ~G4FastTrack ()
 
void SetCurrentTrack (const G4Track &, const G4Navigator *a=0)
 
G4bool OnTheBoundaryButExiting () const
 
const G4Track * GetPrimaryTrack () const
 
G4Envelope * GetEnvelope () const
 
G4LogicalVolume * GetEnvelopeLogicalVolume () const
 
G4VPhysicalVolume * GetEnvelopePhysicalVolume () const
 
G4VSolid * GetEnvelopeSolid () const
 
G4ThreeVector GetPrimaryTrackLocalPosition () const
 
G4ThreeVector GetPrimaryTrackLocalMomentum () const
 
G4ThreeVector GetPrimaryTrackLocalDirection () const
 
G4ThreeVector GetPrimaryTrackLocalPolarization () const
 
const G4AffineTransform * GetAffineTransformation () const
 
const G4AffineTransform * GetInverseAffineTransformation () const
 

Private Member Functions

void FRecordsAffineTransformation (const G4Navigator *)
 

Private Attributes

const G4Track * fTrack
 
G4bool fAffineTransformationDefined
 
G4Envelope * fEnvelope
 
G4bool fIsUnique
 
G4LogicalVolume * fEnvelopeLogicalVolume
 
G4VPhysicalVolume * fEnvelopePhysicalVolume
 
G4VSolid * fEnvelopeSolid
 
G4ThreeVector fLocalTrackPosition
 
G4ThreeVector fLocalTrackMomentum
 
G4ThreeVector fLocalTrackDirection
 
G4ThreeVector fLocalTrackPolarization
 
G4AffineTransform fAffineTransformation
 
G4AffineTransform fInverseAffineTransformation
 

Detailed Description

Definition at line 78 of file G4FastTrack.hh.

Constructor & Destructor Documentation

◆ G4FastTrack()

G4FastTrack::G4FastTrack ( G4Envelope *  anEnvelope,
G4bool  IsUnique 
)

Definition at line 51 of file G4FastTrack.cc.

52  :
53  fAffineTransformationDefined(false), fEnvelope(anEnvelope),
56 {}
G4bool fAffineTransformationDefined
Definition: G4FastTrack.hh:169
G4LogicalVolume * fEnvelopeLogicalVolume
Definition: G4FastTrack.hh:172
G4Envelope * fEnvelope
Definition: G4FastTrack.hh:170
G4bool fIsUnique
Definition: G4FastTrack.hh:171
G4VSolid * fEnvelopeSolid
Definition: G4FastTrack.hh:174
G4VPhysicalVolume * fEnvelopePhysicalVolume
Definition: G4FastTrack.hh:173

◆ ~G4FastTrack()

G4FastTrack::~G4FastTrack ( )

Definition at line 61 of file G4FastTrack.cc.

62 {}

Member Function Documentation

◆ FRecordsAffineTransformation()

void G4FastTrack::FRecordsAffineTransformation ( const G4Navigator *  theNavigator)
private

Definition at line 109 of file G4FastTrack.cc.

110 {
111 
112  //--------------------------------------------------------
113  // Get the touchable history which represents the current
114  // volume hierachy the particle is in.
115  // Note that TouchableHistory allocated by the Navigator
116  // must be deleted by G4FastTrack.
117  //--------------------------------------------------------
118  const G4Navigator* NavigatorToUse;
119  if(theNavigator != 0 ) NavigatorToUse = theNavigator;
121 
122  G4TouchableHistoryHandle history = NavigatorToUse->CreateTouchableHistoryHandle();
123 
124  //-----------------------------------------------------
125  // Run accross the hierarchy to find the physical volume
126  // associated with the envelope
127  //-----------------------------------------------------
128  G4int depth = history->GetHistory()->GetDepth();
129  G4int idepth, Done = 0;
130  for (idepth = 0; idepth <= depth; idepth++)
131  {
132  G4VPhysicalVolume* currPV = history->GetHistory()->GetVolume(idepth);
133  G4LogicalVolume* currLV = currPV->GetLogicalVolume();
134  if ( (currLV->GetRegion() == fEnvelope) && (currLV->IsRootRegion()) )
135  {
136  fEnvelopePhysicalVolume = currPV;
137  fEnvelopeLogicalVolume = currLV;
138  fEnvelopeSolid = currLV->GetSolid();
139  Done = 1;
140  break;
141  }
142  }
143  //---------------------------------------------
144  //-- Verification: should be removed in future:
145  //---------------------------------------------
146  if ( !Done )
147  {
149  ed << "Can't find transformation for `" << fEnvelopePhysicalVolume->GetName() << "'" << G4endl;
150  G4Exception("G4FastTrack::FRecordsAffineTransformation()",
151  "FastSim011",
152  JustWarning, ed);
153  }
154  else
155  {
156  //-------------------------------------------------------
157  // Records the transformation and inverse transformation:
158  //-------------------------------------------------------
159  fAffineTransformation = history->GetHistory()->GetTransform(idepth);
161 
163  }
164 }
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
G4bool fAffineTransformationDefined
Definition: G4FastTrack.hh:169
G4LogicalVolume * fEnvelopeLogicalVolume
Definition: G4FastTrack.hh:172
int G4int
Definition: G4Types.hh:78
G4Envelope * fEnvelope
Definition: G4FastTrack.hh:170
G4AffineTransform Inverse() const
G4bool IsRootRegion() const
G4Navigator * GetNavigatorForTracking() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
static G4TransportationManager * GetTransportationManager()
const G4String & GetName() const
G4AffineTransform fInverseAffineTransformation
Definition: G4FastTrack.hh:179
G4Region * GetRegion() const
#define G4endl
Definition: G4ios.hh:61
G4VSolid * fEnvelopeSolid
Definition: G4FastTrack.hh:174
G4LogicalVolume * GetLogicalVolume() const
G4VPhysicalVolume * fEnvelopePhysicalVolume
Definition: G4FastTrack.hh:173
virtual G4TouchableHistoryHandle CreateTouchableHistoryHandle() const
G4VSolid * GetSolid() const
G4AffineTransform fAffineTransformation
Definition: G4FastTrack.hh:179
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetAffineTransformation()

const G4AffineTransform * G4FastTrack::GetAffineTransformation ( ) const
inline

Definition at line 233 of file G4FastTrack.hh.

234 {
235  return &fAffineTransformation;
236 }
G4AffineTransform fAffineTransformation
Definition: G4FastTrack.hh:179

◆ GetEnvelope()

G4Envelope * G4FastTrack::GetEnvelope ( ) const
inline

Definition at line 188 of file G4FastTrack.hh.

189 {
190  return fEnvelope;
191 }
G4Envelope * fEnvelope
Definition: G4FastTrack.hh:170
Here is the caller graph for this function:

◆ GetEnvelopeLogicalVolume()

G4LogicalVolume * G4FastTrack::GetEnvelopeLogicalVolume ( ) const
inline

Definition at line 193 of file G4FastTrack.hh.

194 {
195  return fEnvelopeLogicalVolume;
196 }
G4LogicalVolume * fEnvelopeLogicalVolume
Definition: G4FastTrack.hh:172

◆ GetEnvelopePhysicalVolume()

G4VPhysicalVolume * G4FastTrack::GetEnvelopePhysicalVolume ( ) const
inline

Definition at line 198 of file G4FastTrack.hh.

199 {
201 }
G4VPhysicalVolume * fEnvelopePhysicalVolume
Definition: G4FastTrack.hh:173

◆ GetEnvelopeSolid()

G4VSolid * G4FastTrack::GetEnvelopeSolid ( ) const
inline

Definition at line 203 of file G4FastTrack.hh.

204 {
205  return fEnvelopeSolid;
206 }
G4VSolid * fEnvelopeSolid
Definition: G4FastTrack.hh:174
Here is the caller graph for this function:

◆ GetInverseAffineTransformation()

const G4AffineTransform * G4FastTrack::GetInverseAffineTransformation ( ) const
inline

Definition at line 238 of file G4FastTrack.hh.

239 {
241 }
G4AffineTransform fInverseAffineTransformation
Definition: G4FastTrack.hh:179
Here is the caller graph for this function:

◆ GetPrimaryTrack()

const G4Track * G4FastTrack::GetPrimaryTrack ( ) const
inline

Definition at line 208 of file G4FastTrack.hh.

209 {
210  return fTrack;
211 }
const G4Track * fTrack
Definition: G4FastTrack.hh:162
Here is the caller graph for this function:

◆ GetPrimaryTrackLocalDirection()

G4ThreeVector G4FastTrack::GetPrimaryTrackLocalDirection ( ) const
inline

Definition at line 223 of file G4FastTrack.hh.

224 {
225  return fLocalTrackDirection;
226 }
G4ThreeVector fLocalTrackDirection
Definition: G4FastTrack.hh:175
Here is the caller graph for this function:

◆ GetPrimaryTrackLocalMomentum()

G4ThreeVector G4FastTrack::GetPrimaryTrackLocalMomentum ( ) const
inline

Definition at line 218 of file G4FastTrack.hh.

219 {
220  return fLocalTrackMomentum;
221 }
G4ThreeVector fLocalTrackMomentum
Definition: G4FastTrack.hh:175

◆ GetPrimaryTrackLocalPolarization()

G4ThreeVector G4FastTrack::GetPrimaryTrackLocalPolarization ( ) const
inline

Definition at line 228 of file G4FastTrack.hh.

229 {
231 }
G4ThreeVector fLocalTrackPolarization
Definition: G4FastTrack.hh:175

◆ GetPrimaryTrackLocalPosition()

G4ThreeVector G4FastTrack::GetPrimaryTrackLocalPosition ( ) const
inline

Definition at line 213 of file G4FastTrack.hh.

214 {
215  return fLocalTrackPosition;
216 }
G4ThreeVector fLocalTrackPosition
Definition: G4FastTrack.hh:175
Here is the caller graph for this function:

◆ OnTheBoundaryButExiting()

G4bool G4FastTrack::OnTheBoundaryButExiting ( ) const
inline

Definition at line 243 of file G4FastTrack.hh.

244 {
245  // tests if particle are on the boundary and leaving.
246  return GetEnvelopeSolid()->
247  DistanceToOut(GetPrimaryTrackLocalPosition(),
249 }
G4VSolid * GetEnvelopeSolid() const
Definition: G4FastTrack.hh:203
G4ThreeVector GetPrimaryTrackLocalDirection() const
Definition: G4FastTrack.hh:223
G4ThreeVector GetPrimaryTrackLocalPosition() const
Definition: G4FastTrack.hh:213
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetCurrentTrack()

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

Definition at line 68 of file G4FastTrack.cc.

70 {
71 
72  // -- Register track pointer (used everywhere):
73  fTrack = &track;
74 
75  //-----------------------------------------------------
76  // First time the track enters the volume or if the
77  // Logical Volume was placed n-Times in the geometry :
78  //
79  // Records the Rotation+Translation for the Envelope !
80  // When the particle is inside or on the boundary, the
81  // NavigationHistory IS UP TO DATE.
82  //------------------------------------------------------
84 
85  //-------------------------------------------
86  // Records local position/momentum/direction
87  // of the Track.
88  // They are accessible to the user through a
89  // set of Get functions and should be useful
90  // to decide to trigger or not.
91  //-------------------------------------------
92  // -- local position:
94  // -- local momentum:
96  // -- local direction:
98  // -- local polarization:
100 }
G4ThreeVector TransformAxis(const G4ThreeVector &axis) const
G4bool fAffineTransformationDefined
Definition: G4FastTrack.hh:169
G4ThreeVector fLocalTrackPolarization
Definition: G4FastTrack.hh:175
G4ThreeVector TransformPoint(const G4ThreeVector &vec) const
void FRecordsAffineTransformation(const G4Navigator *)
Definition: G4FastTrack.cc:109
G4ThreeVector fLocalTrackMomentum
Definition: G4FastTrack.hh:175
G4ThreeVector fLocalTrackPosition
Definition: G4FastTrack.hh:175
Hep3Vector unit() const
G4bool fIsUnique
Definition: G4FastTrack.hh:171
G4ThreeVector fLocalTrackDirection
Definition: G4FastTrack.hh:175
const G4Track * fTrack
Definition: G4FastTrack.hh:162
G4AffineTransform fAffineTransformation
Definition: G4FastTrack.hh:179
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ fAffineTransformation

G4AffineTransform G4FastTrack::fAffineTransformation
private

Definition at line 179 of file G4FastTrack.hh.

◆ fAffineTransformationDefined

G4bool G4FastTrack::fAffineTransformationDefined
private

Definition at line 169 of file G4FastTrack.hh.

◆ fEnvelope

G4Envelope* G4FastTrack::fEnvelope
private

Definition at line 170 of file G4FastTrack.hh.

◆ fEnvelopeLogicalVolume

G4LogicalVolume* G4FastTrack::fEnvelopeLogicalVolume
private

Definition at line 172 of file G4FastTrack.hh.

◆ fEnvelopePhysicalVolume

G4VPhysicalVolume* G4FastTrack::fEnvelopePhysicalVolume
private

Definition at line 173 of file G4FastTrack.hh.

◆ fEnvelopeSolid

G4VSolid* G4FastTrack::fEnvelopeSolid
private

Definition at line 174 of file G4FastTrack.hh.

◆ fInverseAffineTransformation

G4AffineTransform G4FastTrack::fInverseAffineTransformation
private

Definition at line 179 of file G4FastTrack.hh.

◆ fIsUnique

G4bool G4FastTrack::fIsUnique
private

Definition at line 171 of file G4FastTrack.hh.

◆ fLocalTrackDirection

G4ThreeVector G4FastTrack::fLocalTrackDirection
private

Definition at line 175 of file G4FastTrack.hh.

◆ fLocalTrackMomentum

G4ThreeVector G4FastTrack::fLocalTrackMomentum
private

Definition at line 175 of file G4FastTrack.hh.

◆ fLocalTrackPolarization

G4ThreeVector G4FastTrack::fLocalTrackPolarization
private

Definition at line 175 of file G4FastTrack.hh.

◆ fLocalTrackPosition

G4ThreeVector G4FastTrack::fLocalTrackPosition
private

Definition at line 175 of file G4FastTrack.hh.

◆ fTrack

const G4Track* G4FastTrack::fTrack
private

Definition at line 162 of file G4FastTrack.hh.


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