12 #include <klm/eklm/geometry/G4TriangularPrism.h>
15 #include <CLHEP/Units/SystemOfUnits.h>
24 double r1,
double phi1,
25 double r2,
double phi2,
38 m_tube =
new G4Tubs(
"Tube_" + name, 0., std::max(r1, r2), halfZlen,
39 phi1, fabs(phi2 - phi1));
40 }
catch (std::bad_alloc& ba) {
50 delta_phi = phi2 - phi1;
51 tg_alpha = (rl / rs - cos(delta_phi)) / sin(delta_phi);
52 alpha = atan(tg_alpha);
53 sin_alpha = tg_alpha / sqrt(1.0 + tg_alpha * tg_alpha);
54 cos_alpha = 1.0 / sqrt(1.0 + tg_alpha * tg_alpha);
56 m_box =
new G4Box(
"Box_" + name, rl * sin_alpha,
57 rl * cos_alpha, halfZlen);
58 }
catch (std::bad_alloc& ba) {
62 t = G4RotateZ3D((phi1 + alpha) * CLHEP::rad - 90.0 * CLHEP::deg);
64 t = G4RotateZ3D((phi2 - alpha) * CLHEP::rad + 90.0 * CLHEP::deg);
67 }
catch (std::bad_alloc& ba) {
76 throw (std::bad_alloc());