 |
Belle II Software
release-05-02-19
|
10 #include <tracking/trackFindingCDC/eventdata/hits/CDCRecoHit3D.h>
12 #include <tracking/trackFindingCDC/eventdata/hits/CDCRecoHit2D.h>
13 #include <tracking/trackFindingCDC/eventdata/hits/CDCRLWireHit.h>
14 #include <tracking/trackFindingCDC/eventdata/hits/CDCWireHit.h>
16 #include <tracking/trackFindingCDC/eventdata/trajectories/CDCTrajectory3D.h>
17 #include <tracking/trackFindingCDC/eventdata/trajectories/CDCTrajectory2D.h>
18 #include <tracking/trackFindingCDC/eventdata/trajectories/CDCTrajectorySZ.h>
20 #include <tracking/trackFindingCDC/topology/CDCWire.h>
21 #include <tracking/trackFindingCDC/topology/EStereoKind.h>
23 #include <tracking/trackFindingCDC/geometry/Vector3D.h>
24 #include <tracking/trackFindingCDC/geometry/Vector2D.h>
26 #include <tracking/trackFindingCDC/numerics/ERightLeft.h>
28 #include <tracking/trackFindingCDC/numerics/ESign.h>
30 #include <cdc/dataobjects/CDCSimHit.h>
32 #include <framework/logging/Logger.h>
37 using namespace TrackFindingCDC;
42 : m_rlWireHit(rlWireHit)
43 , m_recoPos3D(recoPos3D)
44 , m_arcLength2D(arcLength2D)
51 double arcLength2D = std::numeric_limits<double>::quiet_NaN();
70 Vector3D recoPos3D = wireHit->reconstruct3D(trajectory2D, rlInfo);
91 return reconstruct(recoHit, trajectory2D, trajectorySZ);
100 double arcLength2D = 0;
101 if (stereoKind == EStereoKind::c_StereoU or stereoKind == EStereoKind::c_StereoV) {
117 const double z = trajectorySZ.
mapSToZ(arcLength2D);
123 const double correctedPerpS = trajectory2D.
calcArcLength2D(correctedRecoPos2D);
124 const double correctedZ = trajectorySZ.
mapSToZ(correctedPerpS);
125 const Vector3D correctedRecoPos3D(correctedRecoPos2D, correctedZ);
128 result.snapToDriftCircle();
135 B2ASSERT(
"This function can only be used with axial hits.", axialWireHit->isAxial());
143 if (first.getRLWireHit() == second.getRLWireHit()) {
146 (first.getArcLength2D() + second.getArcLength2D()) / 2);
148 B2ERROR(
"Averaging three dimensional hits which are on different oriented wire hits. Return "
149 "first one unchanged");
194 bool switchSide = sign(oldDriftLength) != sign(driftLength);
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.
HepGeom::Vector3D< double > Vector3D
3D Vector
Class representing a three dimensional reconstructed hit.
Vector3D m_recoPos3D
Memory for the reconstructed hit position.
double normalizeTo(const double toLength)
Normalizes the vector to the given length.
CDCRecoHit3D()=default
Default constructor for ROOT.
Vector2D getRecoWirePos2D() const
Returns the position of the wire in the xy plain the reconstructed position is located in.
TVector3 getPosTrack() const
The method to get position on the track.
A two dimensional vector which is equipped with functions for correct handeling of orientation relat...
CDCRecoHit3D reversed() const
Returns the recohit with the opposite right left information.
Vector2D getRecoPos2D() const
Getter for the position in the reference plane.
const CDCRLWireHit & getRLWireHit() const
Getter for the oriented wire hit assoziated with the reconstructed hit.
double getRefDriftLength() const
Getter for the drift length at the reference position of the wire.
static CDCRecoHit3D fromSimHit(const CDCWireHit *wireHit, const CDCSimHit &simHit)
Constructs a three dimensional reconstructed hit from a sim hit and the assoziated wirehit.
double getRecoZ() const
Getter for the z coordinate of the reconstructed position.
void snapToDriftCircle(bool switchSide=false)
Scales the displacement vector in place to lie on the dirft circle.
void reverse()
Turns the orientation in place.
bool isInCellZBounds(const Vector3D &pos3D, const double factor=1) const
Checks whether the position is in the z bounds of the drift cell (scaled by the factor) surrounding t...
Linear trajectory in sz space.
double getArcLength2D() const
Getter for the travel distance in the xy projection.
Vector2D getClosest(const Vector2D &point) const
Calculates the closest approach on the trajectory to the given point.
Particle trajectory as it is seen in xy projection represented as a circle.
Vector2D getWirePos2DAtZ(const double z) const
Gives the xy projected position of the wire at the given z coordinate.
static CDCRecoHit3D reconstructNearest(const CDCWireHit *axialWireHit, const CDCTrajectory2D &trajectory2D)
Reconstruct a three dimensional hit from a wire hit (as in reconstruct(rlWireHit, trajectory2D)),...
double mapSToZ(const double s=0) const
Translates the travel distance to the z coordinate.
static CDCRecoHit3D average(const CDCRecoHit3D &first, const CDCRecoHit3D &second)
Constructs the average of two reconstructed hit positions.
const CDCWire & getWire() const
Getter for the wire the reconstructed hit assoziated to.
static Vector3D average(const Vector3D &one, const Vector3D &two)
Constructs the average of two vectors.
CDCTrajectory2D getTrajectory2D() const
Getter for the two dimensional trajectory.
ERightLeft isRightOrLeft(const Vector2D &point) const
Checks if the given point is to the right or to the left of the trajectory.
CDCTrajectorySZ getTrajectorySZ() const
Getter for the sz trajectory.
Class representing a two dimensional reconstructed hit in the central drift chamber.
Abstract base class for different kinds of events.
Class representing an oriented hit wire including a hypotheses whether the causing track passes left ...
const CDCRLWireHit & getRLWireHit() const
Getter for the oriented wire hit.
A three dimensional vector.
void reverse()
Swiches the right left passage to its opposite inplace.
ERightLeft
Enumeration to represent the distinct possibilities of the right left passage.
CDCRecoHit2D stereoProjectToRef() const
Constructs a two dimensional reconstructed hit by carrying out the stereo ! projection to the wire re...
void setRefDriftLength(double driftLength)
Setter for the drift length at the reference position of the wire.
bool isInCellZBounds(const double factor=1) const
Indicator if the hit is in the cdc (scaled by the factor) or already outside its boundaries.
const Vector2D & xy() const
Getter for the xy projected vector ( reference ! )
Class representing a sense wire in the central drift chamber.
EStereoKind getStereoKind() const
Getter for the stereo type of the underlying wire.
double getSignedRecoDriftLength() const
Returns the drift length next to the reconstructed position.
void setRecoDriftLength(double driftLength, bool snapRecoPos)
Setter to update the drift length of the hit.
double z() const
Getter for the z coordinate.
Class representing a hit wire in the central drift chamber.
static CDCRecoHit3D reconstruct(const CDCRecoHit2D &recoHit2D, const CDCTrajectory2D &trajectory2D)
Reconstructs the three dimensional hit from the two dimensional and the two dimensional trajectory.
const Vector3D & getRecoPos3D() const
Getter for the 3d position of the hit.
Vector3D reconstruct3D(const CDCTrajectory2D &trajectory2D, double z=0) const
Attempts to reconstruct a three dimensional position (especially of stereo hits).
double calcArcLength2D(const Vector2D &point) const
Calculate the travel distance from the start position of the trajectory.
Vector3D reconstruct3D(const CDCTrajectory2D &trajectory2D, const double z=0) const
Reconstruct the three dimensional position (especially of stereo hits) by determinating the z coordin...
Particle full three dimensional trajectory.
CDCRLWireHit m_rlWireHit
Memory for the oriented wire hit reference.
CDCRecoHit2D getRecoHit2D() const
Constructs a two dimensional reconstructed hit by carrying out the stereo ! projection to the wire re...
static CDCRLWireHit fromSimHit(const CDCWireHit *wirehit, const CDCSimHit &simhit)
Constructs an oriented wire hit from a CDCSimHit and the associated wirehit.