4 #include <phparameter/PHParameters.h>
14 #include <Geant4/G4ChordFinder.hh>
15 #include <Geant4/G4ClassicalRK4.hh>
16 #include <Geant4/G4FieldManager.hh>
17 #include <Geant4/G4LogicalVolume.hh>
18 #include <Geant4/G4Mag_UsualEqRhs.hh>
19 #include <Geant4/G4MagneticField.hh>
20 #include <Geant4/G4PVPlacement.hh>
21 #include <Geant4/G4PhysicalConstants.hh>
22 #include <Geant4/G4QuadrupoleMagField.hh>
23 #include <Geant4/G4RotationMatrix.hh>
24 #include <Geant4/G4SystemOfUnits.hh>
25 #include <Geant4/G4ThreeVector.hh>
26 #include <Geant4/G4Transform3D.hh>
27 #include <Geant4/G4Tubs.hh>
28 #include <Geant4/G4Types.hh>
29 #include <Geant4/G4UniformMagField.hh>
43 , m_Params(parameters)
45 , m_MagnetId(magnet_id)
105 std::cout << __PRETTY_FUNCTION__ <<
": set field using the global coordinate system, as the magnet is a daughter vol. of "
123 if (magnettype ==
"DIPOLE")
135 std::cout <<
"Creating DIPOLE with field x: " << field.x() /
tesla
136 <<
", y: " << field.y() /
tesla
137 <<
", z: " << field.z() /
tesla
138 <<
" and name " <<
GetName() << std::endl;
141 else if (magnettype ==
"QUADRUPOLE")
152 std::cout <<
"Creating QUADRUPOLE with gradient " << fieldGradient <<
" and name " <<
GetName() << std::endl;
153 std::cout <<
"at x, y, z = " << field_origin.
x() <<
" , " << field_origin.
y() <<
" , " << field_origin.
z() << std::endl;
154 std::cout <<
"with rotation around x, y, z axis by: " << field_rotm->
phiX() <<
", " << field_rotm->
phiY() <<
", " << field_rotm->
phiZ() << std::endl;
159 std::cout << __PRETTY_FUNCTION__ <<
" : Fatal error, magnet type of " << magnettype <<
" is not yet supported" << std::endl;
165 std::cout <<
PHWHERE <<
" No magnetic field specified for " <<
GetName()
166 <<
" of type " << magnettype << std::endl;
185 std::cout <<
"Magnet skin thickness " <<
m_Params->
get_double_param(
"skin_thickness") <<
" too large, exceeds 2xmagnet thickness "