60 double stepSize = content.getLength(
"stepSize", 5 * CLHEP::um);
62 G4VisAttributes* red =
new G4VisAttributes(G4Colour(1, 0, 0));
63 red->SetForceAuxEdgeVisible(
true);
64 G4VisAttributes* green =
new G4VisAttributes(G4Colour(0, 1, 0));
65 green->SetForceAuxEdgeVisible(
true);
66 G4VisAttributes* gray =
new G4VisAttributes(G4Colour(.5, .5, .5));
67 gray->SetForceAuxEdgeVisible(
true);
68 G4VisAttributes* coppercolor =
new G4VisAttributes(G4Colour(218. / 255., 138. / 255., 103. / 255.));
69 coppercolor->SetForceAuxEdgeVisible(
true);
72 for (
const GearDir& activeParams : content.getNodes(
"Active")) {
73 int phase = activeParams.getInt(
"phase");
74 G4double dx_scint = activeParams.getLength(
"dx_scint") / 2.*CLHEP::cm;
75 G4double dy_scint = activeParams.getLength(
"dy_scint") / 2.*CLHEP::cm;
76 G4double dz_scint = activeParams.getLength(
"dz_scint") / 2.*CLHEP::cm;
77 double thetaZ = activeParams.getAngle(
"ThetaZ");
78 G4VSolid* s_scint =
new G4Box(
"s_scint", dx_scint, dy_scint, dz_scint);
80 l_scint->SetVisAttributes(green);
82 l_scint->SetUserLimits(
new G4UserLimits(stepSize));
90 for (
double x : activeParams.getArray(
"x", {0})) {
96 for (
double y : activeParams.getArray(
"y", {0})) {
103 for (
double z : activeParams.getArray(
"z", {0})) {
108 r_pos[dim] =
sqrt(x_pos[dim] * x_pos[dim] + y_pos[dim] * y_pos[dim]);
115 for (
double r : activeParams.getArray(
"r", {0})) {
117 r_pos[dim] = r + dz_scint;
120 for (
int i = 0; i < 100; i++) {
128 G4Transform3D transform;
129 for (
double phi : activeParams.getArray(
"Phi", {M_PI / 2})) {
131 for (
int i = 0; i < dim; i++) {
133 transform = G4RotateZ3D(phi - M_PI / 2) * G4Translate3D(0, r_pos[i], z_pos[i]) * G4RotateX3D(-M_PI / 2 - thetaZ);
137 transform = G4Translate3D(x_pos[i], y_pos[i], z_pos[i]) * G4RotateZ3D(phi) * G4RotateX3D(thetaZ);
142 new G4PVPlacement(transform, l_scint, TString::Format(
"p_scint_%d", detID).Data(), &topVolume,
false, detID);
143 B2INFO(
"QCSS-" << detID <<
" placed at: " << transform.getTranslation() <<
" mm ");