 |
Belle II Software
release-05-01-25
|
10 #include <tracking/trackFindingCDC/fitting/CDCSZObservations.h>
12 #include <tracking/trackFindingCDC/fitting/EigenObservationMatrix.h>
14 #include <tracking/trackFindingCDC/eventdata/tracks/CDCTrack.h>
15 #include <tracking/trackFindingCDC/eventdata/segments/CDCSegment3D.h>
16 #include <tracking/trackFindingCDC/eventdata/hits/CDCRecoHit3D.h>
18 #include <tracking/trackFindingCDC/topology/CDCWire.h>
20 #include <framework/logging/Logger.h>
23 using namespace TrackFindingCDC;
27 if (std::isnan(s))
return 0;
28 if (std::isnan(z))
return 0;
29 if (std::isnan(weight)) {
30 B2WARNING(
"Weight is nan. Skipping observation");
59 double dispNorm = disp2D.
norm();
62 if (dispNorm == 0.0) {
63 zeta = wireVector.
xy().
norm() / wireVector.
z();
65 zeta = wireVector.
xy().
dot(disp2D) / wireVector.
z() / dispNorm;
68 weight = zeta * zeta / driftlengthVariance;
71 size_t appendedHit =
fill(s, z, weight);
77 std::size_t nAppendedHits = 0;
79 nAppendedHits +=
append(recoHit3D);
86 const std::vector<CDCRecoHit3D> recoHit3Ds = segment3D;
92 const std::vector<CDCRecoHit3D> recoHit3Ds = track;
98 std::size_t n =
size();
99 if (n == 0)
return Vector2D(NAN, NAN);
100 std::size_t i = n / 2;
115 Eigen::Matrix<double, 1, 2> eigenOrigin(origin.
x(), origin.
y());
116 EigenObservationMatrix eigenObservations = getEigenObservationMatrix(
this);
117 eigenObservations.leftCols<2>().rowwise() -= eigenOrigin;
Vector2D getRecoDisp2D() const
Gets the displacement from the wire position in the xy plain at the reconstructed position.
const CDCWire & getWire() const
Getter for the wire.
Vector2D centralize()
Picks one observation as a reference point and transform all observations to that new origin.
Class representing a three dimensional reconstructed hit.
Vector2D getCentralPoint() const
Extracts the observation center that is at the index in the middle.
Class representing a sequence of three dimensional reconstructed hits.
A two dimensional vector which is equipped with functions for correct handeling of orientation relat...
double normSquared() const
Calculates .
EFitVariance m_fitVariance
Indicator which variance information should preferably be extracted from hits in calls to append.
double y() const
Getter for the y coordinate.
bool isAxial() const
Indicator if the underlying wire is axial.
std::size_t append(const CDCRecoHit3D &recoHit3D)
Appends the observed position.
std::size_t size() const
Returns the number of observations stored.
A segment consisting of three dimensional reconstructed hits.
Vector3D getWireVector() const
Getter for the vector pointing from the back end ofthe wire to the front end of the wire.
double getArcLength2D() const
Getter for the travel distance in the xy projection.
double dot(const Vector2D &rhs) const
Calculates the two dimensional dot product.
void passiveMoveBy(const Vector2D &origin)
Moves all observations passively such that the given vector becomes to origin of the new coordinate s...
double getRecoDriftLengthVariance() const
Returns the drift length variance next to the reconstructed position.
double getZ(int iObservation) const
Getter for the z value of the observation at the given index.
Abstract base class for different kinds of events.
A three dimensional vector.
const Vector2D & xy() const
Getter for the xy projected vector ( reference ! )
double x() const
Getter for the x coordinate.
std::size_t appendRange(const std::vector< CDCRecoHit3D > &recoHit3Ds)
Appends all reconstructed hits from the three dimensional track.
double norm() const
Calculates the length of the vector.
double getS(int iObservation) const
Getter for the arc length value of the observation at the given index.
Class representing a sense wire in the central drift chamber.
std::vector< double > m_szObservations
Memory for the individual observations.
double z() const
Getter for the z coordinate.
const Vector3D & getRecoPos3D() const
Getter for the 3d position of the hit.
std::size_t fill(double s, double z, double weight=1.0)
Appends the observed position.
bool m_onlyStereo
Switch to only use information from stereo hits.