15 #include <Geant4/G4Field.hh>
16 #include <Geant4/G4FieldManager.hh>
17 #include <Geant4/G4PhysicalConstants.hh>
18 #include <Geant4/G4SystemOfUnits.hh>
19 #include <Geant4/G4TransportationManager.hh>
20 #include <Geant4/G4Types.hh>
21 #include <Geant4/G4Vector3D.hh>
30 : is_in_iron(isInIron)
31 , n_steel_plates(steelPlates)
32 , scinti_gap(scintiGap)
33 , tilt_angle(tiltAngle)
44 std::cout <<
"PHG4OuterHcalField::GetFieldValue"
45 <<
" - Error! can not find field manager in G4TransportationManager"
66 const G4Vector3D B0(Bfield[0], Bfield[1], Bfield[2]);
67 const G4Vector3D B0XY(Bfield[0], Bfield[1], 0);
70 const double R = sqrt(x * x + y * y);
72 const double layer_width = layer_RdPhi * cos(
tilt_angle);
74 if (gap_width >= layer_width)
76 std::cout <<
"PHG4OuterHcalField::GetFieldValue gap_width " << gap_width
77 <<
" < layer_width: " << layer_width
78 <<
" existing now, here is some debug info" << std::endl;
79 std::cout <<
"coordinates: x: " << Point[0] /
cm
80 <<
", y: " << Point[1] /
cm
81 <<
", z: " << Point[2] /
cm << std::endl;
83 std::cout <<
"Radius: " << R << std::endl;
84 std::cout <<
"layer_RdPhi: " << layer_RdPhi << std::endl;
85 std::cout <<
"layer_width: " << layer_width << std::endl;
86 std::cout <<
"tilt_angle: " <<
tilt_angle << std::endl;
93 const G4Vector3D radial_dir(cos(atan2(y, x)), sin(atan2(y, x)), 0);
95 const double radial_flux_per_layer = layer_RdPhi * (B0XY.
dot(radial_dir));
100 const G4Vector3D B_New_XY = B_XY_mag * absorber_dir;
102 const double z_flux_per_layer = layer_width * B0Z.
z();
110 Bfield[0] = B_New.
x();
111 Bfield[1] = B_New.
y();
112 Bfield[2] = B_New.
z();
116 std::cout <<
"PHG4OuterHcalField::GetFieldValue"
117 <<
" - Error! can not find detecor field in field manager!"