10#include <klm/bklm/geometry/Module.h>
13#include <klm/dataobjects/bklm/BKLMElementNumbers.h>
16#include <framework/gearbox/Const.h>
17#include <framework/logging/Logger.h>
22using namespace Belle2::bklm;
66 const CLHEP::Hep3Vector& globalOrigin,
67 const CLHEP::Hep3Vector& localReconstructionShift,
68 const CLHEP::HepRotation& rotation) :
109 const CLHEP::Hep3Vector& globalOrigin,
110 const CLHEP::Hep3Vector& localReconstructionShift,
111 const CLHEP::HepRotation& rotation,
262 B2FATAL(
"Incorrect plane number.");
268 return CLHEP::Hep3Vector(0.0,
274 int strip,
bool phiReadout)
const
294 return CLHEP::Hep3Vector(0.0, dz, dy);
298 const CLHEP::Hep3Vector& local,
int stripZ,
int stripPhi)
const
302 return CLHEP::Hep3Vector(0.0, distancePhi, distanceZ);
312 bool phiReadout)
const
319 const CLHEP::Hep3Vector& local,
int stripZ,
int stripPhi)
const
328 CLHEP::Hep3Vector vlocal(v.x(), v.y(), v.z());
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());
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()
403 CLHEP::HepRotation r;
This class provides a set of constants for the framework.
const CLHEP::Hep3Vector globalToLocal(const CLHEP::Hep3Vector &v, bool reco=false) const
Transform space-point within this module from global to local coordinates.
std::vector< double > m_ZScintPositions
to store the transverse position (within scintillator envelope) of each z-measuring scintillator
const CLHEP::HepRotation getRotationFromTransform3D(const HepGeom::Transform3D &trans) const
Get the rotation from Transform3D.
CLHEP::HepRotation m_DisplacedGeoRotationInverse
inverse of the rotation of displaced geometry transformation
CLHEP::HepRotation m_RotationInverse
to store the inverse of the rotation matrix (in global coordinates) of this module's sector
CLHEP::Hep3Vector m_AlignmentTranslation
translation of the alignment transformation
int m_PhiStripMin
to store the minimum phi strip number in this module
CLHEP::Hep3Vector m_DisplacedGeoTranslation
translation of the displaced geometry transformation
double m_ZPositionBase
to store the base position (in strip
double m_PhiStripWidth
to store the width (in cm) of each phi strip this module
std::vector< double > m_ZScintLengths
to store the length of each z-measuring scintillator
HepGeom::Transform3D m_DisplacedGeo
displaced geometry w.r.t the nominal geometry, as transformation (rotation + shift)
bool m_IsFlipped
flag to indicate if this module is flipped by 180 degrees about z axis within its air gap
int getZStripNumber(const CLHEP::Hep3Vector &p) const
Get z strip corresponding to local z coordinate.
CLHEP::HepRotation m_AlignmentRotationInverse
inverse of the rotation of the alignment transformation
Module(void)
Empty constructor does nothing.
HepGeom::Transform3D m_Alignment
alignment transformation (rotation + shift)
const CLHEP::Hep3Vector getPropagationTimes(const CLHEP::Hep3Vector &) const
Convert local coordinates to signal-propagation time (ns) Version for RPCs.
const CLHEP::Hep3Vector getTranslationFromTransform3D(const HepGeom::Transform3D &trans) const
Get the translation from Transform3D.
HepGeom::Transform3D m_AlignmentInverse
inverse of alignment transformation
double getZStrip(const CLHEP::Hep3Vector &p) const
Return z strip (including fractional part) corresponding to local z coordinate.
HepGeom::Transform3D m_DisplacedGeoInverse
inverse of displaced geometry transformation
const CLHEP::Hep3Vector getPropagationDistance(const CLHEP::Hep3Vector &) const
Convert local coordinates to signal-propagation distance (cm).
std::vector< double > m_ZScintOffsets
to store the longitudinal offset (within scintillator envelope) of each z-measuring scintillator
double m_ZStripWidth
to store the width (in cm) of each z strip in this module
int m_PhiSensorSide
to store the sensor side for phi scintillators
std::vector< double > m_PhiScintPositions
to store the transverse position (within scintillator envelope) of each phi-measuring scintillator
int m_PhiStripMax
to store the maximum phi strip number in this module
std::vector< double > m_PhiScintLengths
to store the length of each phi-measuring scintillator
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 localToGlobal(const CLHEP::Hep3Vector &v, bool reco=false) const
Transform space-point within this module from local to global coordinates.
CLHEP::HepRotation m_Rotation
to store the rotation matrix (in global coordinates) of this module's sector
int m_ZStripMin
to store the minimum z strip number in this module
void addZScint(int scint, double length, double offset, double position)
Add one z-measuring scintillator strip to the module.
double m_PhiPositionBase
to store the base position (in strip
CLHEP::HepRotation m_DisplacedGeoRotation
rotation of the displaced geometry transformation
double m_SignalSpeed
to store the signal-propagation speed (cm/ns) along the strip
double getPhiStrip(const CLHEP::Hep3Vector &p) const
Return phi strip (including fractional part) corresponding to local phi coordinate.
CLHEP::Hep3Vector m_LocalReconstructionShift
to store the local-coordinate real-vs-ideal translation of this module's sensitive volume
int m_ZStripMax
to store the maximum z strip number in this module
const CLHEP::Hep3Vector getLocalPosition(double phiStripAve, double zStripAve) const
Convert 2D strip position (0..nStrips along each axis) to local coordinates.
double getStripLength(int plane, int strip) const
Get scintillator length.
CLHEP::Hep3Vector m_GlobalOrigin
to store the position (in global coordinates) of this module's sensitive-volume origin
void setDisplacedGeo(const HepGeom::Transform3D &moduleDisplacedGeo)
Set the displaced geometry Transformation.
Module & operator=(const Module &m)
Assignment operator: utilizes copy constructor.
void addPhiScint(int scint, double length, double offset, double position)
Add one phi-measuring scintillator strip to the module.
CLHEP::HepRotation m_AlignmentRotation
rotation of the alignment transformation
bool m_HasRPCs
flag to indicate whether this module contains RPCs (true) or scintillators (false)
int getPhiStripNumber(const CLHEP::Hep3Vector &p) const
Get phi strip corresponding to local phi coordinate.
std::vector< double > m_PhiScintOffsets
to store the longitudinal offset (within scintillator envelope) of each phi-measuring scintillator
bool isFlipped() const
Determine if this module is flipped by 180 degrees about z axis within its air gap.
void setAlignment(const HepGeom::Transform3D &moduleAlignment)
Set the alignment Transformation.