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");
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");
47 for (
GearDir& sensor : position.getNodes(
"phi")) {
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 if (not shape) shape =
new G4Box(
"radiationSensorDiamond", width / 2 * CLHEP::cm, length / 2 * CLHEP::cm, height / 2 * CLHEP::cm);
55 G4LogicalVolume* volume =
new G4LogicalVolume(shape, material, name);
58 volume->SetSensitiveDetector(sensitive);
60 G4Transform3D transform = G4RotateZ3D(phi - M_PI / 2) * G4Translate3D(0, r * CLHEP::cm,
61 z * CLHEP::cm) * G4RotateX3D(-M_PI / 2 - theta);
62 new G4PVPlacement(transform, volume, name, top,
false, 1);