Belle II Software  release-08-01-10
AlignableEKLMRecoHit Class Reference

Alignable EKLM hit. More...

#include <AlignableEKLMRecoHit.h>

Inheritance diagram for AlignableEKLMRecoHit:
Collaboration diagram for AlignableEKLMRecoHit:

Public Member Functions

 AlignableEKLMRecoHit ()
 Constructor.
 
 AlignableEKLMRecoHit (const EKLMAlignmentHit *hit, const genfit::TrackCandHit *trackCandHit)
 Constructor.
 
 ~AlignableEKLMRecoHit ()
 Destructor.
 
virtual std::pair< std::vector< int >, TMatrixD > globalDerivatives (const genfit::StateOnPlane *sop) override
 Labels and derivatives of residuals (local measurement coordinates) w.r.t. More...
 
genfit::AbsMeasurementclone () const override
 Clone.
 
int getPlaneId () const
 
virtual SharedPlanePtr constructPlane (const StateOnPlane &state) const override
 Construct (virtual) detector plane (use state's AbsTrackRep). More...
 
virtual std::vector< MeasurementOnPlane * > constructMeasurementsOnPlane (const StateOnPlane &state) const override
 Construct MeasurementOnPlane on plane of the state and wrt the states TrackRep. More...
 
virtual const AbsHMatrix * constructHMatrix (const AbsTrackRep *) const override
 Returns a new AbsHMatrix object. More...
 
virtual void setPlane (const SharedPlanePtr &physicalPlane, int planeId=-1)
 
void setStripV (bool v=true)
 Use if the coordinate for 1D hits measured in V direction. More...
 
TrackPoint * getTrackPoint () const
 
void setTrackPoint (TrackPoint *tp)
 
const TVectorD & getRawHitCoords () const
 
TVectorD & getRawHitCoords ()
 
const TMatrixDSym & getRawHitCov () const
 
TMatrixDSym & getRawHitCov ()
 
int getDetId () const
 
int getHitId () const
 
virtual bool isLeftRightMeasurement () const
 If the AbsMeasurement is a wire hit, the left/right resolution will be used.
 
virtual int getLeftRightResolution () const
 
unsigned int getDim () const
 
void setRawHitCoords (const TVectorD &coords)
 
void setRawHitCov (const TMatrixDSym &cov)
 
void setDetId (int detId)
 
void setHitId (int hitId)
 
virtual void Print (const Option_t *="") const
 
virtual std::vector< int > labels ()
 Vector of integer labels for calibration/alignment parameters available (must match #columns of derivatives(...)) More...
 
virtual TMatrixD derivatives (const genfit::StateOnPlane *)
 Derivatives of residuals (local measurement coordinates) w.r.t. More...
 
virtual TMatrixD localDerivatives (const genfit::StateOnPlane *)
 Derivatives for additional local parameters to be fitted in global calibration algorithms together with with global parameters. More...
 
virtual std::vector< int > localLabels ()
 Vector of integer labels for local calibration parameters available (must match #columns of localDerivatives(...)) More...
 

Protected Attributes

SharedPlanePtr physicalPlane_
 
int planeId_
 This is persistent, but '!' makes ROOT shut up.
 
bool stripV_
 
TVectorD rawHitCoords_
 
TMatrixDSym rawHitCov_
 
int detId_
 
int hitId_
 
TrackPoint * trackPoint_
 Pointer to TrackPoint where the measurement belongs to.
 

Private Member Functions

 ClassDefOverride (AlignableEKLMRecoHit, 2)
 Needed to make objects storable.
 

Private Attributes

int m_Section
 Section number.
 
int m_Sector
 Sector number.
 
int m_Layer
 Layer number.
 
uint16_t m_KLMModule
 KLM module number.
 
uint16_t m_Segment
 Segment number.
 
B2Vector3D m_StripV
 V direction.
 

Detailed Description

Alignable EKLM hit.

Definition at line 29 of file AlignableEKLMRecoHit.h.

Member Function Documentation

◆ constructHMatrix()

const AbsHMatrix * constructHMatrix ( const AbsTrackRep ) const
overridevirtualinherited

Returns a new AbsHMatrix object.

Caller must take ownership.

Implements AbsMeasurement.

Reimplemented in PlanarMomentumMeasurement, SVDRecoHit, PXDRecoHit, and AlignableBKLMRecoHit.

Definition at line 67 of file PlanarMeasurement.cc.

◆ constructMeasurementsOnPlane()

std::vector< MeasurementOnPlane * > constructMeasurementsOnPlane ( const StateOnPlane state) const
overridevirtualinherited

Construct MeasurementOnPlane on plane of the state and wrt the states TrackRep.

The state will usually be the prediction or reference state, and has to be defined AT the measurement. The AbsMeasurement will be projected onto the plane. It's possible to make corrections to the coordinates here (e.g. by using the state coordinates). Usually the vector will contain only one element. But in the case of e.g. a WireMeasurement, it will be 2 (left and right).

Implements AbsMeasurement.

Reimplemented in PlanarVXDMomentumMeasurement< HitType >, SVDRecoHit2D, SVDRecoHit, PXDRecoHit, and AlignableBKLMRecoHit.

Definition at line 55 of file PlanarMeasurement.cc.

◆ constructPlane()

SharedPlanePtr constructPlane ( const StateOnPlane state) const
overridevirtualinherited

Construct (virtual) detector plane (use state's AbsTrackRep).

It's possible to make corrections to the plane here. The state should be defined somewhere near the measurement. For virtual planes, the state will be extrapolated to the POCA to point (SpacepointMeasurement) or line (WireMeasurement), and from this info the plane will be constructed.

Implements AbsMeasurement.

Definition at line 46 of file PlanarMeasurement.cc.

◆ derivatives()

virtual TMatrixD derivatives ( const genfit::StateOnPlane )
inlinevirtualinherited

Derivatives of residuals (local measurement coordinates) w.r.t.

alignment/calibration parameters Matrix "G" of derivatives valid for given prediction of track state:

G(i, j) = d_residual_i/d_parameter_j

For 2D measurement (u,v):

G = ( du/da du/db du/dc ... ) ( dv/da dv/db dv/dc ... )

for calibration parameters a, b, c.

For 1D measurement both forms are allowed:

G = ( 0 0 0 ... ) ( dv/da dv/db dv/dc ... ) for V-strip,

G = ( du/da du/db du/dc ... ) ( 0 0 0 ... ) for U-strip,

or :

G = ( d_sensitive/da d_sensitive/db d_sensitive/dc ... ) as matrix with one row.

A possible algorithm using these derivatives should be able to resolve this based on the measurement HMatrix. Measurements with more dimesions (slopes, curvature) should provide full 4-5Dx(n params) matrix (state as (q/p, u', v', u, v) or (u', v', u, v))

Parameters
sopPredicted state of the track as linearization point around which derivatives of alignment/calibration parameters shall be computed
Returns
TMatrixD Matrix with #rows = dimension of residual, #columns = number of parameters. #columns must match labels().size().

Definition at line 129 of file ICalibrationParametersDerivatives.h.

◆ globalDerivatives()

std::pair< std::vector< int >, TMatrixD > globalDerivatives ( const genfit::StateOnPlane sop)
overridevirtual

Labels and derivatives of residuals (local measurement coordinates) w.r.t.

alignment/calibration parameters Matrix "G" of derivatives valid for given prediction of track state:

G(i, j) = d_residual_i/d_parameter_j

For 2D measurement (u,v):

G = ( du/da du/db du/dc ... ) ( dv/da dv/db dv/dc ... )

for calibration parameters a, b, c.

For 1D measurement:

G = ( 0 0 0 ... ) ( dv/da dv/db dv/dc ... ) for V-strip,

G = ( du/da du/db du/dc ... ) ( 0 0 0 ... ) for U-strip,

Measurements with more dimesions (slopes, curvature) should provide full 4-5Dx(n params) matrix (state as (q/p, u', v', u, v) or (u', v', u, v))

Parameters
sopPredicted state of the track as linearization point around which derivatives of alignment/calibration parameters shall be computed
Returns
pair<vector<int>, TMatrixD> With matrix with number of rows = dimension of residual, number of columns = number of parameters. number of columns must match vector<int>.size().

Reimplemented from ICalibrationParametersDerivatives.

Definition at line 98 of file AlignableEKLMRecoHit.cc.

99 {
100  std::vector<int> labGlobal;
101  labGlobal.push_back(GlobalLabel::construct<EKLMAlignment>(m_KLMModule, KLMAlignmentData::c_DeltaU)); // dx
102  labGlobal.push_back(GlobalLabel::construct<EKLMAlignment>(m_KLMModule, KLMAlignmentData::c_DeltaV)); // dy
103  labGlobal.push_back(GlobalLabel::construct<EKLMAlignment>(m_KLMModule, KLMAlignmentData::c_DeltaGamma)); // drot
104 
105  /* Local parameters. */
106  const double dalpha = 0;
107  const double dxs = 0;
108  const double dys = 0;
109  const double sinda = sin(dalpha);
110  const double cosda = cos(dalpha);
111  /* Local position in sector coordinates. */
112  HepGeom::Point3D<double> globalPos;
113  HepGeom::Transform3D t;
114  const EKLM::TransformDataGlobalAligned* transformData =
116  t = (*transformData->getSectorTransform(m_Section, m_Layer, m_Sector)).inverse();
117  globalPos.setX(sop->getPos().X() / Unit::cm * CLHEP::cm);
118  globalPos.setY(sop->getPos().Y() / Unit::cm * CLHEP::cm);
119  globalPos.setZ(sop->getPos().Z() / Unit::cm * CLHEP::cm);
120  globalPos = t * globalPos;
121  double x = globalPos.x() / CLHEP::cm * Unit::cm;
122  double y = globalPos.y() / CLHEP::cm * Unit::cm;
123  /*
124  * Matrix of global derivatives of local coordinate (second dimension is
125  * added because of resizing in GblFitterInfo::constructGblPoint()) by
126  * variations of the detector element position.
127  * The sign is inverted to match the convention for other detectors.
128  */
129  TMatrixD derGlobal(2, 3);
130  derGlobal(0, 0) = 0;
131  derGlobal(0, 1) = 0;
132  derGlobal(0, 2) = 0;
133  derGlobal(1, 0) = cosda * m_StripV.X() - sinda * m_StripV.Y();
134  derGlobal(1, 1) = sinda * m_StripV.X() + cosda * m_StripV.Y();
135  derGlobal(1, 2) =
136  -((x - dxs) * (-sinda * m_StripV.X() - cosda * m_StripV.Y()) +
137  (y - dys) * (cosda * m_StripV.X() - sinda * m_StripV.Y()));
138  return alignment::GlobalDerivatives(labGlobal, derGlobal);
139 
140 }
B2Vector3D m_StripV
V direction.
uint16_t m_KLMModule
KLM module number.
DataType X() const
access variable X (= .at(0) without boundary check)
Definition: B2Vector3.h:431
DataType Y() const
access variable Y (= .at(1) without boundary check)
Definition: B2Vector3.h:433
Transformation data (global, aligned): singleton version.
static const TransformDataGlobalAligned & Instance()
Instantiation.
const HepGeom::Transform3D * getSectorTransform(int section, int layer, int sector) const
Get sector transformation.
@ c_DeltaU
Shift in U (EKLM: local X).
@ c_DeltaGamma
Rotation in gamma (EKLM: rotation in local plane).
@ c_DeltaV
Shift in V (EKLM: local Y).
static const double cm
Standard units with the value = 1.
Definition: Unit.h:47

◆ labels()

virtual std::vector<int> labels ( )
inlinevirtualinherited

Vector of integer labels for calibration/alignment parameters available (must match #columns of derivatives(...))

unique across all sub-detectors in calibration

Returns
std::vector< int > Vector of integer labels

Definition at line 90 of file ICalibrationParametersDerivatives.h.

◆ localDerivatives()

virtual TMatrixD localDerivatives ( const genfit::StateOnPlane )
inlinevirtualinherited

Derivatives for additional local parameters to be fitted in global calibration algorithms together with with global parameters.

Local parameters are not neccesarily identified by label because their number is proportional to number of measurements included in calibration (possibly very huge number!)

Returns
TMatrixD Matrix in form d_residual_i/d_parameter_j

Reimplemented in AlignableCDCRecoHit.

Definition at line 141 of file ICalibrationParametersDerivatives.h.

◆ localLabels()

virtual std::vector<int> localLabels ( )
inlinevirtualinherited

Vector of integer labels for local calibration parameters available (must match #columns of localDerivatives(...))

This will be usually ignored (e.g. does not have to match localDerivatives), but it is a good practice to return vector of zeros of correct size

Returns
std::vector< int > Vector of integer labels

Definition at line 151 of file ICalibrationParametersDerivatives.h.

◆ setStripV()

void setStripV ( bool  v = true)
inlineinherited

Use if the coordinate for 1D hits measured in V direction.

Per default for 1D planar hits, the coordinate is measured in U direction. With this function you can set it to be measured in V direction. This affects the outcoe of constructHMatrix().

Definition at line 70 of file PlanarMeasurement.h.


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