26 G4LogicalVolume* top = &topVolume;
27 if (content.getBool(
"insideEnvelope")) {
28 top = &envelopeVolume;
32 const double width = content.getLength(
"width");
33 const double length = content.getLength(
"length");
34 const double height = content.getLength(
"height");
39 for (
GearDir& position : content.getNodes(
"position")) {
41 const double r = position.getLength(
"radius");
42 const double z = position.getLength(
"z");
43 const double theta = position.getAngle(
"theta");
45 for (
GearDir& sensor : position.getNodes(
"phi")) {
47 const double phi = sensor.getAngle();
48 const int id = sensor.getInt(
"@id");
50 const std::string name =
m_subdetector +
".DiamondSensor." + std::to_string(
id);
52 if (not shape) shape =
new G4Box(
"radiationSensorDiamond", width / 2 * CLHEP::cm, length / 2 * CLHEP::cm, height / 2 * CLHEP::cm);
53 G4LogicalVolume* volume =
new G4LogicalVolume(shape, material, name);
56 volume->SetSensitiveDetector(sensitive);
58 G4Transform3D transform = G4RotateZ3D(phi - M_PI / 2) * G4Translate3D(0, r * CLHEP::cm,
59 z * CLHEP::cm) * G4RotateX3D(-M_PI / 2 - theta);
60 new G4PVPlacement(transform, volume, name, top,
false, 1);