Skip to content
Open
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
5 changes: 3 additions & 2 deletions subsystems/TimingDetector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ The TimingDetector subsystem implements 330 scintillator bars (3 columns x 110 r
## Geometry Tree

```
Timing_Detector (Air, 5500×6500×500 mm)
Timing_Detector (Air, 5500×6500×460 mm)
└─ 330 × scintillator bars (1400×60×10 mm each)
3 columns × 110 rows; z stagger = (row%2)·12 + (col%2)·90 mm
3 columns × 110 rows; z stagger = (row%2)·12 + (col%2)·90 mm,
bar layer at the front of the container
```

Position in world: z = 95902 mm.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class SHiPMaterials;
* "/SHiP/timing_detector/bar_<col>_<row>" names; sensitive-detector assignment
* is performed downstream by name pattern.
*
* Container half-sizes (mm): 2750 × 3250 × 250.
* Container half-sizes (mm): 2750 × 3250 × 230.
* Bar half-sizes (mm): 700 × 30 × 5.
* Z stagger (mm): z = (row%2)·12 + (col%2)·90 → levels 0/12/90/102.
*/
Expand All @@ -39,10 +39,12 @@ class TimingDetectorFactory {
SHiPMaterials& m_materials;
int m_barCount{0};

// Container dimensions
// Container dimensions. The length is the 0.46 m slot of the integration
// layout 2026-0.1 (EDMS 3287817 v1.1); the bar layer sits at the front
// of the slot, where the CAD model ST1967028_01 has the first bar layer.
static constexpr double s_containerHalfX = 2750.0 * GeoModelKernelUnits::mm;
static constexpr double s_containerHalfY = 3250.0 * GeoModelKernelUnits::mm;
static constexpr double s_containerHalfZ = 250.0 * GeoModelKernelUnits::mm;
static constexpr double s_containerHalfZ = 230.0 * GeoModelKernelUnits::mm;
Comment thread
coderabbitai[bot] marked this conversation as resolved.

// Bar dimensions
static constexpr double s_barHalfX = 700.0 * GeoModelKernelUnits::mm; // 140 cm full length
Expand Down
6 changes: 4 additions & 2 deletions subsystems/TimingDetector/src/TimingDetectorFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@
// 3 columns × 110 rows = 330 bars. Positions are analytic:
// x = (ic - 1) * pitch → -1300, 0, +1300 mm
// y = y0 + ir * step → -3220 … +3220 mm (step 6440/109)
// z = (ir%2)*12 + (ic%2)*90 → 4 stagger levels: 0, 12, 90, 102 mm
// z = (ir%2)*12 + (ic%2)*90 → 4 stagger levels: 0, 12, 90, 102 mm,
// measured from the front face of the slot
m_barCount = 0;
for (int ic = 0; ic < s_nColumns; ++ic) {
const double x = (ic - 1) * s_columnPitchX;
for (int ir = 0; ir < s_nRows; ++ir) {
const double y = s_rowY0 + ir * s_rowStepY;
const double z = (ir % 2) * s_zStaggerRow + (ic % 2) * s_zStaggerCol;
const double z = -s_containerHalfZ + s_barHalfZ + (ir % 2) * s_zStaggerRow +

Check warning on line 45 in subsystems/TimingDetector/src/TimingDetectorFactory.cpp

View workflow job for this annotation

GitHub Actions / clang-tidy / clang-tidy

readability-math-missing-parentheses

'*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations
(ic % 2) * s_zStaggerCol;

Check warning on line 46 in subsystems/TimingDetector/src/TimingDetectorFactory.cpp

View workflow job for this annotation

GitHub Actions / clang-tidy / clang-tidy

readability-math-missing-parentheses

'*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations
const std::string name =
"/SHiP/timing_detector/bar_" + std::to_string(ic) + "_" + std::to_string(ir);
containerPhys->add(new GeoNameTag(name));
Expand Down
Loading