43 fval(0),
pos(0), slope(0), intercept(0)
52 G4cout <<
" ==> Opening file " << filename <<
" to read magnetic field..."
54 G4String pathName = getenv(
"CCAL_GLOBALPATH");
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 <<
")"
bool openGeomFile(std::ifstream &is, const G4String &pathname, const G4String &filename)
virtual void GetFieldValue(const double Point[3], double *Bfield) const
std::ifstream & findDO(std::ifstream &, const G4String &)
G4GLOB_DLL std::ostream G4cout
std::ostream & tab(std::ostream &)
void MagneticField(const double Point[3], double Bfield[3]) const
static const double tesla
static const double kilogauss
CCalMagneticField(const G4String &name)
static const G4double pos