9 #include <framework/logging/Logger.h>
10 #include <svd/reconstruction/SVDRecoHit2D.h>
11 #include <svd/geometry/SensorInfo.h>
12 #include <vxd/geometry/SensorPlane.h>
13 #include <vxd/geometry/GeoCache.h>
15 #include <genfit/DetPlane.h>
23 SVDRecoHit2D::SVDRecoHit2D():
24 genfit::PlanarMeasurement(HIT_DIMENSIONS), m_sensorID(0), m_trueHit(0), m_uCluster(0), m_vCluster(0),
29 genfit::PlanarMeasurement(HIT_DIMENSIONS), m_sensorID(0), m_trueHit(hit), m_uCluster(0), m_vCluster(0),
32 if (!gRandom) B2FATAL(
"gRandom not initialized, please set up gRandom first");
38 if (sigmaU < 0 || sigmaV < 0) {
40 sigmaU = geometry.getUPitch(hit->getV()) / sqrt(12);
41 sigmaV = geometry.getVPitch(hit->getV()) / sqrt(12);
45 rawHitCoords_(0) = gRandom->Gaus(hit->getU(), sigmaU);
46 rawHitCoords_(1) = gRandom->Gaus(hit->getV(), sigmaV);
48 rawHitCov_(0, 0) = sigmaU * sigmaU;
51 rawHitCov_(1, 1) = sigmaV * sigmaV;
59 genfit::PlanarMeasurement(HIT_DIMENSIONS), m_sensorID(vxdid), m_trueHit(nullptr), m_uCluster(0), m_vCluster(0),
63 if (sigmaU < 0 || sigmaV < 0) {
65 sigmaU = geometry.getUPitch(v) / sqrt(12);
66 sigmaV = geometry.getVPitch(v) / sqrt(12);
72 rawHitCov_(0, 0) = sigmaU * sigmaU;
75 rawHitCov_(1, 1) = sigmaV * sigmaV;
81 genfit::PlanarMeasurement(HIT_DIMENSIONS), m_trueHit(nullptr), m_uCluster(&uHit), m_vCluster(&vHit),
85 B2FATAL(
"Error in SVDRecoHit2D: Incorrect SVDCluster instances on input!");
94 (info.getForwardWidth() - info.getBackwardWidth()) / info.getLength() / info.getWidth(0);
95 double scaleFactorU = 1 + DeltaU * vHit.
getPosition();
97 double one_over_cos_phi_sqr = 1 + tan_phi * tan_phi;
99 rawHitCoords_[0] = uHit.
getPosition() * scaleFactorU;
103 double sigmaU_sq = sigmaU * sigmaU;
105 double sigmaV_sq = sigmaV * sigmaV;
109 rawHitCov_(0, 0) = sigmaV_sq * tan_phi * tan_phi + sigmaU_sq * one_over_cos_phi_sqr;
110 rawHitCov_(0, 1) = sigmaV_sq * tan_phi;
111 rawHitCov_(1, 0) = sigmaV_sq * tan_phi;
112 rawHitCov_(1, 1) = sigmaV_sq;
118 genfit::PlanarMeasurement(HIT_DIMENSIONS), m_trueHit(nullptr), m_uCluster(0), m_vCluster(0), m_energyDep(0)
123 B2FATAL(
"Error in SVDRecoHit2D: Incorrect SVDCluster instances on input!");
134 (info.getForwardWidth() - info.getBackwardWidth()) / info.getLength() / info.getWidth(0);
135 double scaleFactorU = 1 + DeltaU * vHit.
getPosition();
137 double one_over_cos_phi_sqr = 1 + tan_phi * tan_phi;
139 rawHitCoords_[0] = uHit.
getPosition() * scaleFactorU;
143 double sigmaU_sq = sigmaU * sigmaU;
145 double sigmaV_sq = sigmaV * sigmaV;
149 rawHitCov_(0, 0) = sigmaV_sq * tan_phi * tan_phi + sigmaU_sq * one_over_cos_phi_sqr;
150 rawHitCov_(0, 1) = sigmaV_sq * tan_phi;
151 rawHitCov_(1, 0) = sigmaV_sq * tan_phi;
152 rawHitCov_(1, 1) = sigmaV_sq;
163 TVector3 origin = geometry.pointToGlobal(TVector3(0, 0, 0),
true);
164 TVector3 uGlobal = geometry.vectorToGlobal(TVector3(1, 0, 0),
true);
165 TVector3 vGlobal = geometry.vectorToGlobal(TVector3(0, 1, 0),
true);
176 auto L1 = [](
double x) {
return x;};
177 auto L2 = [](
double x) {
return (3 * x * x - 1) / 2;};
178 auto L3 = [](
double x) {
return (5 * x * x * x - 3 * x) / 2;};
179 auto L4 = [](
double x) {
return (35 * x * x * x * x - 30 * x * x + 3) / 8;};
183 double u = rawHit[0];
184 double v = rawHit[1];
185 double width = geometry.getWidth(v);
186 double length = geometry.getLength();
195 planarParameters[0] * L2(u) + planarParameters[1] * L1(u) * L1(v) + planarParameters[2] * L2(v) +
196 planarParameters[3] * L3(u) + planarParameters[4] * L2(u) * L1(v) + planarParameters[5] * L1(u) * L2(v) + planarParameters[6] * L3(
198 planarParameters[7] * L4(u) + planarParameters[8] * L3(u) * L1(v) + planarParameters[9] * L2(u) * L2(v) + planarParameters[10] * L1(
199 u) * L3(v) + planarParameters[11] * L4(v);
201 double du_dw = state.getState()[1];
202 double dv_dw = state.getState()[2];
209 pos[0] = u + dw * du_dw;
210 pos[1] = v + dw * dv_dw;
221 state.getRep(), this->constructHMatrix(state.getRep())));
The SVD Cluster class This class stores all information about reconstructed SVD clusters.
float getCharge() const
Get collected charge.
bool isUCluster() const
Get the direction of strips.
float getPosition(double v=0) const
Get the coordinate of reconstructed hit.
float getPositionSigma() const
Get the error of the reconstructed hit coordinate.
unsigned short getRawSensorID() const
Get raw sensor ID.
virtual std::vector< genfit::MeasurementOnPlane * > constructMeasurementsOnPlane(const genfit::StateOnPlane &state) const override
Get deposited energy error.
TVectorD applyPlanarDeformation(TVectorD rawHit, std::vector< double > planarParameters, const genfit::StateOnPlane &state) const
Apply planar deformation of sensors.
float m_energyDep
deposited energy.
unsigned short m_sensorID
Unique sensor identifier.
const SVDCluster * m_uCluster
Pointer to mother uCluster.
void setDetectorPlane()
Set up Detector plane information.
genfit::AbsMeasurement * clone() const override
Creating a deep copy of this hit.
SVDRecoHit2D()
Default constructor for ROOT IO.
const SVDCluster * m_vCluster
Pointer to mother vCluster.
SVDRecoHit - an extended form of SVDHit containing geometry information.
const SVDCluster * getCluster() const
Get pointer to the Cluster used when creating this RecoHit, can be nullptr if created from something ...
Class SVDTrueHit - Records of tracks that either enter or leave the sensitive volume.
Specific implementation of SensorInfo for SVD Sensors which provides additional sensor specific infor...
static const SensorInfoBase & get(Belle2::VxdID id)
Return a reference to the SensorInfo of a given SensorID.
A Finite plane of one VXD Sensor.
unsigned short baseType
The base integer type for VxdID.
Contains the measurement and covariance in raw detector coordinates.
Measured coordinates on a plane.
A state with arbitrary dimension defined in a DetPlane.
Hit object for use in TrackCand.
Abstract base class for different kinds of events.
Defines for I/O streams used for error and debug printing.
std::shared_ptr< genfit::DetPlane > SharedPlanePtr
Shared Pointer to a DetPlane.