163 G4double rightJawHalfGap =
xHalfGap;
186 G4double vacuumWidth = 0.5 * (leftJawHalfGap + rightJawHalfGap);
189 G4double leftJawCentre = 0.5*leftJawWidth + leftJawHalfGap;
190 G4double rightJawCentre = 0.5*rightJawWidth + rightJawHalfGap;
191 G4double vacuumCentre = 0.5*(leftJawHalfGap - rightJawHalfGap);
193 G4ThreeVector leftJawPos = G4ThreeVector(leftJawCentre, 0, 0);
194 G4ThreeVector rightJawPos = G4ThreeVector(-rightJawCentre, 0, 0);
195 G4ThreeVector vacuumOffset = G4ThreeVector(vacuumCentre, 0, 0);
197 G4VisAttributes* collimatorVisAttr =
new G4VisAttributes(*
colour);
198 G4VisAttributes* tipVisAttr =
new G4VisAttributes(*
tipColour);
209 G4VSolid* leftJawSolid =
nullptr;
210 G4VSolid* leftJawTipSolid =
nullptr;
219 leftJawSolid =
new G4Para(
name +
"_leftjaw_solid",
227 leftJawTipSolid =
new G4Para(
name +
"_leftjawtip_solid",
237 leftJawSolid =
new G4Box(
name +
"_leftjaw_solid",
242 leftJawTipSolid =
new G4Box(
name +
"_leftjawtip_solid",
251 G4LogicalVolume* leftJawLV =
new G4LogicalVolume(leftJawSolid,
253 name +
"_leftjaw_lv");
254 leftJawLV->SetVisAttributes(collimatorVisAttr);
257 leftJawLV->SetUserLimits(collUserLimits);
262 BDSAcceleratorModel::Instance()->
VolumeSet(
"collimators")->insert(leftJawLV);
266 G4LogicalVolume* leftJawTipLV =
new G4LogicalVolume(leftJawTipSolid,
268 name +
"_leftjawtip_lv");
269 leftJawTipLV->SetVisAttributes(tipVisAttr);
270 leftJawTipLV->SetUserLimits(collUserLimits);
272 BDSAcceleratorModel::Instance()->
VolumeSet(
"collimators")->insert(leftJawTipLV);
277 G4PVPlacement* leftJawTipPV =
new G4PVPlacement(
nullptr,
278 leftJawPos - G4ThreeVector((leftJawWidth -
tipThickness) * 0.5, 0, 0),
280 name +
"_leftjawtip_pv",
281 containerLogicalVolume,
288 G4PVPlacement* leftJawPV =
new G4PVPlacement(
nullptr,
291 name +
"_leftjaw_pv",
292 containerLogicalVolume,
300 G4VSolid* rightJawSolid =
nullptr;
301 G4VSolid* rightJawTipSolid =
nullptr;
310 rightJawSolid =
new G4Para(
name +
"_rightjaw_solid",
318 rightJawTipSolid =
new G4Para(
name +
"_rightjawtip_solid",
328 rightJawSolid =
new G4Box(
name +
"_rightjaw_solid",
333 rightJawTipSolid =
new G4Box(
name +
"_rightjawtip_solid",
342 G4LogicalVolume* rightJawLV =
new G4LogicalVolume(rightJawSolid,
344 name +
"_rightjaw_lv");
345 rightJawLV->SetVisAttributes(collimatorVisAttr);
348 rightJawLV->SetUserLimits(collUserLimits);
353 BDSAcceleratorModel::Instance()->
VolumeSet(
"collimators")->insert(rightJawLV);
357 G4LogicalVolume* rightJawTipLV =
new G4LogicalVolume(rightJawTipSolid,
359 name +
"_rightjawtip_lv");
360 rightJawTipLV->SetVisAttributes(tipVisAttr);
361 rightJawTipLV->SetUserLimits(collUserLimits);
363 BDSAcceleratorModel::Instance()->
VolumeSet(
"collimators")->insert(rightJawTipLV);
368 G4PVPlacement* rightJawTipPV =
new G4PVPlacement(
nullptr,
369 rightJawPos + G4ThreeVector((rightJawWidth -
tipThickness) * 0.5, 0, 0),
371 name +
"_rightjawtip_pv",
372 containerLogicalVolume,
379 G4PVPlacement* rightJawPV =
new G4PVPlacement(
nullptr,
382 name +
"_rightjaw_pv",
383 containerLogicalVolume,
401 collimatorLV->SetVisAttributes(collimatorVisAttr);
412 G4PVPlacement* collimatorPV =
new G4PVPlacement(
nullptr,
416 containerLogicalVolume,
434 G4double halfLengthLeftEff = (
chordLength * 0.5) / std::cos(tiltLeft);
435 G4double halfLengthRightEff = (
chordLength * 0.5) / std::cos(tiltRight);
439 G4double xGapLeftUpstream = -halfLengthLeftEff * std::sin(tiltLeft) + leftJawHalfGap;
440 G4double xGapLeftDownstream = halfLengthLeftEff * std::sin(tiltLeft) + leftJawHalfGap;
441 G4double xGapRightUpstream = -halfLengthRightEff * std::sin(tiltRight) - rightJawHalfGap;
442 G4double xGapRightDownstream = halfLengthRightEff * std::sin(tiltRight) - rightJawHalfGap;
458 vacuumOffset = G4ThreeVector(0, 0, 0);
470 G4LogicalVolume* vacuumLV =
new G4LogicalVolume(
vacuumSolid,
472 name +
"_vacuum_lv");
481 G4PVPlacement* vacPV =
new G4PVPlacement(
nullptr,
485 containerLogicalVolume,