43 fval(0),
pos(0), slope(0), intercept(0)
52 G4cout <<
" ==> Opening file " << filename <<
" to read magnetic field..."
54 G4String pathName = getenv(
"CCAL_GLOBALPATH");
60 is >> fval >> npts >> xoff;
63 G4cout <<
"Field value " << fval <<
" # points " << npts <<
72 for (
G4int i = 0; i < npts; i++) {
73 is >> pos[i] >> slope[i] >> intercept[i];
75 G4cout <<
tab <<
"Position " << i <<
" " << pos[i] <<
" Slope "
76 << slope[i] <<
" Intercept " << intercept[i] <<
G4endl;
103 for (i=0; i<2; i++) {
111 for (i=0; i<npts; i++) {
112 if (xnew > pos[i]*
mm) {
119 if (scor < 0.) scor = 0.;
120 if (scor > 1.) scor = 1.0;
126 G4cout <<
"Field at x: " << x[0]/
mm <<
"mm (" << xnew <<
") = " <<
128 <<
"T (m = " << m1 <<
", c = " <<
129 c1 <<
", scale = " << scor <<
")"
static constexpr double tesla
static constexpr double mm
bool openGeomFile(std::ifstream &is, const G4String &pathname, const G4String &filename)
virtual void GetFieldValue(const double Point[3], double *Bfield) const
double B(double temperature)
std::ifstream & findDO(std::ifstream &, const G4String &)
G4GLOB_DLL std::ostream G4cout
static constexpr double m
static constexpr double kilogauss
std::ostream & tab(std::ostream &)
void MagneticField(const double Point[3], double Bfield[3]) const
CCalMagneticField(const G4String &name)
static const G4double pos