11 #include <vxd/geometry/GeoVXDRadiationSensors.h>
12 #include <geometry/Materials.h>
14 #include <CLHEP/Units/SystemOfUnits.h>
16 #include <G4PVPlacement.hh>
17 #include <simulation/background/BkgSensitiveDetector.h>
28 G4LogicalVolume* top = &topVolume;
29 if (content.getBool(
"insideEnvelope")) {
30 top = &envelopeVolume;
34 const double width = content.getLength(
"width");
35 const double length = content.getLength(
"length");
36 const double height = content.getLength(
"height");
37 G4Box* shape =
new G4Box(
"radiationSensorDiamond", width / 2 * CLHEP::cm, length / 2 * CLHEP::cm, height / 2 * CLHEP::cm);
41 for (
GearDir& position : content.getNodes(
"position")) {
43 const double r = position.getLength(
"radius");
44 const double z = position.getLength(
"z");
45 const double theta = position.getAngle(
"theta");
49 const double phi = sensor.getAngle();
50 const int id = sensor.getInt(
"@id");
52 const std::string name =
m_subdetector +
".DiamondSensor." + std::to_string(
id);
54 G4LogicalVolume* volume =
new G4LogicalVolume(shape, material, name);
57 volume->SetSensitiveDetector(sensitive);
59 G4Transform3D transform = G4RotateZ3D(phi - M_PI / 2) * G4Translate3D(0, r * CLHEP::cm,
60 z * CLHEP::cm) * G4RotateX3D(-M_PI / 2 - theta);
61 new G4PVPlacement(transform, volume, name, top,
false, 1);