LDMX Software
ldmx::TrigScintGeometry Class Reference

Bar-center positions of the trigger-scintillator modules. More...

#include <TrigScintGeometry.h>

Public Member Functions

 TrigScintGeometry (const framework::config::Parameters &ps)
 Build from a python-configured parameter set.
 
ROOT::Math::XYZVector getBarPosition (int module, int bar) const
 Global bar-center position for a (module, bar).
 
ROOT::Math::XYZVector getBarPosition (ldmx::TrigScintID id) const
 Convenience overload taking a TrigScintID.
 
int getNumModules () const
 Number of configured modules.
 
int getNumBars () const
 Number of bars (channels) per module.
 
double getLayerZSeparation () const
 z separation between the two layers within a module [mm].
 
- Public Member Functions inherited from framework::ConditionsObject
 ConditionsObject (const std::string &name)
 Class constructor.
 
virtual ~ConditionsObject ()
 Destructor.
 
std::string getName () const
 Get the name of this object.
 

Static Public Attributes

static constexpr const char * CONDITIONS_OBJECT_NAME {"trig_scint_geometry"}
 Name this conditions object is registered under (must match the python provider field name).
 

Private Attributes

std::vector< double > module_z_
 global z of each module's (layer-pair) center [mm]
 
double y0_
 global y of bar 0 [mm] (bar 0 is most +y)
 
double layer_pitch_
 in-layer y pitch [mm]
 
double layer_y_shift_
 y stagger of layer 1 relative to layer 0 [mm]
 
double layer_z_sep_
 z separation between the two layers within a module [mm]
 
int n_bars_
 number of bars (channels) per module
 

Detailed Description

Bar-center positions of the trigger-scintillator modules.

The TS bars measure y. Each module is two staggered layers of n_bars/2 bars; the decoded channel id (bar, 0..n_bars-1) is split as layer = bar % 2, in-layer index = bar / 2. Positions are computed from parameters that mirror the detector GDML constants (per-module z, in-layer y pitch, layer y stagger, layer z separation, and the y of channel 0). This is delivered as a conditions object so reco (e.g. the TS -> ldmx::Measurement producer) reads geometry from here instead of hard-coding it.

Definition at line 37 of file TrigScintGeometry.h.

Constructor & Destructor Documentation

◆ TrigScintGeometry()

ldmx::TrigScintGeometry::TrigScintGeometry ( const framework::config::Parameters & ps)

Build from a python-configured parameter set.

Definition at line 5 of file TrigScintGeometry.cxx.

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}
Base class for all conditions objects, very simple.
const T & get(const std::string &name) const
Retrieve the parameter of the given name.
Definition Parameters.h:75
double layer_z_sep_
z separation between the two layers within a module [mm]
double layer_pitch_
in-layer y pitch [mm]
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)
std::vector< double > module_z_
global z of each module's (layer-pair) center [mm]
static constexpr const char * CONDITIONS_OBJECT_NAME
Name this conditions object is registered under (must match the python provider field name).
int n_bars_
number of bars (channels) per module

References framework::config::Parameters::get(), layer_pitch_, layer_y_shift_, layer_z_sep_, module_z_, n_bars_, and y0_.

Member Function Documentation

◆ getBarPosition() [1/2]

ROOT::Math::XYZVector ldmx::TrigScintGeometry::getBarPosition ( int module,
int bar ) const

Global bar-center position for a (module, bar).

Parameters
modulemodule index (0-based; index into module_z)
bardecoded channel id, 0..n_bars-1
Returns
(x, y, z) [mm]; x is the bar center (0), y the measured coordinate.

Definition at line 15 of file TrigScintGeometry.cxx.

16 {
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}

References layer_pitch_, layer_y_shift_, layer_z_sep_, module_z_, n_bars_, and y0_.

Referenced by getBarPosition().

◆ getBarPosition() [2/2]

ROOT::Math::XYZVector ldmx::TrigScintGeometry::getBarPosition ( ldmx::TrigScintID id) const
inline

Convenience overload taking a TrigScintID.

Definition at line 57 of file TrigScintGeometry.h.

57 {
58 return getBarPosition(id.module(), id.bar());
59 }
ROOT::Math::XYZVector getBarPosition(int module, int bar) const
Global bar-center position for a (module, bar).

References getBarPosition().

◆ getLayerZSeparation()

double ldmx::TrigScintGeometry::getLayerZSeparation ( ) const
inline

z separation between the two layers within a module [mm].

Definition at line 66 of file TrigScintGeometry.h.

66{ return layer_z_sep_; }

References layer_z_sep_.

◆ getNumBars()

int ldmx::TrigScintGeometry::getNumBars ( ) const
inline

Number of bars (channels) per module.

Definition at line 64 of file TrigScintGeometry.h.

64{ return n_bars_; }

References n_bars_.

◆ getNumModules()

int ldmx::TrigScintGeometry::getNumModules ( ) const
inline

Number of configured modules.

Definition at line 62 of file TrigScintGeometry.h.

62{ return static_cast<int>(module_z_.size()); }

References module_z_.

Member Data Documentation

◆ CONDITIONS_OBJECT_NAME

const char* ldmx::TrigScintGeometry::CONDITIONS_OBJECT_NAME {"trig_scint_geometry"}
staticconstexpr

Name this conditions object is registered under (must match the python provider field name).

Definition at line 41 of file TrigScintGeometry.h.

41{"trig_scint_geometry"};

Referenced by tracking::reco::TrigScintMeasurementProducer::produce().

◆ layer_pitch_

double ldmx::TrigScintGeometry::layer_pitch_
private

in-layer y pitch [mm]

Definition at line 74 of file TrigScintGeometry.h.

Referenced by getBarPosition(), and TrigScintGeometry().

◆ layer_y_shift_

double ldmx::TrigScintGeometry::layer_y_shift_
private

y stagger of layer 1 relative to layer 0 [mm]

Definition at line 76 of file TrigScintGeometry.h.

Referenced by getBarPosition(), and TrigScintGeometry().

◆ layer_z_sep_

double ldmx::TrigScintGeometry::layer_z_sep_
private

z separation between the two layers within a module [mm]

Definition at line 78 of file TrigScintGeometry.h.

Referenced by getBarPosition(), getLayerZSeparation(), and TrigScintGeometry().

◆ module_z_

std::vector<double> ldmx::TrigScintGeometry::module_z_
private

global z of each module's (layer-pair) center [mm]

Definition at line 70 of file TrigScintGeometry.h.

Referenced by getBarPosition(), getNumModules(), and TrigScintGeometry().

◆ n_bars_

int ldmx::TrigScintGeometry::n_bars_
private

number of bars (channels) per module

Definition at line 80 of file TrigScintGeometry.h.

Referenced by getBarPosition(), getNumBars(), and TrigScintGeometry().

◆ y0_

double ldmx::TrigScintGeometry::y0_
private

global y of bar 0 [mm] (bar 0 is most +y)

Definition at line 72 of file TrigScintGeometry.h.

Referenced by getBarPosition(), and TrigScintGeometry().


The documentation for this class was generated from the following files: