LDMX Software
TrigScintGeometry.cxx
2
3namespace ldmx {
4
6 : framework::ConditionsObject(TrigScintGeometry::CONDITIONS_OBJECT_NAME) {
7 module_z_ = ps.get<std::vector<double>>("module_z");
8 y0_ = ps.get<double>("y0");
9 layer_pitch_ = ps.get<double>("layer_pitch");
10 layer_y_shift_ = ps.get<double>("layer_y_shift");
11 layer_z_sep_ = ps.get<double>("layer_z_sep");
12 n_bars_ = ps.get<int>("n_bars");
13}
14
15ROOT::Math::XYZVector TrigScintGeometry::getBarPosition(int module,
16 int bar) const {
17 if (module < 0 || module >= static_cast<int>(module_z_.size())) {
18 EXCEPTION_RAISE("TrigScintGeometry",
19 "Requested module " + std::to_string(module) +
20 " is out of range [0," +
21 std::to_string(module_z_.size()) + ").");
22 }
23 if (bar < 0 || bar >= n_bars_) {
24 EXCEPTION_RAISE("TrigScintGeometry", "Requested bar " +
25 std::to_string(bar) +
26 " is out of range [0," +
27 std::to_string(n_bars_) + ").");
28 }
29
30 // two staggered layers: bar/2 = in-layer index, bar%2 = layer
31 const int in_layer = bar / 2;
32 const int layer = bar % 2;
33 const double y = y0_ - (layer_pitch_ * in_layer + layer_y_shift_ * layer);
34 const double z = module_z_[module] + (layer == 1 ? 0.5 : -0.5) * layer_z_sep_;
35 return ROOT::Math::XYZVector(0.0, y, z);
36}
37
38} // namespace ldmx
Class that translates a trigger-scintillator (module, bar) into a global bar-center position.
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:26
const T & get(const std::string &name) const
Retrieve the parameter of the given name.
Definition Parameters.h:75
Bar-center positions of the trigger-scintillator modules.
double layer_z_sep_
z separation between the two layers within a module [mm]
double layer_pitch_
in-layer y pitch [mm]
TrigScintGeometry(const framework::config::Parameters &ps)
Build from a python-configured parameter set.
double layer_y_shift_
y stagger of layer 1 relative to layer 0 [mm]
double y0_
global y of bar 0 [mm] (bar 0 is most +y)
ROOT::Math::XYZVector getBarPosition(int module, int bar) const
Global bar-center position for a (module, bar).
std::vector< double > module_z_
global z of each module's (layer-pair) center [mm]
int n_bars_
number of bars (channels) per module
All classes in the ldmx-sw project use this namespace.