12 {
13
14 const double x = pt.v.x * conv + m_x;
15 const double y = pt.v.y * conv + m_y;
16 const double z = pt.v.z * conv + m_z;
17
18
22 mrange = DBL_MAX;
23
24 if (!m_sensor) {
25 std::cerr << "HeedFieldMap::field_map: Sensor not defined.\n";
26 return;
27 }
28
29 if (m_useEfield) {
30 double ex = 0., ey = 0., ez = 0.;
31 int status = 0;
32 Garfield::Medium* m = nullptr;
33 m_sensor->ElectricField(x, y, z, ex, ey, ez, m, status);
34 constexpr double voltpercm = CLHEP::volt / CLHEP::cm;
38 }
39
40 if (m_useBfield) {
41 double bx = 0., by = 0., bz = 0.;
42 int status = 0;
43 m_sensor->MagneticField(x, y, z, bx, by, bz, status);
44 bfield.x = bx * CLHEP::tesla;
45 bfield.y = by * CLHEP::tesla;
46 bfield.z = bz * CLHEP::tesla;
47 }
48}