8#include <tracking/trackingUtilities/eventdata/hits/CDCRecoHit2D.h>
10#include <tracking/trackingUtilities/eventdata/hits/CDCRLWireHit.h>
12#include <tracking/trackingUtilities/geometry/VectorUtil.h>
14#include <tracking/trackingUtilities/numerics/ESign.h>
16#include <cdc/dataobjects/CDCSimHit.h>
21using namespace TrackingUtilities;
29 const ROOT::Math::XYVector& recoDisp2D) :
40 ROOT::Math::XYVector(-trackPosToWire.x(), -trackPosToWire.y()));
53 ROOT::Math::XYVector displacement =
58 result.snapToDriftCircle();
72 ROOT::Math::XYVector displacement =
78 result.snapToDriftCircle();
84 const ROOT::Math::XYVector& recoPos2D,
88 if (snap) result.snapToDriftCircle();
101 return reversedRecoHit;
112 double oldDriftLength =
m_rlWireHit.getRefDriftLength();
115 bool switchSide = sign(oldDriftLength) != sign(driftLength);
135std::ostream& TrackingUtilities::operator<<(std::ostream& output,
const CDCRecoHit2D& recohit)
137 output <<
"CDCRecoHit2D(" << recohit.
getRLWireHit() <<
","
B2Vector3D getPosWire() const
The method to get position on wire.
B2Vector3D getPosTrack() const
The method to get position on the track.
Class representing an oriented hit wire including a hypotheses whether the causing track passes left ...
double getRefDriftLength() const
Getter for the drift length at the reference position of the wire.
const ROOT::Math::XYVector & getRefPos2D() const
The two dimensional reference position of the underlying wire.
static CDCRLWireHit fromSimHit(const CDCWireHit *wirehit, const CDCSimHit &simhit)
Constructs an oriented wire hit from a CDCSimHit and the associated wirehit.
static CDCRLWireHit average(const CDCRLWireHit &rlWireHit1, const CDCRLWireHit &rlWireHit2)
Constructs the average of two wire hits with right left passage information.
ROOT::Math::XYZVector reconstruct3D(const CDCTrajectory2D &trajectory2D, double z=0) const
Attempts to reconstruct a three dimensional position (especially of stereo hits).
Class representing a two dimensional reconstructed hit in the central drift chamber.
void setRefDriftLength(double driftLength, bool snapRecoPos)
Setter for the drift length at the wire reference position.
const ROOT::Math::XYVector & getRecoDisp2D() const
Getter for the displacement from the wire reference position.
const CDCRLWireHit & getRLWireHit() const
Getter for the oriented wire hit associated with the reconstructed hit.
void reverse()
Turns the orientation in place.
CDCRecoHit2D()=default
Default constructor for ROOT.
CDCRecoHit2D getAlias() const
Getter for the alias version of the reco hit.
CDCRecoHit2D reversed() const
Returns the recohit with the opposite right left information.
static CDCRecoHit2D average(const CDCRecoHit2D &recoHit1, const CDCRecoHit2D &recoHit2)
Constructs the average of two reconstructed hit positions and snaps it to the drift circle.
void snapToDriftCircle(bool switchSide=false)
Scales the displacement vector in place to lie on the drift circle.
ROOT::Math::XYVector m_recoDisp2D
Memory for the displacement of the associated wire reference position.
static CDCRecoHit2D fromSimHit(const CDCWireHit *wireHit, const CDCSimHit &simHit)
Constructs a two dimensional reconstructed hit from a sim hit and the associated wirehit.
ROOT::Math::XYZVector reconstruct3D(const CDCTrajectory2D &trajectory2D, const double z=0) const
Reconstruct the three dimensional position (especially of stereo hits) by determining the z coordinat...
CDCRLWireHit m_rlWireHit
Memory for the reference to the associated wire hit.
static CDCRecoHit2D fromRecoPos2D(const CDCRLWireHit &rlWireHit, const ROOT::Math::XYVector &recoPos2D, bool snap=true)
Constructs a two dimensional reconstructed hit from an absolute position.
Particle trajectory as it is seen in xy projection represented as a circle.
Class representing a hit wire in the central drift chamber.
Abstract base class for different kinds of events.