10#include <klm/eklm/geometry/G4TriangularPrism.h>
13#include <CLHEP/Units/SystemOfUnits.h>
22 double r1,
double phi1,
23 double r2,
double phi2,
36 m_tube =
new G4Tubs(
"Tube_" + name, 0., std::max(r1, r2), halfZlen,
37 phi1, fabs(phi2 - phi1));
38 }
catch (std::bad_alloc& ba) {
48 delta_phi = phi2 - phi1;
49 tg_alpha = (rl / rs - cos(delta_phi)) / sin(delta_phi);
50 alpha =
atan(tg_alpha);
51 sin_alpha = tg_alpha /
sqrt(1.0 + tg_alpha * tg_alpha);
52 cos_alpha = 1.0 /
sqrt(1.0 + tg_alpha * tg_alpha);
54 m_box =
new G4Box(
"Box_" + name, rl * sin_alpha,
55 rl * cos_alpha, halfZlen);
56 }
catch (std::bad_alloc& ba) {
60 t = G4RotateZ3D((phi1 + alpha) * CLHEP::rad - 90.0 * CLHEP::deg);
62 t = G4RotateZ3D((phi2 - alpha) * CLHEP::rad + 90.0 * CLHEP::deg);
65 }
catch (std::bad_alloc& ba) {
74 throw (std::bad_alloc());
G4IntersectionSolid * m_is
Intersection.
G4TriangularPrism(const G4String &name, double r1, double phi1, double r2, double phi2, G4double halfZlen)
Constructor.
~G4TriangularPrism()
Destructor.
double atan(double a)
atan for double
double sqrt(double a)
sqrt for double
Abstract base class for different kinds of events.