Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ChordFinderSaf.cc File Reference
#include "G4ChordFinderSaf.hh"
#include <iomanip>

Go to the source code of this file.

Functions

G4double CalculatePointSafety (G4ThreeVector safetyOrigin, G4double safetyRadius, G4ThreeVector point)
 
G4bool CalculatePointInside (G4ThreeVector safetyOrigin, G4double safetyRadius, G4ThreeVector point)
 

Function Documentation

◆ CalculatePointInside()

G4bool CalculatePointInside ( G4ThreeVector  safetyOrigin,
G4double  safetyRadius,
G4ThreeVector  point 
)

Definition at line 109 of file G4ChordFinderSaf.cc.

112{
113 G4ThreeVector OriginShift = point - safetyOrigin ;
114 return ( OriginShift.mag2() < safetyRadius*safetyRadius );
115}
double mag2() const

Referenced by G4ChordFinderSaf::FindNextChord().

◆ CalculatePointSafety()

G4double CalculatePointSafety ( G4ThreeVector  safetyOrigin,
G4double  safetyRadius,
G4ThreeVector  point 
)

Definition at line 92 of file G4ChordFinderSaf.cc.

95{
96 G4double pointSafety= 0.0;
97
98 G4ThreeVector OriginShift = point - safetyOrigin ;
99 G4double MagSqShift = OriginShift.mag2() ;
100 if( MagSqShift < sqr(safetyRadius) ){
101 pointSafety = safetyRadius - std::sqrt(MagSqShift) ;
102 }
103
104 return pointSafety;
105}
double G4double
Definition: G4Types.hh:64
T sqr(const T &x)
Definition: templates.hh:145

Referenced by G4ChordFinderSaf::FindNextChord().