Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
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

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

Definition at line 109 of file G4ChordFinderSaf.cc.

References CLHEP::Hep3Vector::mag2().

Referenced by G4ChordFinderSaf::FindNextChord().

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

Definition at line 92 of file G4ChordFinderSaf.cc.

References CLHEP::Hep3Vector::mag2(), and sqr().

Referenced by G4ChordFinderSaf::FindNextChord().

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 mag2() const
T sqr(const T &x)
Definition: templates.hh:145
double G4double
Definition: G4Types.hh:76