Belle II Software development
Module Class Reference

Define the geometry of a BKLM module Each sector [octant] contains Modules. More...

#include <Module.h>

Public Member Functions

 Module (void)
 Empty constructor does nothing.
 
 Module (double phiStripWidth, int phiStripMin, int phiStripMax, double zStripWidth, int zStripNumber, const CLHEP::Hep3Vector &globalOrigin, const CLHEP::Hep3Vector &localReconstructionShift, const CLHEP::HepRotation &rotation)
 Constructor with explicit values (for RPC module)
 
 Module (double stripWidth, int phiStripNumber, int phiSensorSide, int zStripNumber, const CLHEP::Hep3Vector &globalOrigin, const CLHEP::Hep3Vector &localReconstructionShift, const CLHEP::HepRotation &rotation, bool isFlipped)
 Constructor with explicit values (for scint module)
 
 Module (const Module &m)
 Copy constructor.
 
Moduleoperator= (const Module &m)
 Assignment operator: utilizes copy constructor.
 
 ~Module ()
 Destructor.
 
bool isFlipped () const
 Determine if this module is flipped by 180 degrees about z axis within its air gap.
 
bool hasRPCs () const
 Determine if this module contains RPCs (true) or scintillators (false)
 
int getPhiStripMin () const
 Get module's phi-strip minimum index.
 
int getPhiStripMax () const
 Get module's phi-strip maximum index.
 
double getPhiStripWidth () const
 Get phi-strip width.
 
int getZStripMin () const
 Get module's z-strip minimum index.
 
int getZStripMax () const
 Get module's z-strip maximum index.
 
double getZStripWidth () const
 Get z-strip width.
 
void addPhiScint (int scint, double length, double offset, double position)
 Add one phi-measuring scintillator strip to the module.
 
void addZScint (int scint, double length, double offset, double position)
 Add one z-measuring scintillator strip to the module.
 
double getPhiScintHalfLength (int scint) const
 Get the half-length (within the scintillator envelope) of a given phi-measuring scintillator.
 
double getPhiScintOffset (int scint) const
 Get the longitudinal offset (within the scintillator envelope) of a given phi-measuring scintillator.
 
double getPhiScintPosition (int scint) const
 Get the transverse position (within the scintillator envelope) of a given phi-measuring scintillator.
 
double getZScintHalfLength (int scint) const
 Get the half-length (within the scintillator envelope) of a given z-measuring scintillator.
 
double getZScintOffset (int scint) const
 Get the longitudinal offset (within the scintillator envelope) of a given z-measuring scintillator.
 
double getZScintPosition (int scint) const
 Get the transverse position (within the scintillator envelope) of a given z-measuring scintillator.
 
double getStripLength (int plane, int strip) const
 Get scintillator length.
 
const CLHEP::Hep3Vector getLocalPosition (double phiStripAve, double zStripAve) const
 Convert 2D strip position (0..nStrips along each axis) to local coordinates.
 
const CLHEP::Hep3Vector getPropagationDistance (const CLHEP::Hep3Vector &) const
 Convert local coordinates to signal-propagation distance (cm).
 
double getPropagationDistance (const CLHEP::Hep3Vector &local, int strip, bool phiReadout) const
 Convert local coordinates to signal-propagation distance (cm) Version for scintillators.
 
const CLHEP::Hep3Vector getPropagationDistance (const CLHEP::Hep3Vector &, int stripZ, int stripPhi) const
 Convert local coordinates to signal-propagation distance (cm) Version for scintillators.
 
const CLHEP::Hep3Vector getPropagationTimes (const CLHEP::Hep3Vector &) const
 Convert local coordinates to signal-propagation time (ns) Version for RPCs.
 
double getPropagationTime (const CLHEP::Hep3Vector &local, int strip, bool phiReadout) const
 Convert local coordinates to signal-propagation time (ns) Version for scintillators.
 
const CLHEP::Hep3Vector getPropagationTimes (const CLHEP::Hep3Vector &, int stripZ, int stripPhi) const
 Convert local coordinates to signal-propagation time (ns) Version for scintillators.
 
double getPhiStrip (const CLHEP::Hep3Vector &p) const
 Return phi strip (including fractional part) corresponding to local phi coordinate.
 
double getZStrip (const CLHEP::Hep3Vector &p) const
 Return z strip (including fractional part) corresponding to local z coordinate.
 
int getPhiStripNumber (const CLHEP::Hep3Vector &p) const
 Get phi strip corresponding to local phi coordinate.
 
int getZStripNumber (const CLHEP::Hep3Vector &p) const
 Get z strip corresponding to local z coordinate.
 
const CLHEP::Hep3Vector localToGlobal (const CLHEP::Hep3Vector &v, bool reco=false) const
 Transform space-point within this module from local to global coordinates.
 
const CLHEP::Hep3Vector RotateToLocal (const CLHEP::Hep3Vector &v) const
 Rotate a vector from global to local system.
 
const CLHEP::Hep3Vector RotateToGlobal (const CLHEP::Hep3Vector &v) const
 Rotate a vector from local to global system.
 
const CLHEP::Hep3Vector globalToLocal (const CLHEP::Hep3Vector &v, bool reco=false) const
 Transform space-point within this module from global to local coordinates.
 
const CLHEP::Hep3Vector getLocalReconstructionShift () const
 Return the local-coordinate real-vs-ideal translation of this module's sensitive volume; nominally (0,0,0)
 
const CLHEP::Hep3Vector getGlobalOrigin () const
 Return the position (in global coordinates) of this module's sensitive-volume origin.
 
void setAlignment (const HepGeom::Transform3D &moduleAlignment)
 Set the alignment Transformation.
 
void setDisplacedGeo (const HepGeom::Transform3D &moduleDisplacedGeo)
 Set the displaced geometry Transformation.
 
const HepGeom::Transform3D getAlignment () const
 Get the alignment Transformation.
 
const HepGeom::Transform3D getDisplacedGeo () const
 Get the displaced geometry Transformation.
 
const CLHEP::HepRotation getRotationFromTransform3D (const HepGeom::Transform3D &trans) const
 Get the rotation from Transform3D.
 
const CLHEP::Hep3Vector getTranslationFromTransform3D (const HepGeom::Transform3D &trans) const
 Get the translation from Transform3D.
 

Private Attributes

bool m_HasRPCs
 flag to indicate whether this module contains RPCs (true) or scintillators (false)
 
bool m_IsFlipped
 flag to indicate if this module is flipped by 180 degrees about z axis within its air gap
 
double m_PhiStripWidth
 to store the width (in cm) of each phi strip this module
 
int m_PhiStripMin
 to store the minimum phi strip number in this module
 
int m_PhiStripMax
 to store the maximum phi strip number in this module
 
double m_PhiPositionBase
 to store the base position (in strip
 
double m_ZStripWidth
 to store the width (in cm) of each z strip in this module
 
int m_ZStripMin
 to store the minimum z strip number in this module
 
int m_ZStripMax
 to store the maximum z strip number in this module
 
double m_ZPositionBase
 to store the base position (in strip
 
int m_PhiSensorSide
 to store the sensor side for phi scintillators
 
double m_SignalSpeed
 to store the signal-propagation speed (cm/ns) along the strip
 
CLHEP::Hep3Vector m_GlobalOrigin
 to store the position (in global coordinates) of this module's sensitive-volume origin
 
CLHEP::Hep3Vector m_LocalReconstructionShift
 to store the local-coordinate real-vs-ideal translation of this module's sensitive volume
 
CLHEP::HepRotation m_Rotation
 to store the rotation matrix (in global coordinates) of this module's sector
 
CLHEP::HepRotation m_RotationInverse
 to store the inverse of the rotation matrix (in global coordinates) of this module's sector
 
HepGeom::Transform3D m_Alignment
 alignment transformation (rotation + shift)
 
CLHEP::HepRotation m_AlignmentRotation
 rotation of the alignment transformation
 
CLHEP::Hep3Vector m_AlignmentTranslation
 translation of the alignment transformation
 
HepGeom::Transform3D m_AlignmentInverse
 inverse of alignment transformation
 
CLHEP::HepRotation m_AlignmentRotationInverse
 inverse of the rotation of the alignment transformation
 
HepGeom::Transform3D m_DisplacedGeo
 displaced geometry w.r.t the nominal geometry, as transformation (rotation + shift)
 
CLHEP::HepRotation m_DisplacedGeoRotation
 rotation of the displaced geometry transformation
 
CLHEP::Hep3Vector m_DisplacedGeoTranslation
 translation of the displaced geometry transformation
 
HepGeom::Transform3D m_DisplacedGeoInverse
 inverse of displaced geometry transformation
 
CLHEP::HepRotation m_DisplacedGeoRotationInverse
 inverse of the rotation of displaced geometry transformation
 
std::vector< double > m_PhiScintLengths
 to store the length of each phi-measuring scintillator
 
std::vector< double > m_PhiScintPositions
 to store the transverse position (within scintillator envelope) of each phi-measuring scintillator
 
std::vector< double > m_PhiScintOffsets
 to store the longitudinal offset (within scintillator envelope) of each phi-measuring scintillator
 
std::vector< double > m_ZScintLengths
 to store the length of each z-measuring scintillator
 
std::vector< double > m_ZScintPositions
 to store the transverse position (within scintillator envelope) of each z-measuring scintillator
 
std::vector< double > m_ZScintOffsets
 to store the longitudinal offset (within scintillator envelope) of each z-measuring scintillator
 

Detailed Description

Define the geometry of a BKLM module Each sector [octant] contains Modules.

Sectors are numbered 1..8, moving counterclockwise around the global z axis in the global x-y plane. The local geometry of a sector and its modules is defined by the orientation of sector 1 (centred on the global +x axis).

 SECTOR 1 GLOBAL COORDINATES        SECTOR s LOCAL COORDINATES

+y _ +y _ ^ / | ^ / | | / | | / | | / | |/ | | / | /| | | | end | || end |

  • - - - - - | view | - - > +x - - - - - |+ view | - - > +x | | | | \ | \ | \ | \ | \ | \ | _| _|

The sector's local origin is shifted along the global z axis so that it is at the boundary between the forward and backward barrel KLM.

The sector's local origin is shifted along the local +x axis so that it coincides with the middle of the layer-1 gap (=slot between iron layers); outer layers are at larger values of sector-local x. The module's local origin is shifted along the local x axis so that it is in the middle of the module's sensitive volume. The module's local origin is also shifted slightly along the local y and z axes so that it is in the middle of the sensitive volume along the local y axis and at the edge nearest the local origin of the sensitive volume along the local z axis.

For the backward sectors, the module is rotated by 180 degrees about the +x axis so that the orientation of the local z axis is flipped from the global orientation so that all modules extend along the local +z axis from the local z=0 (which is nearest the forward-backward boundary).

Strip numbering for RPCs: z-measuring strips: #1 is nearest the I.P., sensors are at the other end phi-measuring strips: #1 is on the local -y end, sensors are at the local +y end

Strip numbering for scintillatorss: z-measuring strips: #1 is nearest the I.P., sensors are at the other end phi-measuring strips: if phiSensorSide > 0: #1 is on the local -y end, sensors are at the local +y end if phiSensorSide < 0: #1 is on the local +y end, sensors are at the local -y end

Definition at line 76 of file Module.h.

Constructor & Destructor Documentation

◆ Module() [1/4]

Module ( void  )

Empty constructor does nothing.

Definition at line 24 of file Module.cc.

24 :
25 m_HasRPCs(false),
26 m_IsFlipped(false),
27 m_PhiStripWidth(0.0),
31 m_ZStripWidth(0.0),
32 m_ZStripMin(0),
33 m_ZStripMax(0),
34 m_ZPositionBase(0.0),
36 m_SignalSpeed(0.0),
37 m_GlobalOrigin(CLHEP::Hep3Vector()),
38 m_LocalReconstructionShift(CLHEP::Hep3Vector()),
39 m_Rotation(CLHEP::HepRotation()),
40 m_Alignment(HepGeom::Transform3D()),
41 m_AlignmentRotation(CLHEP::HepRotation()),
42 m_AlignmentTranslation(CLHEP::Hep3Vector()),
43 m_AlignmentInverse(HepGeom::Transform3D()),
44 m_AlignmentRotationInverse(CLHEP::HepRotation()),
45 m_DisplacedGeo(HepGeom::Transform3D()),
46 m_DisplacedGeoRotation(CLHEP::HepRotation()),
47 m_DisplacedGeoTranslation(CLHEP::Hep3Vector()),
48 m_DisplacedGeoInverse(HepGeom::Transform3D()),
49 m_DisplacedGeoRotationInverse(CLHEP::HepRotation())
50{
51 m_RotationInverse = m_Rotation.inverse();
52 m_PhiScintPositions.clear();
53 m_PhiScintLengths.clear();
54 m_PhiScintOffsets.clear();
55 m_ZScintPositions.clear();
56 m_ZScintLengths.clear();
57 m_ZScintOffsets.clear();
58}
std::vector< double > m_ZScintPositions
to store the transverse position (within scintillator envelope) of each z-measuring scintillator
Definition: Module.h:407
CLHEP::HepRotation m_DisplacedGeoRotationInverse
inverse of the rotation of displaced geometry transformation
Definition: Module.h:392
CLHEP::HepRotation m_RotationInverse
to store the inverse of the rotation matrix (in global coordinates) of this module's sector
Definition: Module.h:362
CLHEP::Hep3Vector m_AlignmentTranslation
translation of the alignment transformation
Definition: Module.h:371
int m_PhiStripMin
to store the minimum phi strip number in this module
Definition: Module.h:326
CLHEP::Hep3Vector m_DisplacedGeoTranslation
translation of the displaced geometry transformation
Definition: Module.h:386
double m_ZPositionBase
to store the base position (in strip
Definition: Module.h:344
double m_PhiStripWidth
to store the width (in cm) of each phi strip this module
Definition: Module.h:323
std::vector< double > m_ZScintLengths
to store the length of each z-measuring scintillator
Definition: Module.h:404
HepGeom::Transform3D m_DisplacedGeo
displaced geometry w.r.t the nominal geometry, as transformation (rotation + shift)
Definition: Module.h:380
bool m_IsFlipped
flag to indicate if this module is flipped by 180 degrees about z axis within its air gap
Definition: Module.h:320
CLHEP::HepRotation m_AlignmentRotationInverse
inverse of the rotation of the alignment transformation
Definition: Module.h:377
HepGeom::Transform3D m_Alignment
alignment transformation (rotation + shift)
Definition: Module.h:365
HepGeom::Transform3D m_AlignmentInverse
inverse of alignment transformation
Definition: Module.h:374
HepGeom::Transform3D m_DisplacedGeoInverse
inverse of displaced geometry transformation
Definition: Module.h:389
std::vector< double > m_ZScintOffsets
to store the longitudinal offset (within scintillator envelope) of each z-measuring scintillator
Definition: Module.h:410
double m_ZStripWidth
to store the width (in cm) of each z strip in this module
Definition: Module.h:335
int m_PhiSensorSide
to store the sensor side for phi scintillators
Definition: Module.h:347
std::vector< double > m_PhiScintPositions
to store the transverse position (within scintillator envelope) of each phi-measuring scintillator
Definition: Module.h:398
int m_PhiStripMax
to store the maximum phi strip number in this module
Definition: Module.h:329
std::vector< double > m_PhiScintLengths
to store the length of each phi-measuring scintillator
Definition: Module.h:395
CLHEP::HepRotation m_Rotation
to store the rotation matrix (in global coordinates) of this module's sector
Definition: Module.h:359
int m_ZStripMin
to store the minimum z strip number in this module
Definition: Module.h:338
double m_PhiPositionBase
to store the base position (in strip
Definition: Module.h:332
CLHEP::HepRotation m_DisplacedGeoRotation
rotation of the displaced geometry transformation
Definition: Module.h:383
double m_SignalSpeed
to store the signal-propagation speed (cm/ns) along the strip
Definition: Module.h:350
CLHEP::Hep3Vector m_LocalReconstructionShift
to store the local-coordinate real-vs-ideal translation of this module's sensitive volume
Definition: Module.h:356
int m_ZStripMax
to store the maximum z strip number in this module
Definition: Module.h:341
CLHEP::Hep3Vector m_GlobalOrigin
to store the position (in global coordinates) of this module's sensitive-volume origin
Definition: Module.h:353
CLHEP::HepRotation m_AlignmentRotation
rotation of the alignment transformation
Definition: Module.h:368
bool m_HasRPCs
flag to indicate whether this module contains RPCs (true) or scintillators (false)
Definition: Module.h:317
std::vector< double > m_PhiScintOffsets
to store the longitudinal offset (within scintillator envelope) of each phi-measuring scintillator
Definition: Module.h:401

◆ Module() [2/4]

Module ( double  phiStripWidth,
int  phiStripMin,
int  phiStripMax,
double  zStripWidth,
int  zStripNumber,
const CLHEP::Hep3Vector &  globalOrigin,
const CLHEP::Hep3Vector &  localReconstructionShift,
const CLHEP::HepRotation &  rotation 
)

Constructor with explicit values (for RPC module)

Definition at line 61 of file Module.cc.

68 :
69 m_HasRPCs(true),
70 m_IsFlipped(false),
71 m_PhiStripWidth(phiStripWidth),
72 m_PhiStripMin(phiStripMin),
73 m_PhiStripMax(phiStripMax),
74 m_PhiPositionBase(0.5 * (phiStripMin + phiStripMax - 1) + 1.0), // start at #1
75 m_ZStripWidth(zStripWidth),
76 m_ZStripMin(1),
77 m_ZStripMax(zStripNumber),
78 m_ZPositionBase(1.0), // start at #1
81 m_GlobalOrigin(globalOrigin),
82 m_LocalReconstructionShift(localReconstructionShift),
83 m_Rotation(rotation),
84 m_Alignment(HepGeom::Transform3D()),
85 m_AlignmentRotation(CLHEP::HepRotation()),
86 m_AlignmentTranslation(CLHEP::Hep3Vector()),
87 m_AlignmentInverse(HepGeom::Transform3D()),
88 m_AlignmentRotationInverse(CLHEP::HepRotation()),
89 m_DisplacedGeo(HepGeom::Transform3D()),
90 m_DisplacedGeoRotation(CLHEP::HepRotation()),
91 m_DisplacedGeoTranslation(CLHEP::Hep3Vector()),
92 m_DisplacedGeoInverse(HepGeom::Transform3D()),
93 m_DisplacedGeoRotationInverse(CLHEP::HepRotation())
94{
95 m_RotationInverse = m_Rotation.inverse();
96 m_PhiScintLengths.clear();
97 m_PhiScintPositions.clear();
98 m_PhiScintOffsets.clear();
99 m_ZScintLengths.clear();
100 m_ZScintPositions.clear();
101 m_ZScintOffsets.clear();
102}
static const double speedOfLight
[cm/ns]
Definition: Const.h:695

◆ Module() [3/4]

Module ( double  stripWidth,
int  phiStripNumber,
int  phiSensorSide,
int  zStripNumber,
const CLHEP::Hep3Vector &  globalOrigin,
const CLHEP::Hep3Vector &  localReconstructionShift,
const CLHEP::HepRotation &  rotation,
bool  isFlipped 
)

Constructor with explicit values (for scint module)

Definition at line 105 of file Module.cc.

112 :
113 m_HasRPCs(false),
115 m_PhiStripWidth(stripWidth),
116 m_PhiStripMin(1),
117 m_PhiStripMax(phiStripNumber),
118 m_PhiPositionBase(0.5 * phiStripNumber + 1.0), // start at #1
119 m_ZStripWidth(stripWidth),
120 m_ZStripMin(1),
121 m_ZStripMax(zStripNumber),
122 m_ZPositionBase(1.0), // start at #1
123 m_PhiSensorSide(phiSensorSide),
124 m_SignalSpeed(0.5671 * Const::speedOfLight), // m_firstPhotonlightSpeed, from EKLM
125 m_GlobalOrigin(globalOrigin),
126 m_LocalReconstructionShift(localReconstructionShift),
127 m_Rotation(rotation),
128 m_Alignment(HepGeom::Transform3D()),
129 m_AlignmentRotation(CLHEP::HepRotation()),
130 m_AlignmentTranslation(CLHEP::Hep3Vector()),
131 m_AlignmentInverse(HepGeom::Transform3D()),
132 m_AlignmentRotationInverse(CLHEP::HepRotation()),
133 m_DisplacedGeo(HepGeom::Transform3D()),
134 m_DisplacedGeoRotation(CLHEP::HepRotation()),
135 m_DisplacedGeoTranslation(CLHEP::Hep3Vector()),
136 m_DisplacedGeoInverse(HepGeom::Transform3D()),
137 m_DisplacedGeoRotationInverse(CLHEP::HepRotation())
138{
139 if (isFlipped)
140 m_Rotation.rotateZ(M_PI);
141 m_RotationInverse = m_Rotation.inverse();
142 m_PhiScintLengths.clear();
143 m_PhiScintPositions.clear();
144 m_PhiScintOffsets.clear();
145 m_ZScintLengths.clear();
146 m_ZScintPositions.clear();
147 m_ZScintOffsets.clear();
148}
bool isFlipped() const
Determine if this module is flipped by 180 degrees about z axis within its air gap.
Definition: Module.h:113

◆ Module() [4/4]

Module ( const Module m)

Copy constructor.

Definition at line 151 of file Module.cc.

151 :
152 m_HasRPCs(m.m_HasRPCs),
153 m_IsFlipped(m.m_IsFlipped),
154 m_PhiStripWidth(m.m_PhiStripWidth),
155 m_PhiStripMin(m.m_PhiStripMin),
156 m_PhiStripMax(m.m_PhiStripMax),
157 m_PhiPositionBase(m.m_PhiPositionBase),
158 m_ZStripWidth(m.m_ZStripWidth),
159 m_ZStripMin(m.m_ZStripMin),
160 m_ZStripMax(m.m_ZStripMax),
161 m_ZPositionBase(m.m_ZPositionBase),
162 m_PhiSensorSide(m.m_PhiSensorSide),
163 m_SignalSpeed(m.m_SignalSpeed),
164 m_GlobalOrigin(m.m_GlobalOrigin),
165 m_LocalReconstructionShift(m.m_LocalReconstructionShift),
166 m_Rotation(m.m_Rotation),
167 m_RotationInverse(m.m_RotationInverse),
168 m_Alignment(m.m_Alignment),
169 m_AlignmentRotation(m.m_AlignmentRotation),
170 m_AlignmentTranslation(m.m_AlignmentTranslation),
171 m_AlignmentInverse(m.m_AlignmentInverse),
172 m_AlignmentRotationInverse(m.m_AlignmentRotationInverse),
173 m_DisplacedGeo(m.m_DisplacedGeo),
174 m_DisplacedGeoRotation(m.m_DisplacedGeoRotation),
175 m_DisplacedGeoTranslation(m.m_DisplacedGeoTranslation),
176 m_DisplacedGeoInverse(m.m_DisplacedGeoInverse),
177 m_DisplacedGeoRotationInverse(m.m_DisplacedGeoRotationInverse),
178 m_PhiScintLengths(m.m_PhiScintLengths),
179 m_PhiScintPositions(m.m_PhiScintPositions),
180 m_PhiScintOffsets(m.m_PhiScintOffsets),
181 m_ZScintLengths(m.m_ZScintLengths),
182 m_ZScintPositions(m.m_ZScintPositions),
183 m_ZScintOffsets(m.m_ZScintOffsets)
184{
185}

◆ ~Module()

~Module ( )

Destructor.

Definition at line 227 of file Module.cc.

228{
229}

Member Function Documentation

◆ addPhiScint()

void addPhiScint ( int  scint,
double  length,
double  offset,
double  position 
)

Add one phi-measuring scintillator strip to the module.

Definition at line 231 of file Module.cc.

232{
233 while (m_PhiScintLengths.size() <= (unsigned int)scint) {
234 m_PhiScintLengths.push_back(0.0);
235 m_PhiScintOffsets.push_back(0.0);
236 m_PhiScintPositions.push_back(0.0);
237 }
238 m_PhiScintLengths[scint] = length;
239 m_PhiScintOffsets[scint] = offset;
240 m_PhiScintPositions[scint] = position;
241}

◆ addZScint()

void addZScint ( int  scint,
double  length,
double  offset,
double  position 
)

Add one z-measuring scintillator strip to the module.

Definition at line 243 of file Module.cc.

244{
245 while (m_ZScintLengths.size() <= (unsigned int)scint) {
246 m_ZScintLengths.push_back(0.0);
247 m_ZScintOffsets.push_back(0.0);
248 m_ZScintPositions.push_back(0.0);
249 }
250 m_ZScintLengths[scint] = length;
251 m_ZScintOffsets[scint] = offset;
252 m_ZScintPositions[scint] = position;
253}

◆ getAlignment()

const HepGeom::Transform3D getAlignment ( ) const
inline

Get the alignment Transformation.

Definition at line 297 of file Module.h.

298 {
299 return m_Alignment;
300 }

◆ getDisplacedGeo()

const HepGeom::Transform3D getDisplacedGeo ( ) const
inline

Get the displaced geometry Transformation.

Definition at line 303 of file Module.h.

304 {
305 return m_DisplacedGeo;
306 }

◆ getGlobalOrigin()

const CLHEP::Hep3Vector getGlobalOrigin ( ) const
inline

Return the position (in global coordinates) of this module's sensitive-volume origin.

Definition at line 285 of file Module.h.

286 {
287 return m_GlobalOrigin;
288 }

◆ getLocalPosition()

const CLHEP::Hep3Vector getLocalPosition ( double  phiStripAve,
double  zStripAve 
) const

Convert 2D strip position (0..nStrips along each axis) to local coordinates.

Definition at line 265 of file Module.cc.

266{
267 // "+0.5" assures that the local position is in the middle of the strip
268 return CLHEP::Hep3Vector(0.0,
269 (phiStripAve - m_PhiPositionBase + 0.5) * m_PhiStripWidth,
270 (zStripAve - m_ZPositionBase + 0.5) * m_ZStripWidth);
271}

◆ getLocalReconstructionShift()

const CLHEP::Hep3Vector getLocalReconstructionShift ( ) const
inline

Return the local-coordinate real-vs-ideal translation of this module's sensitive volume; nominally (0,0,0)

Definition at line 279 of file Module.h.

280 {
282 }

◆ getPhiScintHalfLength()

double getPhiScintHalfLength ( int  scint) const
inline

Get the half-length (within the scintillator envelope) of a given phi-measuring scintillator.

Definition at line 167 of file Module.h.

168 {
169 return 0.5 * m_PhiScintLengths[scint];
170 }

◆ getPhiScintOffset()

double getPhiScintOffset ( int  scint) const
inline

Get the longitudinal offset (within the scintillator envelope) of a given phi-measuring scintillator.

Definition at line 173 of file Module.h.

174 {
175 return m_PhiScintOffsets[scint];
176 }

◆ getPhiScintPosition()

double getPhiScintPosition ( int  scint) const
inline

Get the transverse position (within the scintillator envelope) of a given phi-measuring scintillator.

Definition at line 179 of file Module.h.

180 {
181 return m_PhiScintPositions[scint];
182 }

◆ getPhiStrip()

double getPhiStrip ( const CLHEP::Hep3Vector &  p) const
inline

Return phi strip (including fractional part) corresponding to local phi coordinate.

Definition at line 237 of file Module.h.

238 {
239 return p.y() / m_PhiStripWidth + m_PhiPositionBase;
240 }

◆ getPhiStripMax()

int getPhiStripMax ( ) const
inline

Get module's phi-strip maximum index.

Definition at line 131 of file Module.h.

132 {
133 return m_PhiStripMax;
134 }

◆ getPhiStripMin()

int getPhiStripMin ( ) const
inline

Get module's phi-strip minimum index.

Definition at line 125 of file Module.h.

126 {
127 return m_PhiStripMin;
128 }

◆ getPhiStripNumber()

int getPhiStripNumber ( const CLHEP::Hep3Vector &  p) const

Get phi strip corresponding to local phi coordinate.

Returns
Strip number, -1 if not found.

Definition at line 349 of file Module.cc.

350{
351 int strip = std::floor(getPhiStrip(p));
352 if (strip < m_PhiStripMin || strip > m_PhiStripMax)
353 return -1;
354 return strip;
355}
double getPhiStrip(const CLHEP::Hep3Vector &p) const
Return phi strip (including fractional part) corresponding to local phi coordinate.
Definition: Module.h:237

◆ getPhiStripWidth()

double getPhiStripWidth ( ) const
inline

Get phi-strip width.

Definition at line 137 of file Module.h.

138 {
139 return m_PhiStripWidth;
140 }

◆ getPropagationDistance() [1/3]

const CLHEP::Hep3Vector getPropagationDistance ( const CLHEP::Hep3Vector &  local) const

Convert local coordinates to signal-propagation distance (cm).

Version for RPCs.

Definition at line 290 of file Module.cc.

291{
292 double dy = m_PhiPositionBase * m_PhiStripWidth - m_PhiSensorSide * local.y();
293 double dz = m_ZStripMax * m_ZStripWidth - local.z();
294 return CLHEP::Hep3Vector(0.0, dz, dy);
295}

◆ getPropagationDistance() [2/3]

const CLHEP::Hep3Vector getPropagationDistance ( const CLHEP::Hep3Vector &  local,
int  stripZ,
int  stripPhi 
) const

Convert local coordinates to signal-propagation distance (cm) Version for scintillators.

Definition at line 297 of file Module.cc.

299{
300 double distanceZ = getPropagationDistance(local, stripZ, false);
301 double distancePhi = getPropagationDistance(local, stripPhi, true);
302 return CLHEP::Hep3Vector(0.0, distancePhi, distanceZ);
303}
const CLHEP::Hep3Vector getPropagationDistance(const CLHEP::Hep3Vector &) const
Convert local coordinates to signal-propagation distance (cm).
Definition: Module.cc:290

◆ getPropagationDistance() [3/3]

double getPropagationDistance ( const CLHEP::Hep3Vector &  local,
int  strip,
bool  phiReadout 
) const

Convert local coordinates to signal-propagation distance (cm) Version for scintillators.

The value m_PhiSensorSide == -1 corresponds to SiPMs at positive local coordinate (and vice versa). Consequently, the sign is negative.

Definition at line 273 of file Module.cc.

275{
276 double distance;
277 if (phiReadout) {
278 distance = m_ZStripMax * m_ZStripWidth - local.z();
279 } else {
284 distance = fabs(m_ZScintOffsets[strip] -
285 0.5 * m_PhiSensorSide * m_ZScintLengths[strip] - local.y());
286 }
287 return distance;
288}

◆ getPropagationTime()

double getPropagationTime ( const CLHEP::Hep3Vector &  local,
int  strip,
bool  phiReadout 
) const

Convert local coordinates to signal-propagation time (ns) Version for scintillators.

Definition at line 311 of file Module.cc.

313{
314 double distance = getPropagationDistance(local, strip, phiReadout);
315 return distance / m_SignalSpeed;
316}

◆ getPropagationTimes() [1/2]

const CLHEP::Hep3Vector getPropagationTimes ( const CLHEP::Hep3Vector &  local) const

Convert local coordinates to signal-propagation time (ns) Version for RPCs.

Definition at line 305 of file Module.cc.

306{
307 const CLHEP::Hep3Vector proDist = getPropagationDistance(local);
308 return CLHEP::Hep3Vector(0.0, proDist[1] / m_SignalSpeed, proDist[2] / m_SignalSpeed);
309}

◆ getPropagationTimes() [2/2]

const CLHEP::Hep3Vector getPropagationTimes ( const CLHEP::Hep3Vector &  local,
int  stripZ,
int  stripPhi 
) const

Convert local coordinates to signal-propagation time (ns) Version for scintillators.

Definition at line 318 of file Module.cc.

320{
321 double distanceZ = getPropagationDistance(local, stripZ, false);
322 double distancePhi = getPropagationDistance(local, stripPhi, true);
323 return CLHEP::Hep3Vector(0.0, distancePhi / m_SignalSpeed, distanceZ / m_SignalSpeed);
324}

◆ getRotationFromTransform3D()

const CLHEP::HepRotation getRotationFromTransform3D ( const HepGeom::Transform3D &  trans) const

Get the rotation from Transform3D.

Definition at line 393 of file Module.cc.

394{
395 HepGeom::Scale3D scale;
396 HepGeom::Rotate3D rotation;
397 HepGeom::Translate3D translation;
398 trans.getDecomposition(scale, rotation, translation);
399 CLHEP::HepRep3x3 rRep(rotation.xx(), rotation.xy(), rotation.xz(),
400 rotation.yx(), rotation.yy(), rotation.yz(),
401 rotation.zx(), rotation.zy(), rotation.zz()
402 );
403 CLHEP::HepRotation r;
404 r.set(rRep);
405 return r;
406}

◆ getStripLength()

double getStripLength ( int  plane,
int  strip 
) const

Get scintillator length.

Definition at line 255 of file Module.cc.

256{
257 if (plane == BKLMElementNumbers::c_ZPlane)
258 return m_ZScintLengths[strip];
259 else if (plane == BKLMElementNumbers::c_PhiPlane)
260 return m_PhiScintLengths[strip];
261 else
262 B2FATAL("Incorrect plane number.");
263}

◆ getTranslationFromTransform3D()

const CLHEP::Hep3Vector getTranslationFromTransform3D ( const HepGeom::Transform3D &  trans) const

Get the translation from Transform3D.

Definition at line 383 of file Module.cc.

384{
385 HepGeom::Scale3D scale;
386 HepGeom::Rotate3D rotation;
387 HepGeom::Translate3D translation;
388 trans.getDecomposition(scale, rotation, translation);
389 CLHEP::Hep3Vector t(translation.dx(), translation.dy(), translation.dz());
390 return t;
391}

◆ getZScintHalfLength()

double getZScintHalfLength ( int  scint) const
inline

Get the half-length (within the scintillator envelope) of a given z-measuring scintillator.

Definition at line 185 of file Module.h.

186 {
187 return 0.5 * m_ZScintLengths[scint];
188 }

◆ getZScintOffset()

double getZScintOffset ( int  scint) const
inline

Get the longitudinal offset (within the scintillator envelope) of a given z-measuring scintillator.

Definition at line 191 of file Module.h.

192 {
193 return m_ZScintOffsets[scint];
194 }

◆ getZScintPosition()

double getZScintPosition ( int  scint) const
inline

Get the transverse position (within the scintillator envelope) of a given z-measuring scintillator.

Definition at line 197 of file Module.h.

198 {
199 return m_ZScintPositions[scint];
200 }

◆ getZStrip()

double getZStrip ( const CLHEP::Hep3Vector &  p) const
inline

Return z strip (including fractional part) corresponding to local z coordinate.

Definition at line 243 of file Module.h.

244 {
245 return p.z() / m_ZStripWidth + m_ZPositionBase;
246 }

◆ getZStripMax()

int getZStripMax ( ) const
inline

Get module's z-strip maximum index.

Definition at line 149 of file Module.h.

150 {
151 return m_ZStripMax;
152 }

◆ getZStripMin()

int getZStripMin ( ) const
inline

Get module's z-strip minimum index.

Definition at line 143 of file Module.h.

144 {
145 return m_ZStripMin;
146 }

◆ getZStripNumber()

int getZStripNumber ( const CLHEP::Hep3Vector &  p) const

Get z strip corresponding to local z coordinate.

Returns
Strip number, -1 if not found.

Definition at line 357 of file Module.cc.

358{
359 int strip = std::floor(getZStrip(p));
360 if (strip < m_ZStripMin || strip > m_ZStripMax)
361 return -1;
362 return strip;
363}
double getZStrip(const CLHEP::Hep3Vector &p) const
Return z strip (including fractional part) corresponding to local z coordinate.
Definition: Module.h:243

◆ getZStripWidth()

double getZStripWidth ( ) const
inline

Get z-strip width.

Definition at line 155 of file Module.h.

156 {
157 return m_ZStripWidth;
158 }

◆ globalToLocal()

const CLHEP::Hep3Vector globalToLocal ( const CLHEP::Hep3Vector &  v,
bool  reco = false 
) const

Transform space-point within this module from global to local coordinates.

Parameters
[in]vPoint in global coordinates.
[in]recoApply alignment correction (true) or return nominal position (false).

Definition at line 339 of file Module.cc.

340{
341 CLHEP::Hep3Vector vlocal = m_RotationInverse * (v - m_GlobalOrigin); //now in nominal local
342 vlocal = m_DisplacedGeoRotationInverse * (vlocal - m_DisplacedGeoTranslation); //now in displaced local
343 if (reco) {
344 vlocal = m_AlignmentRotationInverse * (vlocal - m_AlignmentTranslation); //now in real local
345 }
346 return vlocal;
347}

◆ hasRPCs()

bool hasRPCs ( ) const
inline

Determine if this module contains RPCs (true) or scintillators (false)

Definition at line 119 of file Module.h.

120 {
121 return m_HasRPCs;
122 }

◆ isFlipped()

bool isFlipped ( ) const
inline

Determine if this module is flipped by 180 degrees about z axis within its air gap.

Definition at line 113 of file Module.h.

114 {
115 return m_IsFlipped;
116 }

◆ localToGlobal()

const CLHEP::Hep3Vector localToGlobal ( const CLHEP::Hep3Vector &  v,
bool  reco = false 
) const

Transform space-point within this module from local to global coordinates.

Parameters
[in]vPoint in local coordinates.
[in]recoApply alignment correction (true) or return nominal position (false).

Definition at line 326 of file Module.cc.

327{
328 CLHEP::Hep3Vector vlocal(v.x(), v.y(), v.z());
329 if (m_reco) {
330 vlocal = m_AlignmentRotation * vlocal + m_AlignmentTranslation; // to nominal + displaced local
331 vlocal = m_DisplacedGeoRotation * vlocal + m_DisplacedGeoTranslation; //to nominal local
332 return m_Rotation * vlocal + m_GlobalOrigin; //to global
333 } else {
334 vlocal = m_DisplacedGeoRotation * vlocal + m_DisplacedGeoTranslation; // to nominal local
335 return m_Rotation * vlocal + m_GlobalOrigin; //to global
336 }
337}

◆ operator=()

Module & operator= ( const Module m)

Assignment operator: utilizes copy constructor.

Definition at line 188 of file Module.cc.

189{
190 if (this != &m) {
191 m_HasRPCs = m.m_HasRPCs;
192 m_IsFlipped = m.m_IsFlipped;
193 m_PhiStripWidth = m.m_PhiStripWidth;
194 m_PhiStripMin = m.m_PhiStripMin;
195 m_PhiStripMax = m.m_PhiStripMax;
196 m_PhiPositionBase = m.m_PhiPositionBase;
197 m_ZStripWidth = m.m_ZStripWidth;
198 m_ZStripMin = m.m_ZStripMin;
199 m_ZStripMax = m.m_ZStripMax;
200 m_ZPositionBase = m.m_ZPositionBase;
201 m_PhiSensorSide = m.m_PhiSensorSide;
202 m_SignalSpeed = m.m_SignalSpeed;
203 m_GlobalOrigin = m.m_GlobalOrigin;
204 m_LocalReconstructionShift = m.m_LocalReconstructionShift;
205 m_Rotation = m.m_Rotation;
206 m_RotationInverse = m.m_RotationInverse;
207 m_Alignment = m.m_Alignment;
208 m_AlignmentRotation = m.m_AlignmentRotation;
209 m_AlignmentTranslation = m.m_AlignmentTranslation;
210 m_AlignmentInverse = m.m_AlignmentInverse;
211 m_AlignmentRotationInverse = m.m_AlignmentRotationInverse;
212 m_DisplacedGeo = m.m_DisplacedGeo;
213 m_DisplacedGeoRotation = m.m_DisplacedGeoRotation;
214 m_DisplacedGeoTranslation = m.m_DisplacedGeoTranslation;
215 m_DisplacedGeoInverse = m.m_DisplacedGeoInverse;
216 m_DisplacedGeoRotationInverse = m.m_DisplacedGeoRotationInverse;
217 m_PhiScintLengths = m.m_PhiScintLengths;
218 m_PhiScintPositions = m.m_PhiScintPositions;
219 m_PhiScintOffsets = m.m_PhiScintOffsets;
220 m_ZScintLengths = m.m_ZScintLengths;
221 m_ZScintPositions = m.m_ZScintPositions;
222 m_ZScintOffsets = m.m_ZScintOffsets;
223 }
224 return *this;
225}

◆ RotateToGlobal()

const CLHEP::Hep3Vector RotateToGlobal ( const CLHEP::Hep3Vector &  v) const
inline

Rotate a vector from local to global system.

Definition at line 268 of file Module.h.

269 {
270 return m_Rotation * v;
271 }

◆ RotateToLocal()

const CLHEP::Hep3Vector RotateToLocal ( const CLHEP::Hep3Vector &  v) const
inline

Rotate a vector from global to local system.

Definition at line 262 of file Module.h.

263 {
264 return m_RotationInverse * v;
265 }

◆ setAlignment()

void setAlignment ( const HepGeom::Transform3D &  moduleAlignment)

Set the alignment Transformation.

Definition at line 365 of file Module.cc.

366{
367 m_Alignment = moduleAlignment;
370 m_AlignmentInverse = moduleAlignment.inverse();
372}
const CLHEP::HepRotation getRotationFromTransform3D(const HepGeom::Transform3D &trans) const
Get the rotation from Transform3D.
Definition: Module.cc:393
const CLHEP::Hep3Vector getTranslationFromTransform3D(const HepGeom::Transform3D &trans) const
Get the translation from Transform3D.
Definition: Module.cc:383

◆ setDisplacedGeo()

void setDisplacedGeo ( const HepGeom::Transform3D &  moduleDisplacedGeo)

Set the displaced geometry Transformation.

Definition at line 374 of file Module.cc.

375{
376 m_DisplacedGeo = moduleDisplacedGeo;
379 m_DisplacedGeoInverse = moduleDisplacedGeo.inverse();
381}

Member Data Documentation

◆ m_Alignment

HepGeom::Transform3D m_Alignment
private

alignment transformation (rotation + shift)

Definition at line 365 of file Module.h.

◆ m_AlignmentInverse

HepGeom::Transform3D m_AlignmentInverse
private

inverse of alignment transformation

Definition at line 374 of file Module.h.

◆ m_AlignmentRotation

CLHEP::HepRotation m_AlignmentRotation
private

rotation of the alignment transformation

Definition at line 368 of file Module.h.

◆ m_AlignmentRotationInverse

CLHEP::HepRotation m_AlignmentRotationInverse
private

inverse of the rotation of the alignment transformation

Definition at line 377 of file Module.h.

◆ m_AlignmentTranslation

CLHEP::Hep3Vector m_AlignmentTranslation
private

translation of the alignment transformation

Definition at line 371 of file Module.h.

◆ m_DisplacedGeo

HepGeom::Transform3D m_DisplacedGeo
private

displaced geometry w.r.t the nominal geometry, as transformation (rotation + shift)

Definition at line 380 of file Module.h.

◆ m_DisplacedGeoInverse

HepGeom::Transform3D m_DisplacedGeoInverse
private

inverse of displaced geometry transformation

Definition at line 389 of file Module.h.

◆ m_DisplacedGeoRotation

CLHEP::HepRotation m_DisplacedGeoRotation
private

rotation of the displaced geometry transformation

Definition at line 383 of file Module.h.

◆ m_DisplacedGeoRotationInverse

CLHEP::HepRotation m_DisplacedGeoRotationInverse
private

inverse of the rotation of displaced geometry transformation

Definition at line 392 of file Module.h.

◆ m_DisplacedGeoTranslation

CLHEP::Hep3Vector m_DisplacedGeoTranslation
private

translation of the displaced geometry transformation

Definition at line 386 of file Module.h.

◆ m_GlobalOrigin

CLHEP::Hep3Vector m_GlobalOrigin
private

to store the position (in global coordinates) of this module's sensitive-volume origin

Definition at line 353 of file Module.h.

◆ m_HasRPCs

bool m_HasRPCs
private

flag to indicate whether this module contains RPCs (true) or scintillators (false)

Definition at line 317 of file Module.h.

◆ m_IsFlipped

bool m_IsFlipped
private

flag to indicate if this module is flipped by 180 degrees about z axis within its air gap

Definition at line 320 of file Module.h.

◆ m_LocalReconstructionShift

CLHEP::Hep3Vector m_LocalReconstructionShift
private

to store the local-coordinate real-vs-ideal translation of this module's sensitive volume

Definition at line 356 of file Module.h.

◆ m_PhiPositionBase

double m_PhiPositionBase
private

to store the base position (in strip

  1. units) along phi coordinate of the edge of first phi-measuring strip

Definition at line 332 of file Module.h.

◆ m_PhiScintLengths

std::vector<double> m_PhiScintLengths
private

to store the length of each phi-measuring scintillator

Definition at line 395 of file Module.h.

◆ m_PhiScintOffsets

std::vector<double> m_PhiScintOffsets
private

to store the longitudinal offset (within scintillator envelope) of each phi-measuring scintillator

Definition at line 401 of file Module.h.

◆ m_PhiScintPositions

std::vector<double> m_PhiScintPositions
private

to store the transverse position (within scintillator envelope) of each phi-measuring scintillator

Definition at line 398 of file Module.h.

◆ m_PhiSensorSide

int m_PhiSensorSide
private

to store the sensor side for phi scintillators

Definition at line 347 of file Module.h.

◆ m_PhiStripMax

int m_PhiStripMax
private

to store the maximum phi strip number in this module

Definition at line 329 of file Module.h.

◆ m_PhiStripMin

int m_PhiStripMin
private

to store the minimum phi strip number in this module

Definition at line 326 of file Module.h.

◆ m_PhiStripWidth

double m_PhiStripWidth
private

to store the width (in cm) of each phi strip this module

Definition at line 323 of file Module.h.

◆ m_Rotation

CLHEP::HepRotation m_Rotation
private

to store the rotation matrix (in global coordinates) of this module's sector

Definition at line 359 of file Module.h.

◆ m_RotationInverse

CLHEP::HepRotation m_RotationInverse
private

to store the inverse of the rotation matrix (in global coordinates) of this module's sector

Definition at line 362 of file Module.h.

◆ m_SignalSpeed

double m_SignalSpeed
private

to store the signal-propagation speed (cm/ns) along the strip

Definition at line 350 of file Module.h.

◆ m_ZPositionBase

double m_ZPositionBase
private

to store the base position (in strip

  1. units) along z coordinate of the edge of first z-measuring strip

Definition at line 344 of file Module.h.

◆ m_ZScintLengths

std::vector<double> m_ZScintLengths
private

to store the length of each z-measuring scintillator

Definition at line 404 of file Module.h.

◆ m_ZScintOffsets

std::vector<double> m_ZScintOffsets
private

to store the longitudinal offset (within scintillator envelope) of each z-measuring scintillator

Definition at line 410 of file Module.h.

◆ m_ZScintPositions

std::vector<double> m_ZScintPositions
private

to store the transverse position (within scintillator envelope) of each z-measuring scintillator

Definition at line 407 of file Module.h.

◆ m_ZStripMax

int m_ZStripMax
private

to store the maximum z strip number in this module

Definition at line 341 of file Module.h.

◆ m_ZStripMin

int m_ZStripMin
private

to store the minimum z strip number in this module

Definition at line 338 of file Module.h.

◆ m_ZStripWidth

double m_ZStripWidth
private

to store the width (in cm) of each z strip in this module

Definition at line 335 of file Module.h.


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