Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes
G4VIntersectionLocator Class Referenceabstract

#include <G4VIntersectionLocator.hh>

Inheritance diagram for G4VIntersectionLocator:
G4BrentLocator G4MultiLevelLocator G4SimpleLocator

Public Member Functions

 G4VIntersectionLocator (G4Navigator *theNavigator)
 
virtual ~G4VIntersectionLocator ()
 
virtual G4bool EstimateIntersectionPoint (const G4FieldTrack &curveStartPointTangent, const G4FieldTrack &curveEndPointTangent, const G4ThreeVector &trialPoint, G4FieldTrack &intersectPointTangent, G4bool &recalculatedEndPoint, G4double &fPreviousSafety, G4ThreeVector &fPreviousSftOrigin)=0
 
void printStatus (const G4FieldTrack &startFT, const G4FieldTrack &currentFT, G4double requestStep, G4double safety, G4int step)
 
G4bool IntersectChord (const G4ThreeVector &StartPointA, const G4ThreeVector &EndPointB, G4double &NewSafety, G4double &PreviousSafety, G4ThreeVector &PreviousSftOrigin, G4double &LinearStepLength, G4ThreeVector &IntersectionPoint, G4bool *calledNavigator=0)
 
void SetEpsilonStepFor (G4double EpsilonStep)
 
void SetDeltaIntersectionFor (G4double deltaIntersection)
 
void SetNavigatorFor (G4Navigator *fNavigator)
 
void SetChordFinderFor (G4ChordFinder *fCFinder)
 
void SetVerboseFor (G4int fVerbose)
 
G4int GetVerboseFor ()
 
G4double GetDeltaIntersectionFor ()
 
G4double GetEpsilonStepFor ()
 
G4NavigatorGetNavigatorFor ()
 
G4ChordFinderGetChordFinderFor ()
 
void SetSafetyParametersFor (G4bool UseSafety)
 
void AddAdjustementOfFoundIntersection (G4bool UseCorrection)
 
G4bool GetAdjustementOfFoundIntersection ()
 
void AdjustIntersections (G4bool UseCorrection)
 
G4bool AreIntersectionsAdjusted ()
 

Protected Member Functions

G4FieldTrack ReEstimateEndpoint (const G4FieldTrack &CurrentStateA, const G4FieldTrack &EstimtdEndStateB, G4double linearDistSq, G4double curveDist)
 
G4ThreeVector GetSurfaceNormal (const G4ThreeVector &CurrentInt_Point, G4bool &validNormal)
 
G4ThreeVector GetGlobalSurfaceNormal (const G4ThreeVector &CurrentE_Point, G4bool &validNormal)
 
G4bool AdjustmentOfFoundIntersection (const G4ThreeVector &A, const G4ThreeVector &CurrentE_Point, const G4ThreeVector &CurrentF_Point, const G4ThreeVector &MomentumDir, const G4bool IntersectAF, G4ThreeVector &IntersectionPoint, G4double &NewSafety, G4double &fPrevSafety, G4ThreeVector &fPrevSftOrigin)
 
void ReportTrialStep (G4int step_no, const G4ThreeVector &ChordAB_v, const G4ThreeVector &ChordEF_v, const G4ThreeVector &NewMomentumDir, const G4ThreeVector &NormalAtEntry, G4bool validNormal)
 

Protected Attributes

G4double kCarTolerance
 
G4int fVerboseLevel
 
G4bool fUseNormalCorrection
 
G4NavigatorfiNavigator
 
G4ChordFinderfiChordFinder
 
G4double fiEpsilonStep
 
G4double fiDeltaIntersection
 
G4bool fiUseSafety
 
G4NavigatorfHelpingNavigator
 
G4TouchableHistoryfpTouchable
 

Detailed Description

Definition at line 56 of file G4VIntersectionLocator.hh.

Constructor & Destructor Documentation

G4VIntersectionLocator::G4VIntersectionLocator ( G4Navigator theNavigator)

Definition at line 46 of file G4VIntersectionLocator.cc.

References fHelpingNavigator, fVerboseLevel, G4GeometryTolerance::GetInstance(), G4GeometryTolerance::GetSurfaceTolerance(), and kCarTolerance.

46  :
47  fUseNormalCorrection(false),
48  fiNavigator( theNavigator ),
49  fiChordFinder( 0 ), // Not set - overridden at each step
50  fiEpsilonStep( -1.0 ), // Out of range - overridden at each step
51  fiDeltaIntersection( -1.0 ), // Out of range - overridden at each step
52  fiUseSafety(false), // Default - overridden at each step
53  fpTouchable(0)
54 {
56  fVerboseLevel = 0;
58 }
G4double GetSurfaceTolerance() const
G4TouchableHistory * fpTouchable
static G4GeometryTolerance * GetInstance()
G4VIntersectionLocator::~G4VIntersectionLocator ( )
virtual

Definition at line 64 of file G4VIntersectionLocator.cc.

References fHelpingNavigator, and fpTouchable.

65 {
66  delete fHelpingNavigator;
67  delete fpTouchable;
68 }
G4TouchableHistory * fpTouchable

Member Function Documentation

void G4VIntersectionLocator::AddAdjustementOfFoundIntersection ( G4bool  UseCorrection)
inline
void G4VIntersectionLocator::AdjustIntersections ( G4bool  UseCorrection)
inline
G4bool G4VIntersectionLocator::AdjustmentOfFoundIntersection ( const G4ThreeVector A,
const G4ThreeVector CurrentE_Point,
const G4ThreeVector CurrentF_Point,
const G4ThreeVector MomentumDir,
const G4bool  IntersectAF,
G4ThreeVector IntersectionPoint,
G4double NewSafety,
G4double fPrevSafety,
G4ThreeVector fPrevSftOrigin 
)
protected

Definition at line 348 of file G4VIntersectionLocator.cc.

References CLHEP::Hep3Vector::dot(), fVerboseLevel, G4cerr, G4endl, GetGlobalSurfaceNormal(), GetNavigatorFor(), IntersectChord(), kCarTolerance, G4InuclParticleNames::lambda, and G4Navigator::LocateGlobalPointWithinVolume().

Referenced by G4BrentLocator::EstimateIntersectionPoint(), G4MultiLevelLocator::EstimateIntersectionPoint(), and G4SimpleLocator::EstimateIntersectionPoint().

357 {
358  G4double dist,lambda;
359  G4ThreeVector Normal, NewPoint, Point_G;
360  G4bool goodAdjust=false, Intersects_FP=false, validNormal=false;
361 
362  // Get SurfaceNormal of Intersecting Solid
363  //
364  Normal = GetGlobalSurfaceNormal(CurrentE_Point,validNormal);
365  if(!validNormal) { return false; }
366 
367  // Intersection between Line and Plane
368  //
369  G4double n_d_m = Normal.dot(MomentumDir);
370  if ( std::abs(n_d_m)>kCarTolerance )
371  {
372 #ifdef G4VERBOSE
373  if ( fVerboseLevel>1 )
374  {
375  G4cerr << "WARNING - "
376  << "G4VIntersectionLocator::AdjustementOfFoundIntersection()"
377  << G4endl
378  << " No intersection. Parallels lines!" << G4endl;
379  }
380 #endif
381  lambda =- Normal.dot(CurrentF_Point-CurrentE_Point)/n_d_m;
382 
383  // New candidate for Intersection
384  //
385  NewPoint = CurrentF_Point+lambda*MomentumDir;
386 
387  // Distance from CurrentF to Calculated Intersection
388  //
389  dist = std::abs(lambda);
390 
391  if ( dist<kCarTolerance*0.001 ) { return false; }
392 
393  // Calculation of new intersection point on the path.
394  //
395  if ( IntersectAF ) // First part intersects
396  {
397  G4double stepLengthFP;
398  G4ThreeVector Point_P = CurrentA_Point;
400  Intersects_FP = IntersectChord( Point_P, NewPoint, NewSafety,
401  fPreviousSafety, fPreviousSftOrigin,
402  stepLengthFP, Point_G );
403 
404  }
405  else // Second part intersects
406  {
407  G4double stepLengthFP;
409  Intersects_FP = IntersectChord( CurrentF_Point, NewPoint, NewSafety,
410  fPreviousSafety, fPreviousSftOrigin,
411  stepLengthFP, Point_G );
412  }
413  if ( Intersects_FP )
414  {
415  goodAdjust = true;
416  IntersectionPoint = Point_G;
417  }
418  }
419 
420  return goodAdjust;
421 }
double dot(const Hep3Vector &) const
G4ThreeVector GetGlobalSurfaceNormal(const G4ThreeVector &CurrentE_Point, G4bool &validNormal)
G4bool IntersectChord(const G4ThreeVector &StartPointA, const G4ThreeVector &EndPointB, G4double &NewSafety, G4double &PreviousSafety, G4ThreeVector &PreviousSftOrigin, G4double &LinearStepLength, G4ThreeVector &IntersectionPoint, G4bool *calledNavigator=0)
bool G4bool
Definition: G4Types.hh:79
G4Navigator * GetNavigatorFor()
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
virtual void LocateGlobalPointWithinVolume(const G4ThreeVector &position)
Definition: G4Navigator.cc:550
G4GLOB_DLL std::ostream G4cerr
G4bool G4VIntersectionLocator::AreIntersectionsAdjusted ( )
inline

Definition at line 125 of file G4VIntersectionLocator.hh.

References fUseNormalCorrection.

virtual G4bool G4VIntersectionLocator::EstimateIntersectionPoint ( const G4FieldTrack curveStartPointTangent,
const G4FieldTrack curveEndPointTangent,
const G4ThreeVector trialPoint,
G4FieldTrack intersectPointTangent,
G4bool recalculatedEndPoint,
G4double fPreviousSafety,
G4ThreeVector fPreviousSftOrigin 
)
pure virtual
G4bool G4VIntersectionLocator::GetAdjustementOfFoundIntersection ( )
inline
G4ChordFinder* G4VIntersectionLocator::GetChordFinderFor ( )
inline
G4double G4VIntersectionLocator::GetDeltaIntersectionFor ( )
inline
G4double G4VIntersectionLocator::GetEpsilonStepFor ( )
inline
G4ThreeVector G4VIntersectionLocator::GetGlobalSurfaceNormal ( const G4ThreeVector CurrentE_Point,
G4bool validNormal 
)
protected

Definition at line 467 of file G4VIntersectionLocator.cc.

References fHelpingNavigator, G4endl, G4Exception(), G4Navigator::GetLocalToGlobalTransform(), JustWarning, CLHEP::Hep3Vector::mag2(), G4AffineTransform::NetRotation(), G4AffineTransform::NetTranslation(), python.hepunit::perThousand, and G4AffineTransform::TransformAxis().

Referenced by AdjustmentOfFoundIntersection().

469 {
470  G4ThreeVector localNormal=
471  GetLocalSurfaceNormal( CurrentE_Point, validNormal );
472  G4AffineTransform localToGlobal= // Must use the same Navigator !!
474  G4ThreeVector globalNormal =
475  localToGlobal.TransformAxis( localNormal );
476 
477 #ifdef G4DEBUG_FIELD
478  if( validNormal && ( std::fabs(globalNormal.mag2() - 1.0) > perThousand ) )
479  {
480  std::ostringstream message;
481  message << "**************************************************************"
482  << G4endl;
483  message << " Bad Normal in G4VIntersectionLocator::GetGlobalSurfaceNormal "
484  << G4endl;
485  message << " * Constituents: " << G4endl;
486  message << " Local Normal= " << localNormal << G4endl;
487  message << " Transform: " << G4endl
488  << " Net Translation= " << localToGlobal.NetTranslation()
489  << G4endl
490  << " Net Rotation = " << localToGlobal.NetRotation()
491  << G4endl;
492  message << " * Result: " << G4endl;
493  message << " Global Normal= " << localNormal << G4endl;
494  message << "**************************************************************"
495  << G4endl;
496  G4Exception("G4VIntersectionLocator::GetGlobalSurfaceNormal()",
497  "GeomNav1002", JustWarning, message);
498  }
499 #endif
500 
501  return globalNormal;
502 }
G4ThreeVector NetTranslation() const
float perThousand
Definition: hepunit.py:240
const G4AffineTransform GetLocalToGlobalTransform() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4RotationMatrix NetRotation() const
G4ThreeVector TransformAxis(const G4ThreeVector &axis) const
double mag2() const
#define G4endl
Definition: G4ios.hh:61
G4Navigator* G4VIntersectionLocator::GetNavigatorFor ( )
inline
G4ThreeVector G4VIntersectionLocator::GetSurfaceNormal ( const G4ThreeVector CurrentInt_Point,
G4bool validNormal 
)
protected

Definition at line 424 of file G4VIntersectionLocator.cc.

References G4endl, G4Exception(), JustWarning, CLHEP::Hep3Vector::mag(), CLHEP::Hep3Vector::mag2(), and python.hepunit::perThousand.

Referenced by G4BrentLocator::EstimateIntersectionPoint(), G4MultiLevelLocator::EstimateIntersectionPoint(), and G4SimpleLocator::EstimateIntersectionPoint().

426 {
427  G4ThreeVector NormalAtEntry; // ( -10. , -10., -10. );
428 
429  G4ThreeVector NormalAtEntryLast, NormalAtEntryGlobal, diffNormals;
430  G4bool validNormalLast;
431 
432  // Relies on a call to Navigator::ComputeStep in IntersectChord before
433  // this call
434  //
435  NormalAtEntryLast = GetLastSurfaceNormal( CurrentInt_Point, validNormalLast );
436  // May return valid=false in cases, including
437  // - if the candidate volume was not found (eg exiting world), or
438  // - a replica was involved -- determined the step size.
439  // (This list is not complete.)
440 
441 #ifdef G4DEBUG_FIELD
442  if ( validNormalLast
443  && ( std::fabs(NormalAtEntryLast.mag2() - 1.0) > perThousand ) )
444  {
445  std::ostringstream message;
446  message << "G4VIntersectionLocator::GetSurfaceNormal -- identified problem."
447  << G4endl;
448  message << "PROBLEM: Normal is not unit - magnitude = "
449  << NormalAtEntryLast.mag() << G4endl;
450  message << " at trial intersection point " << CurrentInt_Point << G4endl;
451  message << " Obtained from Get *Last* Surface Normal." << G4endl;
452  G4Exception("G4VIntersectionLocator::GetGlobalSurfaceNormal()",
453  "GeomNav1002", JustWarning, message);
454  }
455 #endif
456 
457  if( validNormalLast )
458  {
459  NormalAtEntry=NormalAtEntryLast;
460  }
461  validNormal = validNormalLast;
462 
463  return NormalAtEntry;
464 }
float perThousand
Definition: hepunit.py:240
bool G4bool
Definition: G4Types.hh:79
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
double mag2() const
#define G4endl
Definition: G4ios.hh:61
double mag() const
G4int G4VIntersectionLocator::GetVerboseFor ( )
inline
G4bool G4VIntersectionLocator::IntersectChord ( const G4ThreeVector StartPointA,
const G4ThreeVector EndPointB,
G4double NewSafety,
G4double PreviousSafety,
G4ThreeVector PreviousSftOrigin,
G4double LinearStepLength,
G4ThreeVector IntersectionPoint,
G4bool calledNavigator = 0 
)
inline
void G4VIntersectionLocator::printStatus ( const G4FieldTrack startFT,
const G4FieldTrack currentFT,
G4double  requestStep,
G4double  safety,
G4int  step 
)

Definition at line 75 of file G4VIntersectionLocator.cc.

References fVerboseLevel, G4cout, G4endl, G4FieldTrack::GetCurveLength(), G4FieldTrack::GetMomentum(), G4FieldTrack::GetMomentumDir(), G4FieldTrack::GetPosition(), CLHEP::Hep3Vector::mag(), CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

Referenced by G4BrentLocator::EstimateIntersectionPoint(), G4MultiLevelLocator::EstimateIntersectionPoint(), and G4SimpleLocator::EstimateIntersectionPoint().

80 {
81  const G4int verboseLevel= fVerboseLevel;
82  const G4ThreeVector StartPosition = StartFT.GetPosition();
83  const G4ThreeVector StartUnitVelocity = StartFT.GetMomentumDir();
84  const G4ThreeVector CurrentPosition = CurrentFT.GetPosition();
85  const G4ThreeVector CurrentUnitVelocity = CurrentFT.GetMomentumDir();
86 
87  G4double step_len = CurrentFT.GetCurveLength() - StartFT.GetCurveLength();
88  G4int oldprc; // cout/cerr precision settings
89 
90  if( ((stepNo == 0) && (verboseLevel <3)) || (verboseLevel >= 3) )
91  {
92  oldprc = G4cout.precision(4);
93  G4cout << std::setw( 6) << " "
94  << std::setw( 25) << " Current Position and Direction" << " "
95  << G4endl;
96  G4cout << std::setw( 5) << "Step#"
97  << std::setw(10) << " s " << " "
98  << std::setw(10) << "X(mm)" << " "
99  << std::setw(10) << "Y(mm)" << " "
100  << std::setw(10) << "Z(mm)" << " "
101  << std::setw( 7) << " N_x " << " "
102  << std::setw( 7) << " N_y " << " "
103  << std::setw( 7) << " N_z " << " " ;
104  G4cout << std::setw( 7) << " Delta|N|" << " "
105  << std::setw( 9) << "StepLen" << " "
106  << std::setw(12) << "StartSafety" << " "
107  << std::setw( 9) << "PhsStep" << " ";
108  G4cout << G4endl;
109  G4cout.precision(oldprc);
110  }
111  if((stepNo == 0) && (verboseLevel <=3))
112  {
113  // Recurse to print the start values
114  //
115  printStatus( StartFT, StartFT, -1.0, safety, -1);
116  }
117  if( verboseLevel <= 3 )
118  {
119  if( stepNo >= 0)
120  {
121  G4cout << std::setw( 4) << stepNo << " ";
122  }
123  else
124  {
125  G4cout << std::setw( 5) << "Start" ;
126  }
127  oldprc = G4cout.precision(8);
128  G4cout << std::setw(10) << CurrentFT.GetCurveLength() << " ";
129  G4cout << std::setw(10) << CurrentPosition.x() << " "
130  << std::setw(10) << CurrentPosition.y() << " "
131  << std::setw(10) << CurrentPosition.z() << " ";
132  G4cout.precision(4);
133  G4cout << std::setw( 7) << CurrentUnitVelocity.x() << " "
134  << std::setw( 7) << CurrentUnitVelocity.y() << " "
135  << std::setw( 7) << CurrentUnitVelocity.z() << " ";
136  G4cout.precision(3);
137  G4cout << std::setw( 7)
138  << CurrentFT.GetMomentum().mag()- StartFT.GetMomentum().mag()
139  << " ";
140  G4cout << std::setw( 9) << step_len << " ";
141  G4cout << std::setw(12) << safety << " ";
142  if( requestStep != -1.0 )
143  {
144  G4cout << std::setw( 9) << requestStep << " ";
145  }
146  else
147  {
148  G4cout << std::setw( 9) << "Init/NotKnown" << " ";
149  }
150  G4cout << G4endl;
151  G4cout.precision(oldprc);
152  }
153  else // if( verboseLevel > 3 )
154  {
155  // Multi-line output
156 
157  G4cout << "Step taken was " << step_len
158  << " out of PhysicalStep= " << requestStep << G4endl;
159  G4cout << "Final safety is: " << safety << G4endl;
160  G4cout << "Chord length = " << (CurrentPosition-StartPosition).mag()
161  << G4endl;
162  G4cout << G4endl;
163  }
164 }
double x() const
int G4int
Definition: G4Types.hh:78
double z() const
G4GLOB_DLL std::ostream G4cout
void printStatus(const G4FieldTrack &startFT, const G4FieldTrack &currentFT, G4double requestStep, G4double safety, G4int step)
double y() const
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
G4FieldTrack G4VIntersectionLocator::ReEstimateEndpoint ( const G4FieldTrack CurrentStateA,
const G4FieldTrack EstimtdEndStateB,
G4double  linearDistSq,
G4double  curveDist 
)
protected

Definition at line 171 of file G4VIntersectionLocator.cc.

References G4MagInt_Driver::AccurateAdvance(), fVerboseLevel, G4cerr, G4cout, G4endl, G4ThreadLocal, GetChordFinderFor(), G4FieldTrack::GetCurveLength(), GetEpsilonStepFor(), G4ChordFinder::GetIntegrationDriver(), G4FieldTrack::GetPosition(), and kCarTolerance.

Referenced by G4BrentLocator::EstimateIntersectionPoint(), G4MultiLevelLocator::EstimateIntersectionPoint(), and G4SimpleLocator::EstimateIntersectionPoint().

175 {
176  G4FieldTrack newEndPoint( CurrentStateA );
178 
179  G4FieldTrack retEndPoint( CurrentStateA );
180  G4bool goodAdvance;
181  G4int itrial=0;
182  const G4int no_trials= 20;
183 
184  G4double endCurveLen= EstimatedEndStateB.GetCurveLength();
185  do
186  {
187  G4double currentCurveLen= newEndPoint.GetCurveLength();
188  G4double advanceLength= endCurveLen - currentCurveLen ;
189  if (std::abs(advanceLength)<kCarTolerance)
190  {
191  goodAdvance=true;
192  }
193  else{
194  goodAdvance=
195  integrDriver->AccurateAdvance(newEndPoint, advanceLength,
197  }
198  }
199  while( !goodAdvance && (++itrial < no_trials) );
200 
201  if( goodAdvance )
202  {
203  retEndPoint= newEndPoint;
204  }
205  else
206  {
207  retEndPoint= EstimatedEndStateB; // Could not improve without major work !!
208  }
209 
210  // All the work is done
211  // below are some diagnostics only -- before the return!
212  //
213  static const G4String MethodName("G4VIntersectionLocator::ReEstimateEndpoint");
214 
215 #ifdef G4VERBOSE
216  G4int latest_good_trials=0;
217  if( itrial > 1)
218  {
219  if( fVerboseLevel > 0 )
220  {
221  G4cout << MethodName << " called - goodAdv= " << goodAdvance
222  << " trials = " << itrial
223  << " previous good= " << latest_good_trials
224  << G4endl;
225  }
226  latest_good_trials=0;
227  }
228  else
229  {
230  latest_good_trials++;
231  }
232 #endif
233 
234 #ifdef G4DEBUG_FIELD
235  G4double lengthDone = newEndPoint.GetCurveLength()
236  - CurrentStateA.GetCurveLength();
237  if( !goodAdvance )
238  {
239  if( fVerboseLevel >= 3 )
240  {
241  G4cout << MethodName << "> AccurateAdvance failed " ;
242  G4cout << " in " << itrial << " integration trials/steps. " << G4endl;
243  G4cout << " It went only " << lengthDone << " instead of " << curveDist
244  << " -- a difference of " << curveDist - lengthDone << G4endl;
245  G4cout << " ReEstimateEndpoint> Reset endPoint to original value!"
246  << G4endl;
247  }
248  }
249 
250  static G4int noInaccuracyWarnings = 0;
251  G4int maxNoWarnings = 10;
252  if ( (noInaccuracyWarnings < maxNoWarnings )
253  || (fVerboseLevel > 1) )
254  {
255  G4cerr << "G4PropagatorInField::LocateIntersectionPoint():"
256  << G4endl
257  << " Warning: Integration inaccuracy requires"
258  << " an adjustment in the step's endpoint." << G4endl
259  << " Two mid-points are further apart than their"
260  << " curve length difference" << G4endl
261  << " Dist = " << std::sqrt(linearDistSq)
262  << " curve length = " << curveDist << G4endl;
263  G4cerr << " Correction applied is "
264  << (newEndPoint.GetPosition()-EstimatedEndStateB.GetPosition()).mag()
265  << G4endl;
266  }
267 #else
268  // Statistics on the RMS value of the corrections
269 
270  static G4ThreadLocal G4int noCorrections=0;
271  static G4ThreadLocal G4double sumCorrectionsSq = 0;
272  noCorrections++;
273  if( goodAdvance )
274  {
275  sumCorrectionsSq += (EstimatedEndStateB.GetPosition() -
276  newEndPoint.GetPosition()).mag2();
277  }
278  linearDistSq -= curveDist; // To use linearDistSq ... !
279 #endif
280 
281  return retEndPoint;
282 }
G4double GetCurveLength() const
#define G4ThreadLocal
Definition: tls.hh:52
int G4int
Definition: G4Types.hh:78
G4double GetEpsilonStepFor()
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
G4MagInt_Driver * GetIntegrationDriver()
G4ChordFinder * GetChordFinderFor()
G4bool AccurateAdvance(G4FieldTrack &y_current, G4double hstep, G4double eps, G4double hinitial=0.0)
G4GLOB_DLL std::ostream G4cerr
void G4VIntersectionLocator::ReportTrialStep ( G4int  step_no,
const G4ThreeVector ChordAB_v,
const G4ThreeVector ChordEF_v,
const G4ThreeVector NewMomentumDir,
const G4ThreeVector NormalAtEntry,
G4bool  validNormal 
)
protected

Definition at line 516 of file G4VIntersectionLocator.cc.

References CLHEP::Hep3Vector::dot(), G4cerr, G4cout, G4endl, CLHEP::Hep3Vector::mag(), CLHEP::Hep3Vector::mag2(), and python.hepunit::perThousand.

Referenced by G4BrentLocator::EstimateIntersectionPoint(), G4MultiLevelLocator::EstimateIntersectionPoint(), and G4SimpleLocator::EstimateIntersectionPoint().

522 {
523  G4double ABchord_length = ChordAB_v.mag();
524  G4double MomDir_dot_Norm = NewMomentumDir.dot( NormalAtEntry ) ;
525  G4double MomDir_dot_ABchord;
526  MomDir_dot_ABchord= (1.0 / ABchord_length) * NewMomentumDir.dot( ChordAB_v );
527 
528  std::ostringstream outStream;
529  outStream // G4cout
530  << std::setw(6) << " Step# "
531  << std::setw(17) << " |ChordEF|(mag)" << " "
532  << std::setw(18) << " uMomentum.Normal" << " "
533  << std::setw(18) << " uMomentum.ABdir " << " "
534  << std::setw(16) << " AB-dist " << " "
535  << " Chord Vector (EF) "
536  << G4endl;
537  outStream.precision(7);
538  outStream // G4cout
539  << " " << std::setw(5) << step_no
540  << " " << std::setw(18) << ChordEF_v.mag()
541  << " " << std::setw(18) << MomDir_dot_Norm
542  << " " << std::setw(18) << MomDir_dot_ABchord
543  << " " << std::setw(12) << ABchord_length
544  << " " << ChordEF_v
545  << G4endl;
546  outStream // G4cout
547  << " MomentumDir= " << " " << NewMomentumDir
548  << " Normal at Entry E= " << NormalAtEntry
549  << " AB chord = " << ChordAB_v
550  << G4endl;
551  G4cout << outStream.str(); // ostr_verbose;
552 
553  if( ( std::fabs(NormalAtEntry.mag2() - 1.0) > perThousand ) )
554  {
555  G4cerr << " PROBLEM in G4VIntersectionLocator::ReportTrialStep " << G4endl
556  << " Normal is not unit - mag=" << NormalAtEntry.mag()
557  << " ValidNormalAtE = " << validNormal
558  << G4endl;
559  }
560  return;
561 }
double dot(const Hep3Vector &) const
float perThousand
Definition: hepunit.py:240
G4GLOB_DLL std::ostream G4cout
double mag2() const
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
double mag() const
G4GLOB_DLL std::ostream G4cerr
void G4VIntersectionLocator::SetChordFinderFor ( G4ChordFinder fCFinder)
inline
void G4VIntersectionLocator::SetDeltaIntersectionFor ( G4double  deltaIntersection)
inline
void G4VIntersectionLocator::SetEpsilonStepFor ( G4double  EpsilonStep)
inline
void G4VIntersectionLocator::SetNavigatorFor ( G4Navigator fNavigator)
inline
void G4VIntersectionLocator::SetSafetyParametersFor ( G4bool  UseSafety)
inline
void G4VIntersectionLocator::SetVerboseFor ( G4int  fVerbose)
inline

Field Documentation

G4Navigator* G4VIntersectionLocator::fHelpingNavigator
protected
G4ChordFinder* G4VIntersectionLocator::fiChordFinder
protected

Definition at line 196 of file G4VIntersectionLocator.hh.

G4double G4VIntersectionLocator::fiDeltaIntersection
protected
G4double G4VIntersectionLocator::fiEpsilonStep
protected

Definition at line 197 of file G4VIntersectionLocator.hh.

G4Navigator* G4VIntersectionLocator::fiNavigator
protected

Definition at line 194 of file G4VIntersectionLocator.hh.

G4bool G4VIntersectionLocator::fiUseSafety
protected

Definition at line 199 of file G4VIntersectionLocator.hh.

G4TouchableHistory* G4VIntersectionLocator::fpTouchable
protected

Definition at line 206 of file G4VIntersectionLocator.hh.

Referenced by ~G4VIntersectionLocator().

G4bool G4VIntersectionLocator::fUseNormalCorrection
protected

Definition at line 192 of file G4VIntersectionLocator.hh.

Referenced by AreIntersectionsAdjusted().

G4int G4VIntersectionLocator::fVerboseLevel
protected
G4double G4VIntersectionLocator::kCarTolerance
protected

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