9 #include <framework/logging/Logger.h>
10 #include <framework/geometry/VectorUtil.h>
11 #include <svd/reconstruction/SVDRecoHit2D.h>
12 #include <svd/geometry/SensorInfo.h>
13 #include <vxd/geometry/SensorPlane.h>
14 #include <vxd/geometry/GeoCache.h>
16 #include <genfit/DetPlane.h>
24 SVDRecoHit2D::SVDRecoHit2D():
25 genfit::PlanarMeasurement(HIT_DIMENSIONS), m_sensorID(0), m_trueHit(0), m_uCluster(0), m_vCluster(0),
30 genfit::PlanarMeasurement(HIT_DIMENSIONS), m_sensorID(0), m_trueHit(hit), m_uCluster(0), m_vCluster(0),
33 if (!gRandom) B2FATAL(
"gRandom not initialized, please set up gRandom first");
39 if (sigmaU < 0 || sigmaV < 0) {
41 sigmaU = geometry.getUPitch(hit->getV()) /
sqrt(12);
42 sigmaV = geometry.getVPitch(hit->getV()) /
sqrt(12);
46 rawHitCoords_(0) = gRandom->Gaus(hit->getU(), sigmaU);
47 rawHitCoords_(1) = gRandom->Gaus(hit->getV(), sigmaV);
49 rawHitCov_(0, 0) = sigmaU * sigmaU;
52 rawHitCov_(1, 1) = sigmaV * sigmaV;
60 genfit::PlanarMeasurement(HIT_DIMENSIONS), m_sensorID(vxdid), m_trueHit(nullptr), m_uCluster(0), m_vCluster(0),
64 if (sigmaU < 0 || sigmaV < 0) {
66 sigmaU = geometry.getUPitch(v) /
sqrt(12);
67 sigmaV = geometry.getVPitch(v) /
sqrt(12);
73 rawHitCov_(0, 0) = sigmaU * sigmaU;
76 rawHitCov_(1, 1) = sigmaV * sigmaV;
82 genfit::PlanarMeasurement(HIT_DIMENSIONS), m_trueHit(nullptr), m_uCluster(&uHit), m_vCluster(&vHit),
86 B2FATAL(
"Error in SVDRecoHit2D: Incorrect SVDCluster instances on input!");
95 (info.getForwardWidth() - info.getBackwardWidth()) / info.getLength() / info.getWidth(0);
96 double scaleFactorU = 1 + DeltaU * vHit.
getPosition();
98 double one_over_cos_phi_sqr = 1 + tan_phi * tan_phi;
100 rawHitCoords_[0] = uHit.
getPosition() * scaleFactorU;
104 double sigmaU_sq = sigmaU * sigmaU;
106 double sigmaV_sq = sigmaV * sigmaV;
110 rawHitCov_(0, 0) = sigmaV_sq * tan_phi * tan_phi + sigmaU_sq * one_over_cos_phi_sqr;
111 rawHitCov_(0, 1) = sigmaV_sq * tan_phi;
112 rawHitCov_(1, 0) = sigmaV_sq * tan_phi;
113 rawHitCov_(1, 1) = sigmaV_sq;
119 genfit::PlanarMeasurement(HIT_DIMENSIONS), m_trueHit(nullptr), m_uCluster(0), m_vCluster(0), m_energyDep(0)
124 B2FATAL(
"Error in SVDRecoHit2D: Incorrect SVDCluster instances on input!");
135 (info.getForwardWidth() - info.getBackwardWidth()) / info.getLength() / info.getWidth(0);
136 double scaleFactorU = 1 + DeltaU * vHit.
getPosition();
138 double one_over_cos_phi_sqr = 1 + tan_phi * tan_phi;
140 rawHitCoords_[0] = uHit.
getPosition() * scaleFactorU;
144 double sigmaU_sq = sigmaU * sigmaU;
146 double sigmaV_sq = sigmaV * sigmaV;
150 rawHitCov_(0, 0) = sigmaV_sq * tan_phi * tan_phi + sigmaU_sq * one_over_cos_phi_sqr;
151 rawHitCov_(0, 1) = sigmaV_sq * tan_phi;
152 rawHitCov_(1, 0) = sigmaV_sq * tan_phi;
153 rawHitCov_(1, 1) = sigmaV_sq;
164 ROOT::Math::XYZVector origin = geometry.pointToGlobal(ROOT::Math::XYZVector(0, 0, 0),
true);
165 ROOT::Math::XYZVector uGlobal = geometry.vectorToGlobal(ROOT::Math::XYZVector(1, 0, 0),
true);
166 ROOT::Math::XYZVector vGlobal = geometry.vectorToGlobal(ROOT::Math::XYZVector(0, 1, 0),
true);
178 auto L1 = [](
double x) {
return x;};
179 auto L2 = [](
double x) {
return (3 * x * x - 1) / 2;};
180 auto L3 = [](
double x) {
return (5 * x * x * x - 3 * x) / 2;};
181 auto L4 = [](
double x) {
return (35 * x * x * x * x - 30 * x * x + 3) / 8;};
185 double u = rawHit[0];
186 double v = rawHit[1];
187 double width = geometry.getWidth(v);
188 double length = geometry.getLength();
197 planarParameters[0] * L2(u) + planarParameters[1] * L1(u) * L1(v) + planarParameters[2] * L2(v) +
198 planarParameters[3] * L3(u) + planarParameters[4] * L2(u) * L1(v) + planarParameters[5] * L1(u) * L2(v) + planarParameters[6] * L3(
200 planarParameters[7] * L4(u) + planarParameters[8] * L3(u) * L1(v) + planarParameters[9] * L2(u) * L2(v) + planarParameters[10] * L1(
201 u) * L3(v) + planarParameters[11] * L4(v);
203 double du_dw = state.getState()[1];
204 double dv_dw = state.getState()[2];
211 pos[0] = u + dw * du_dw;
212 pos[1] = v + dw * dv_dw;
223 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.
static constexpr auto XYZToTVector
Helper function to convert XYZVector to TVector3.
double sqrt(double a)
sqrt for double
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.