Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v21.1.8
rev: v22.1.0
hooks:
- id: clang-format
- repo: https://github.com/Lucas-C/pre-commit-hooks
Expand Down
64 changes: 32 additions & 32 deletions src/BarrelTOFTracker_geo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ static Ref_t create_TOFBarrel(Detector& description, xml_h e, SensitiveDetector
xml_comp_t x_comp = mci;
xml_comp_t x_pos = x_comp.position(false);
xml_comp_t x_rot = x_comp.rotation(false);
auto make_box = [&](double width, double length, double thickness, double pos_x = 0,
auto make_box = [&](double width, double length, double thickness, double pos_x = 0,
double pos_y = 0, double pos_z = 0, double rot_x = 0, double rot_y = 0,
double rot_z = 0, bool z_stacking = true, int segmentation_id = 0,
const std::string& suffix = "") {
Expand Down Expand Up @@ -243,12 +243,12 @@ static Ref_t create_TOFBarrel(Detector& description, xml_h e, SensitiveDetector
// The two sides of the "U"
Tube pipe_in(pipe_min_r, pipe_max_r, (length / 2 + std::fabs(bend_y)) / 2);
Volume pipe_in_vol(ci_tube.nameStr() + "_pipe1" + suffix, pipe_in,
description.material(pipe_material));
description.material(pipe_material));
m_vol.placeVolume(pipe_in_vol,
Transform3D(RotationZYX(0, 0, -M_PI / 2),
Position(pos_x - bend_r + pipe_offset_x,
pos_y - coord_factor * (bend_y - length / 2) / 2,
pos_z + zoff)));
Transform3D(RotationZYX(0, 0, -M_PI / 2),
Position(pos_x - bend_r + pipe_offset_x,
pos_y - coord_factor * (bend_y - length / 2) / 2,
pos_z + zoff)));
SubtractionSolid c_sbox1(
c_box, pipe_in,
Transform3D(
Expand All @@ -257,12 +257,12 @@ static Ref_t create_TOFBarrel(Detector& description, xml_h e, SensitiveDetector
// coolant inside the tube
Tube coolant_in(0, pipe_min_r, (length / 2 + std::fabs(bend_y)) / 2);
Volume coolant_in_vol(ci_tube.nameStr() + "_coolant1" + suffix, coolant_in,
description.material(coolant_material));
description.material(coolant_material));
m_vol.placeVolume(coolant_in_vol,
Transform3D(RotationZYX(0, 0, -M_PI / 2),
Position(pos_x - bend_r + pipe_offset_x,
pos_y - coord_factor * (bend_y - length / 2) / 2,
pos_z + zoff)));
Transform3D(RotationZYX(0, 0, -M_PI / 2),
Position(pos_x - bend_r + pipe_offset_x,
pos_y - coord_factor * (bend_y - length / 2) / 2,
pos_z + zoff)));
SubtractionSolid c_sbox2(
c_sbox1, coolant_in,
Transform3D(
Expand All @@ -272,12 +272,12 @@ static Ref_t create_TOFBarrel(Detector& description, xml_h e, SensitiveDetector
// other long side of the tube
Tube pipe_out(pipe_min_r, pipe_max_r, (length / 2 + std::fabs(bend_y)) / 2);
Volume pipe_out_vol(ci_tube.nameStr() + "_pipe2" + suffix, pipe_out,
description.material(pipe_material));
description.material(pipe_material));
m_vol.placeVolume(pipe_out_vol,
Transform3D(RotationZYX(0, 0, -M_PI / 2),
Position(pos_x + bend_r + pipe_offset_x,
pos_y - coord_factor * (bend_y - length / 2) / 2,
pos_z + zoff)));
Transform3D(RotationZYX(0, 0, -M_PI / 2),
Position(pos_x + bend_r + pipe_offset_x,
pos_y - coord_factor * (bend_y - length / 2) / 2,
pos_z + zoff)));
SubtractionSolid c_sbox3(
c_sbox2, pipe_out,
Transform3D(
Expand All @@ -286,12 +286,12 @@ static Ref_t create_TOFBarrel(Detector& description, xml_h e, SensitiveDetector
// coolant inside the tube
Tube coolant_out(0, pipe_min_r, (length / 2 + std::fabs(bend_y)) / 2);
Volume coolant_out_vol(ci_tube.nameStr() + "_coolant2" + suffix, coolant_out,
description.material(coolant_material));
description.material(coolant_material));
m_vol.placeVolume(coolant_out_vol,
Transform3D(RotationZYX(0, 0, -M_PI / 2),
Position(pos_x + bend_r + pipe_offset_x,
pos_y - coord_factor * (bend_y - length / 2) / 2,
pos_z + zoff)));
Transform3D(RotationZYX(0, 0, -M_PI / 2),
Position(pos_x + bend_r + pipe_offset_x,
pos_y - coord_factor * (bend_y - length / 2) / 2,
pos_z + zoff)));
SubtractionSolid c_sbox4(
c_sbox3, coolant_out,
Transform3D(
Expand All @@ -300,28 +300,28 @@ static Ref_t create_TOFBarrel(Detector& description, xml_h e, SensitiveDetector

// the U part of the U-shape
Torus pipe_bend(bend_r, pipe_min_r, pipe_max_r + 0.001, direction == "left" ? M_PI : 0,
M_PI);
M_PI);
Volume pipe_bend_vol(ci_tube.nameStr() + "_pipeU" + suffix, pipe_bend,
description.material(pipe_material));
description.material(pipe_material));
m_vol.placeVolume(pipe_bend_vol,
Transform3D(RotationZYX(0, 0, 0),
Position(pos_x + pipe_offset_x,
pos_y - coord_factor * bend_y, pos_z + zoff)));
Transform3D(RotationZYX(0, 0, 0),
Position(pos_x + pipe_offset_x,
pos_y - coord_factor * bend_y, pos_z + zoff)));

// coolant
Torus coolant_bend(bend_r, 0, pipe_min_r, direction == "left" ? M_PI : 0, M_PI);
Volume coolant_bend_vol(ci_tube.nameStr() + "_coolantU" + suffix, coolant_bend,
description.material(coolant_material));
description.material(coolant_material));
m_vol.placeVolume(coolant_bend_vol,
Transform3D(RotationZYX(0, 0, 0),
Position(pos_x + pipe_offset_x,
pos_y - coord_factor * bend_y, pos_z + zoff)));
Transform3D(RotationZYX(0, 0, 0),
Position(pos_x + pipe_offset_x,
pos_y - coord_factor * bend_y, pos_z + zoff)));

// carve out the U-bent from stave
Torus coolant_bend_carveout(bend_r, 0, pipe_max_r, direction == "left" ? M_PI : 0, M_PI);
SubtractionSolid c_sbox5(c_sbox4, coolant_bend_carveout,
Transform3D(RotationZYX(0, 0, 0),
Position(pipe_offset_x, -coord_factor * bend_y, 0)));
Transform3D(RotationZYX(0, 0, 0),
Position(pipe_offset_x, -coord_factor * bend_y, 0)));

c_vol = Volume(c_nam, c_sbox5, description.material(x_comp.materialStr()));
} else
Expand Down
8 changes: 4 additions & 4 deletions src/DRICH_geo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec
auto radiatorPos = Position(0., 0., radiatorFrontplane + 0.5 * aerogelThickness) + originFront;
auto aerogelPlacement = Translation3D(radiatorPos) * // re-center to originFront
RotationY(radiatorPitch); // change polar angle to specified pitch
auto aerogelPV = gasvolVol.placeVolume(aerogelVol, aerogelPlacement);
auto aerogelPV = gasvolVol.placeVolume(aerogelVol, aerogelPlacement);
DetElement aerogelDE(det, "aerogel_de", 0);
aerogelDE.setPlacement(aerogelPV);

Expand Down Expand Up @@ -769,9 +769,9 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec
pduAssemblyPlacement * // position of PDU in vessel
sensorAssemblyPlacement * // position of SiPM in PDU
pduOrigin;
auto pduPos = Translation3D(vesselPos) * // position of vessel in world
pduAssemblyPlacement * // position of PDU in vessel
pduOrigin;
auto pduPos = Translation3D(vesselPos) * // position of vessel in world
pduAssemblyPlacement * // position of PDU in vessel
pduOrigin;
// - sensor surface basis: the orientation of the sensor surface
// NOTE: all sensors of a single PDU have the same surface orientation, but to avoid
// loss of generality downstream, define the basis for each sensor
Expand Down
2 changes: 1 addition & 1 deletion src/EndcapTOF_geo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s

float ycoord = envelope.rmax() -
module_y / 2.; // y-center-coord of the top sensor. Start from the top row
int iy = 0;
int iy = 0;

for (xml_coll_t lrow(x_layout, _Unicode(row)); lrow; ++lrow) {
xml_comp_t x_row = lrow;
Expand Down
6 changes: 3 additions & 3 deletions src/FieldMapB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,9 @@ void FieldMapB::fieldComponents(const double* pos, double* field) {

// convert Br Bz to Bx By Bz and rotate field
const float phi = atan2(p.y(), p.x());
auto B = fieldRot.has_value()
? fieldRot.value() * ROOT::Math::XYZPoint(Br * cos(phi), Br * sin(phi), Bz)
: ROOT::Math::XYZPoint(Br * cos(phi), Br * sin(phi), Bz);
auto B = fieldRot.has_value()
? fieldRot.value() * ROOT::Math::XYZPoint(Br * cos(phi), Br * sin(phi), Bz)
: ROOT::Math::XYZPoint(Br * cos(phi), Br * sin(phi), Bz);
field[0] += B.x();
field[1] += B.y();
field[2] += B.z();
Expand Down
2 changes: 1 addition & 1 deletion src/InsertCalorimeter_geo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens
*/
double hole_radius_slope = (hole_radii_parameters.second - hole_radii_parameters.first) /
(length - backplate_thickness);
double hole_radius_at_z = hole_radius_slope * z_pos + hole_radii_parameters.first;
double hole_radius_at_z = hole_radius_slope * z_pos + hole_radii_parameters.first;

double hole_xpos_slope =
(hole_x_parameters.second - hole_x_parameters.first) / (length - backplate_thickness);
Expand Down
4 changes: 2 additions & 2 deletions src/LFHCAL_geo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1162,8 +1162,8 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens

Volume motherVol = desc.pickMotherVolume(det);
phv = env_vol.placeVolume(assembly);
phv = motherVol.placeVolume(env_vol,
Transform3D(Position(pos.x(), pos.y(), pos.z() + length / 2.)));
phv = motherVol.placeVolume(env_vol,
Transform3D(Position(pos.x(), pos.y(), pos.z() + length / 2.)));
phv.addPhysVolID("system", detID);
det.setPlacement(phv);

Expand Down
12 changes: 6 additions & 6 deletions src/forwardEcal_geo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ double yBlock(int ns, int row) {
}

static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens) {
blocksize = desc.constant<double>("EcalEndcapP_blockSize");
blockgap = desc.constant<double>("EcalEndcapP_spaceBetweenBlock");
double nsgap = desc.constant<double>("EcalEndcapP_xOffsetNorth") +
desc.constant<double>("EcalEndcapP_xOffsetSouth");
blocksize = desc.constant<double>("EcalEndcapP_blockSize");
blockgap = desc.constant<double>("EcalEndcapP_spaceBetweenBlock");
double nsgap = desc.constant<double>("EcalEndcapP_xOffsetNorth") +
desc.constant<double>("EcalEndcapP_xOffsetSouth");
double rmin = 0.0; // Dummy variable. Set to 0 since cutting out insert
double rmax = desc.constant<double>("EcalEndcapP_rmax");
double rmaxWithGap = desc.constant<double>("EcalEndcapP_rmaxWithGap");
Expand Down Expand Up @@ -242,8 +242,8 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens
double xrow =
(xBlock(ns, r, 0) + xBlock(ns, r, nColBlock - 1)) / 2.0 - pm[ns] * nsgap / 2.0;
double yrow = yBlock(ns, r);
pv = half_vol.placeVolume(row_vol,
Transform3D(RotationZYX(0, 0, 0), Position(xrow, yrow, 0)));
pv = half_vol.placeVolume(row_vol,
Transform3D(RotationZYX(0, 0, 0), Position(xrow, yrow, 0)));
pv.addPhysVolID("blockrow", r);

//column of blocks
Expand Down
4 changes: 2 additions & 2 deletions src/magnetVacuumFF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens *
double specialGapLength = sqrt(pow(z_beg[0] - endOfCentralBeamPipe_z, 2) +
pow(x_beg[0] - endOfCentralBeamPipe_x, 2)) -
0.1;
double specialGap_z = 0.5 * specialGapLength * cos(crossingAngle) + endOfCentralBeamPipe_z;
double specialGap_x = 0.5 * specialGapLength * sin(crossingAngle) + endOfCentralBeamPipe_x;
double specialGap_z = 0.5 * specialGapLength * cos(crossingAngle) + endOfCentralBeamPipe_z;
double specialGap_x = 0.5 * specialGapLength * sin(crossingAngle) + endOfCentralBeamPipe_x;

std::string piece_name = Form("GapVacuum%d", numGaps + numMagnets);

Expand Down
Loading