80 bool active = parameters.getRecordBackground();
83 std::map<std::string, VXDGeoComponent> boxes;
87 boxtype.getMaterial(),
"",
88 boxtype.getWidth() / 2.0 /
Unit::mm, 0,
89 boxtype.getLength() / 2.0 /
Unit::mm,
90 boxtype.getHeight() / 2.0 /
Unit::mm);
91 const std::string name = boxtype.getName();
94 B2DEBUG(50,
"Created " << name <<
" DockBox with a mass of " << (box.
getVolume()->GetMass(
true) / CLHEP::kg) <<
"kg");
96 int identifier = boxtype.getIdentifier();
97 B2DEBUG(50,
"Creating BkgSensitiveDetector for DockBox " << name <<
" with identifier " << identifier);
99 box.
getVolume()->SetSensitiveDetector(sensitive);
106 const double minZ = position.getMinZ() /
Unit::mm;
107 const double maxZ = position.getMaxZ() /
Unit::mm;
108 const double minR = position.getMinR() /
Unit::mm;
109 const double maxR = position.getMaxR() /
Unit::mm;
110 const int divisions = position.getDivisions();
111 const std::string name =
"VXD.DockBoxes." + position.getName();
115 const int signZ = minZ < 0 ? -1 : +1;
116 double startPhiAngle = 0;
117 double deltaAngle = 2 * M_PI;
119 startPhiAngle = 0.35;
120 deltaAngle = 2 * M_PI - startPhiAngle;
122 G4VSolid* shape_envelope =
new G4Tubs(name, minR, maxR, (maxZ - minZ) / 2.0, startPhiAngle, deltaAngle);
123 G4LogicalVolume* envelope =
new G4LogicalVolume(shape_envelope,
m_defaultMaterial, name);
124 new G4PVPlacement(G4TranslateZ3D((minZ + maxZ) / 2.0), envelope, name, &topVolume,
false, 1);
128 for (
const VXDSlotsPar& slot : position.getSlots()) {
129 const std::string type = slot.getType();
131 if (!box.
getVolume()) B2FATAL(
"Unknown DockBox type: " << type);
132 for (
double number : slot.getSlotNumbers()) {
133 const double angle = (2 * M_PI / divisions) * (number + 0.5);
137 const double z = -signZ * ((maxZ - minZ) / 2.0 - box.
getLength());
138 const G4Transform3D placement = G4RotateZ3D(angle) * G4Translate3D(r, 0, z);
139 new G4PVPlacement(placement, box.
getVolume(), name +
".box", envelope,
false,
static_cast<int>(number));