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

Alignable BKLM hit. More...

#include <AlignableBKLMRecoHit.h>

Inheritance diagram for AlignableBKLMRecoHit:
Collaboration diagram for AlignableBKLMRecoHit:

Public Member Functions

 AlignableBKLMRecoHit ()
 Constructor.
 
 AlignableBKLMRecoHit (const KLMHit2d *hit, const genfit::TrackCandHit *trackCandHit)
 Constructor. More...
 
virtual ~AlignableBKLMRecoHit ()
 Destructor.
 
genfit::AbsMeasurementclone () const override
 Creating a deep copy of this hit.
 
virtual std::vector< genfit::MeasurementOnPlane * > constructMeasurementsOnPlane (const genfit::StateOnPlane &state) const override
 Measurement construction.
 
virtual const genfit::AbsHMatrixconstructHMatrix (const genfit::AbsTrackRep *) const override
 Get the genfit projection H matrix (to U,V).
 
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...
 
int getPlaneId () const
 
virtual SharedPlanePtr constructPlane (const StateOnPlane &state) const override
 Construct (virtual) detector plane (use state's AbsTrackRep). 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 Types

enum  { HIT_DIMENSIONS = 2 }
 

Private Member Functions

 ClassDefOverride (AlignableBKLMRecoHit, 1)
 Class version.
 

Private Attributes

uint16_t m_KLMModule
 KLM module number.
 
int m_Layer
 Hit layer.
 
const bklm::Modulem_Module
 Module used to get geometry information.
 
CLHEP::Hep3Vector global
 not streamed More...
 
const double halfheight_sci = 0.5
 not streamed More...
 

Detailed Description

Alignable BKLM hit.

Definition at line 30 of file AlignableBKLMRecoHit.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
HIT_DIMENSIONS 

sensitive Dimensions of the Hit

Definition at line 111 of file AlignableBKLMRecoHit.h.

111 { HIT_DIMENSIONS = 2 };
@ HIT_DIMENSIONS
sensitive Dimensions of the Hit

Constructor & Destructor Documentation

◆ AlignableBKLMRecoHit()

AlignableBKLMRecoHit ( const KLMHit2d hit,
const genfit::TrackCandHit trackCandHit 
)
explicit

Constructor.

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

the directioin (in global coordinates) of this module's U axis

the directioin (in global coordinates) of this module's V axis

Definition at line 25 of file AlignableBKLMRecoHit.cc.

25  :
27 {
28  int section = hit->getSection();
29  int sector = hit->getSector();
30  m_Layer = hit->getLayer();
31  const KLMElementNumbers* elementNumbers = &(KLMElementNumbers::Instance());
32  m_KLMModule = elementNumbers->moduleNumberBKLM(section, sector, m_Layer);
33 
35  m_Module = m_GeoPar->findModule(section, sector, m_Layer);
36 
37  //+++ global coordinates of the hit
38  global[0] = hit->getPositionX();
39  global[1] = hit->getPositionY();
40  global[2] = hit->getPositionZ();
41 
42  //+++ local coordinates of the hit
43  CLHEP::Hep3Vector local = m_Module->globalToLocal(global);
44 
45  //+++ local coordinates in KLM m_Layer of the hit
46  double localU = local[1]; //phi
47  double localV = local[2]; //z
48  double errorU = m_Module->getPhiStripWidth() / sqrt(12);
49  double errorV = m_Module->getZStripWidth() / sqrt(12);
50 
51  if (hit->inRPC()) {
52  //+++ scale localU and localV based on measured-in-Belle resolution
53  int nStrips = hit->getPhiStripMax() - hit->getPhiStripMin() + 1;
54  double dn = nStrips - 1.5;
55  double factor = std::pow((0.9 + 0.4 * dn * dn), 1.5) * 0.60;//measured-in-Belle resolution
56  errorU = errorU * sqrt(factor);
57 
58  nStrips = hit->getZStripMax() - hit->getZStripMin() + 1;
59  dn = nStrips - 1.5;
60  factor = std::pow((0.9 + 0.4 * dn * dn), 1.5) * 0.55;//measured-in-Belle resolution
61  errorV = errorV * sqrt(factor);
62  }
63 
64  //Set positions
65  rawHitCoords_(0) = localU;
66  rawHitCoords_(1) = localV;
67  //Set the error covariance matrix
68  rawHitCov_(0, 0) = errorU * errorU; // error in U, squared
69  rawHitCov_(0, 1) = 0.;
70  rawHitCov_(1, 0) = 0.;
71  rawHitCov_(1, 1) = errorV * errorV; // error in V, squared
72 
73  //+++ Construct vectors o, u, v of m_Layer in global coords.
74  CLHEP::Hep3Vector gOrigin = m_Module->getGlobalOrigin();
75  CLHEP::Hep3Vector lOrigin = m_Module->globalToLocal(gOrigin) + m_Module->getLocalReconstructionShift();
76  CLHEP::Hep3Vector gOrigin_midway = m_Module->localToGlobal(lOrigin);
77  CLHEP::Hep3Vector uAxis(0, 1, 0);
78  CLHEP::Hep3Vector vAxis(0, 0, 1);
79  CLHEP::Hep3Vector gUaxis = m_Module->localToGlobal(uAxis) - gOrigin;
80  CLHEP::Hep3Vector gVaxis = m_Module->localToGlobal(vAxis) - gOrigin;
81 
83  B2Vector3D origin_mid(gOrigin_midway[0], gOrigin_midway[1], gOrigin_midway[2]);
84 
86  B2Vector3D uGlobal(gUaxis[0], gUaxis[1], gUaxis[2]);
88  B2Vector3D vGlobal(gVaxis[0], gVaxis[1], gVaxis[2]);
89 
90  genfit::SharedPlanePtr detPlane(new genfit::DetPlane(origin_mid, uGlobal, vGlobal, 0));
91  setPlane(detPlane, m_KLMModule);
92 }
CLHEP::Hep3Vector global
not streamed
const bklm::Module * m_Module
Module used to get geometry information.
uint16_t m_KLMModule
KLM module number.
KLM element numbers.
static const KLMElementNumbers & Instance()
Instantiation.
KLMModuleNumber moduleNumberBKLM(int section, int sector, int layer) const
Get module number for BKLM.
Provides BKLM geometry parameters for simulation, reconstruction etc (from Gearbox or DataBase)
Definition: GeometryPar.h:37
const Module * findModule(int section, int sector, int layer) const
Get the pointer to the definition of a module.
Definition: GeometryPar.cc:721
static GeometryPar * instance(void)
Static method to get a reference to the singleton GeometryPar instance.
Definition: GeometryPar.cc:27
const CLHEP::Hep3Vector globalToLocal(const CLHEP::Hep3Vector &v, bool reco=false) const
Transform space-point within this module from global to local coordinates.
Definition: Module.cc:339
double getPhiStripWidth() const
Get phi-strip width.
Definition: Module.h:137
const CLHEP::Hep3Vector getLocalReconstructionShift() const
Return the local-coordinate real-vs-ideal translation of this module's sensitive volume; nominally (0...
Definition: Module.h:279
const CLHEP::Hep3Vector getGlobalOrigin() const
Return the position (in global coordinates) of this module's sensitive-volume origin.
Definition: Module.h:285
const CLHEP::Hep3Vector localToGlobal(const CLHEP::Hep3Vector &v, bool reco=false) const
Transform space-point within this module from local to global coordinates.
Definition: Module.cc:326
double getZStripWidth() const
Get z-strip width.
Definition: Module.h:155
Detector plane.
Definition: DetPlane.h:59
Measurement class implementing a planar hit geometry (1 or 2D).
double sqrt(double a)
sqrt for double
Definition: beamHelpers.h:28
std::shared_ptr< genfit::DetPlane > SharedPlanePtr
Shared Pointer to a DetPlane.

Member Function Documentation

◆ 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.

46  {
47  if (!physicalPlane_) {
48  Exception exc("PlanarMeasurement::constructPlane(): No plane has been set!", __LINE__,__FILE__);
49  throw exc;
50  }
51  return physicalPlane_;
52 }

◆ 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.

129 {return TMatrixD();}

◆ 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 124 of file AlignableBKLMRecoHit.cc.

◆ 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.

70 {stripV_ = v;}

Member Data Documentation

◆ global

CLHEP::Hep3Vector global
private

not streamed

global coordiante of the hit.

Definition at line 123 of file AlignableBKLMRecoHit.h.

◆ halfheight_sci

const double halfheight_sci = 0.5
private

not streamed

half height of scintillator module

Definition at line 126 of file AlignableBKLMRecoHit.h.


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