 |
Belle II Software
release-05-01-25
|
10 #include <tracking/trackFindingCDC/fitting/CDCAxialStereoFusion.h>
12 #include <tracking/trackFindingCDC/fitting/CDCSZFitter.h>
13 #include <tracking/trackFindingCDC/fitting/CDCRiemannFitter.h>
15 #include <tracking/trackFindingCDC/eventdata/tracks/CDCSegmentPair.h>
16 #include <tracking/trackFindingCDC/eventdata/segments/CDCSegment3D.h>
17 #include <tracking/trackFindingCDC/eventdata/segments/CDCSegment2D.h>
18 #include <tracking/trackFindingCDC/eventdata/trajectories/CDCTrajectory3D.h>
19 #include <tracking/trackFindingCDC/eventdata/trajectories/CDCTrajectory2D.h>
20 #include <tracking/trackFindingCDC/eventdata/trajectories/CDCTrajectorySZ.h>
22 #include <tracking/trackFindingCDC/topology/CDCWire.h>
25 using namespace TrackFindingCDC;
28 CDCSegment3D reconstruct(
const CDCSegment2D& segment2D,
29 const CDCTrajectory3D& trajectory3D)
32 CDCTrajectory2D trajectory2D = trajectory3D.getTrajectory2D();
33 CDCTrajectorySZ trajectorySZ = trajectory3D.getTrajectorySZ();
35 result.reserve(segment2D.size());
36 for (
const CDCRecoHit2D& recoHit2D : segment2D) {
48 if (not ptrFromSegment) {
49 B2WARNING(
"From segment unset.");
53 if (not ptrToSegment) {
54 B2WARNING(
"To segment unset.");
70 if (not ptrFromSegment) {
71 B2WARNING(
"From segment unset.");
75 if (not ptrToSegment) {
76 B2WARNING(
"To segment unset.");
97 if (fromSegment2D.empty()) {
98 B2WARNING(
"From segment is empty.");
102 if (toSegment2D.empty()) {
103 B2WARNING(
"To segment is empty.");
107 bool fromIsAxial = fromSegment2D.
isAxial();
108 const CDCSegment2D& axialSegment2D = fromIsAxial ? fromSegment2D : toSegment2D;
109 const CDCSegment2D& stereoSegment2D = not fromIsAxial ? fromSegment2D : toSegment2D;
113 Vector2D localOrigin2D = (fromIsAxial ? fromSegment2D.back() : toSegment2D.front()).getRecoPos2D();
121 trajectorySZ = szFitter.
fit(stereoSegment3D);
128 CDCTrajectory3D preliminaryTrajectory3D(axialTrajectory2D, trajectorySZ);
129 Vector3D localOrigin3D(localOrigin2D, 0.0);
131 return preliminaryTrajectory3D;
145 CDCSegment3D fromSegment3D = reconstruct(fromSegment2D, preliminaryTrajectory3D);
146 CDCSegment3D toSegment3D = reconstruct(toSegment2D, preliminaryTrajectory3D);
149 double tanLambda = preliminaryTrajectory3D.
getTanLambda();
175 size_t nHits = segment3D.size();
182 const Vector2D& recoPos2D = recoHit3D.getRecoPos2D();
183 const Vector2D localRecoPos2D = recoPos2D - localOrigin2D;
185 const CDCWire& wire = recoHit3D.getWire();
192 using namespace NHelixParameterIndices;
193 result(c_Curv, c_Curv) = 1.0;
194 result(c_Phi0, c_Phi0) = 1.0;
195 result(c_I, c_I) = 1.0;
197 result(c_Phi0, c_TanL) = zeta;
198 result(c_I, c_Z0) = - zeta;
static UncertainHelix average(const UncertainHelix &fromHelix, const UncertainHelix &toHelix)
Construct the averages of the two given helices by properly considering their covariance matrix.
double getTanLambda() const
Getter for the slope of z over the transverse travel distance s.
Class representing a three dimensional reconstructed hit.
Class implementing the Riemann fit for two dimensional trajectory circle.
Class representing a pair of one reconstructed axial segement and one stereo segment in adjacent supe...
A two dimensional vector which is equipped with functions for correct handeling of orientation relat...
static const CDCSZFitter & getFitter()
Getter for a standard sz line fitter instance.
Vector2D sagMovePerZ(const double z) const
Gives the two dimensional position with wire sag effect of the line at the given z value.
bool isFitted() const
Indicates if the line has been fitted.
const UncertainPerigeeCircle & getLocalCircle() const
Getter for the cirlce in local coordinates.
void useOnlyPosition()
Setup the fitter to use only the reconstructed positions of the hits.
UncertainSZLine getLocalSZLine() const
Getter for the sz line starting from the local origin.
void reconstructFuseTrajectories(const CDCSegmentPair &segmentPair)
Combine the two trajectories of the segments in the pair and assign the resulting three dimensional t...
double setLocalOrigin(const Vector3D &localOrigin)
Setter for the origin of the local coordinate system.
static CDCSegment3D reconstruct(const CDCSegment2D &segment2D, const CDCTrajectory2D &trajectory2D)
Reconstructs a two dimensional stereo segment by shifting each hit onto the given two dimensional tra...
double setLocalOrigin(const Vector2D &localOrigin)
Setter for the origin of the local coordinate system.
Linear trajectory in sz space.
A segment consisting of three dimensional reconstructed hits.
double dot(const Vector2D &rhs) const
Calculates the two dimensional dot product.
Particle trajectory as it is seen in xy projection represented as a circle.
double updateDriftLength(CDCRecoHit2D &recoHit2D)
Update the drift length of the reconstructed hit in place.
const CDCSegment2D * getToSegment() const
Getter for the to segment.
bool m_reestimateDriftLength
Swtich to reestimate the drift length.
const Vector2D & getLocalOrigin() const
Getter for the origin of the local coordinate system.
bool isAxial() const
Indicator if the underlying wires are axial.
Adds an uncertainty matrix to the circle in perigee parameterisation.
CDCTrajectory2D & getTrajectory2D() const
Getter for the two dimensional trajectory fitted to the segment.
Abstract base class for different kinds of events.
A three dimensional vector.
Class implementing the z coordinate over travel distance line fit.
CDCTrajectory2D fit(const CDCObservations2D &observations2D) const
Fits a collection of observation drift circles.
PerigeeHelixAmbiguity calcAmbiguity(const CDCSegment3D &segment3D, const CDCTrajectory2D &trajectory2D)
Calculate the ambiguity of the helix parameters relative to the three circle parameters given the hit...
const Vector3D & getLocalOrigin() const
Getter for the origin of the local coordinate system.
const WireLine & getWireLine() const
Getter for the wire line represenation of the wire.
const Vector2D & xy() const
Getter for the xy projected vector ( reference ! )
SZParameters szParameters() const
Getter for the sz parameters in the order defined by ESZParameter.h.
Class representing a sense wire in the central drift chamber.
A reconstructed sequence of two dimensional hits in one super layer.
void fusePreliminary(const CDCSegmentPair &segmentPair)
Fit the given segment pair using the preliminary helix fit without proper covariance matrix.
A matrix implementation to be used as an interface typ through out the track finder.
static CDCRecoHit3D reconstruct(const CDCRecoHit2D &recoHit2D, const CDCTrajectory2D &trajectory2D)
Reconstructs the three dimensional hit from the two dimensional and the two dimensional trajectory.
A general helix class including a covariance matrix.
const CDCSegment2D * getFromSegment() const
Getter for the from segment.
Vector2D normal(const Vector2D &point) const
Unit normal vector from the circle to the given point.
static PerigeeAmbiguity defaultPerigeeAmbiguity()
Initialse a default covariance matrix to zero.
void setTrajectory3D(const CDCTrajectory3D &trajectory3D) const
Setter for the three dimensional trajectory.
Particle full three dimensional trajectory.
CDCTrajectorySZ fit(const CDCSegment2D &stereoSegment, const CDCTrajectory2D &axialTrajectory2D) const
Returns a fitted trajectory.
DriftLengthEstimator m_driftLengthEstimator
Helper object to carry out the drift length estimation.