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 genfit::PlanarMeasurement(HIT_DIMENSIONS), m_sensorID(0), m_trueHit(0),
25 m_cluster(0), m_isU(0), m_energyDep(0), m_rotationPhi(0)
31 genfit::PlanarMeasurement(HIT_DIMENSIONS), m_sensorID(0), m_trueHit(hit),
32 m_cluster(0), m_isU(uDirection), m_energyDep(0), m_rotationPhi(0)
37 if (!gRandom) B2FATAL(
"gRandom not initialized, please set up gRandom first");
45 sigma = (
m_isU) ? geometry.getUPitch(hit->getV()) /
sqrt(12) : geometry.getVPitch() /
sqrt(12);
49 rawHitCoords_(0) = (
m_isU) ? gRandom->Gaus(hit->getU(), sigma) : gRandom->Gaus(hit->getV(), sigma);
51 rawHitCov_(0, 0) = sigma * sigma;
59 genfit::PlanarMeasurement(HIT_DIMENSIONS), m_sensorID(0), m_trueHit(0),
60 m_cluster(hit), m_energyDep(0), m_rotationPhi(0)
64 m_isU = hit->isUCluster();
71 bool isWedgeU =
m_isU && (geometry.getBackwardWidth() > geometry.getForwardWidth());
74 rawHitCoords_(0) = hit->getPosition();
78 m_rotationPhi = atan2((geometry.getBackwardWidth() - geometry.getForwardWidth()) / geometry.getWidth(0) * hit->getPosition(),
79 geometry.getLength());
82 rawHitCov_(0, 0) = hit->getPositionSigma() * hit->getPositionSigma();
93 bool isWedgeU =
m_isU && (geometry.getBackwardWidth() > geometry.getForwardWidth());
96 ROOT::Math::XYZVector uLocal(1, 0, 0);
97 ROOT::Math::XYZVector vLocal(0, 1, 0);
98 ROOT::Math::XYZVector origin = geometry.pointToGlobal(ROOT::Math::XYZVector(0, 0, 0),
true);
99 ROOT::Math::XYZVector uGlobal = geometry.vectorToGlobal(uLocal,
true);
100 ROOT::Math::XYZVector vGlobal = geometry.vectorToGlobal(vLocal,
true);
116 const genfit::StateOnPlane& state)
const
119 auto L1 = [](
double x) {
return x;};
120 auto L2 = [](
double x) {
return (3 * x * x - 1) / 2;};
121 auto L3 = [](
double x) {
return (5 * x * x * x - 3 * x) / 2;};
122 auto L4 = [](
double x) {
return (35 * x * x * x * x - 30 * x * x + 3) / 8;};
133 v = state.getState()(4);
134 width = geometry.getWidth(v);
135 length = geometry.getLength();
142 u = state.getState()(3);
143 length = geometry.getLength();
144 width = geometry.getWidth(v);
156 planarParameters[0] * L2(u) + planarParameters[1] * L1(u) * L1(v) + planarParameters[2] * L2(v) +
157 planarParameters[3] * L3(u) + planarParameters[4] * L2(u) * L1(v) + planarParameters[5] * L1(u) * L2(v) + planarParameters[6] * L3(
159 planarParameters[7] * L4(u) + planarParameters[8] * L3(u) * L1(v) + planarParameters[9] * L2(u) * L2(v) + planarParameters[10] * L1(
160 u) * L3(v) + planarParameters[11] * L4(v);
162 double du_dw = state.getState()[1];
163 double dv_dw = state.getState()[2];
171 pos[0] = u + dw * du_dw;
173 pos[0] = v + dw * dv_dw;
187 return std::vector<genfit::MeasurementOnPlane*>(1,
new genfit::MeasurementOnPlane(pos, rawHitCov_, state.getPlane(),
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_);
206 return std::vector<genfit::MeasurementOnPlane*>(1,
new genfit::MeasurementOnPlane(pos, cov, state.getPlane(), state.getRep(),
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...
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a referecne to the SensorInfo of a given SensorID.
static GeoCache & getInstance()
Return a reference to the singleton instance.
A Finite plane of one VXD Sensor.
void setRotation(double phi)
Set plane rotation angle.
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.