9 #include <framework/logging/Logger.h>
10 #include <framework/geometry/VectorUtil.h>
11 #include <svd/reconstruction/SVDRecoHit.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 SVDRecoHit::SVDRecoHit():
25 genfit::PlanarMeasurement(HIT_DIMENSIONS), m_sensorID(0), m_trueHit(0),
26 m_cluster(0), m_isU(0), m_energyDep(0), m_rotationPhi(0)
32 genfit::PlanarMeasurement(HIT_DIMENSIONS), m_sensorID(0), m_trueHit(hit),
33 m_cluster(0), m_isU(uDirection), m_energyDep(0), m_rotationPhi(0)
38 if (!gRandom) B2FATAL(
"gRandom not initialized, please set up gRandom first");
46 sigma = (
m_isU) ? geometry.getUPitch(hit->getV()) /
sqrt(12) : geometry.getVPitch() /
sqrt(12);
50 rawHitCoords_(0) = (
m_isU) ? gRandom->Gaus(hit->getU(), sigma) : gRandom->Gaus(hit->getV(), sigma);
52 rawHitCov_(0, 0) = sigma * sigma;
60 genfit::PlanarMeasurement(HIT_DIMENSIONS), m_sensorID(0), m_trueHit(0),
61 m_cluster(hit), m_energyDep(0), m_rotationPhi(0)
65 m_isU = hit->isUCluster();
72 bool isWedgeU =
m_isU && (geometry.getBackwardWidth() > geometry.getForwardWidth());
75 rawHitCoords_(0) = hit->getPosition();
79 m_rotationPhi = atan2((geometry.getBackwardWidth() - geometry.getForwardWidth()) / geometry.getWidth(0) * hit->getPosition(),
80 geometry.getLength());
83 rawHitCov_(0, 0) = hit->getPositionSigma() * hit->getPositionSigma();
94 bool isWedgeU =
m_isU && (geometry.getBackwardWidth() > geometry.getForwardWidth());
97 ROOT::Math::XYZVector uLocal(1, 0, 0);
98 ROOT::Math::XYZVector vLocal(0, 1, 0);
99 ROOT::Math::XYZVector origin = geometry.pointToGlobal(ROOT::Math::XYZVector(0, 0, 0),
true);
100 ROOT::Math::XYZVector uGlobal = geometry.vectorToGlobal(uLocal,
true);
101 ROOT::Math::XYZVector vGlobal = geometry.vectorToGlobal(vLocal,
true);
120 auto L1 = [](
double x) {
return x;};
121 auto L2 = [](
double x) {
return (3 * x * x - 1) / 2;};
122 auto L3 = [](
double x) {
return (5 * x * x * x - 3 * x) / 2;};
123 auto L4 = [](
double x) {
return (35 * x * x * x * x - 30 * x * x + 3) / 8;};
134 v = state.getState()(4);
135 width = geometry.getWidth(v);
136 length = geometry.getLength();
143 u = state.getState()(3);
144 length = geometry.getLength();
145 width = geometry.getWidth(v);
157 planarParameters[0] * L2(u) + planarParameters[1] * L1(u) * L1(v) + planarParameters[2] * L2(v) +
158 planarParameters[3] * L3(u) + planarParameters[4] * L2(u) * L1(v) + planarParameters[5] * L1(u) * L2(v) + planarParameters[6] * L3(
160 planarParameters[7] * L4(u) + planarParameters[8] * L3(u) * L1(v) + planarParameters[9] * L2(u) * L2(v) + planarParameters[10] * L1(
161 u) * L3(v) + planarParameters[11] * L4(v);
163 double du_dw = state.getState()[1];
164 double dv_dw = state.getState()[2];
172 pos[0] = u + dw * du_dw;
174 pos[0] = v + dw * dv_dw;
188 state.getRep(), this->constructHMatrix(state.getRep())));
193 double u = rawHitCoords_(0);
194 double v = state.getState()(4);
196 double scale = uPrime / u;
204 TMatrixDSym cov(scale * scale * rawHitCov_);
207 this->constructHMatrix(state.getRep())));
The SVD Cluster class This class stores all information about reconstructed SVD clusters.
virtual std::vector< genfit::MeasurementOnPlane * > constructMeasurementsOnPlane(const genfit::StateOnPlane &state) const override
Methods that actually interface to Genfit.
TVectorD applyPlanarDeformation(TVectorD rawHit, std::vector< double > planarParameters, const genfit::StateOnPlane &state) const
Apply planar deformation of sensors.
float m_energyDep
deposited energy.
bool m_isU
transient member (not written out during streaming)
unsigned short m_sensorID
Unique sensor identifier.
void setDetectorPlane()
Set up Detector plane information.
float m_rotationPhi
angle of the plane rotation, for u in wedge sensors.
genfit::AbsMeasurement * clone() const override
Creating a deep copy of this hit.
SVDRecoHit()
Default constructor for ROOT IO.
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.
void setRotation(double phi)
Set plane rotation angle.
Contains the measurement and covariance in raw detector coordinates.
Measured coordinates on a plane.
void setStripV(bool v=true)
Use if the coordinate for 1D hits measured in V direction.
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
double tan(double a)
tan 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.