8#include <tracking/trackingUtilities/eventdata/hits/CDCRLWireHit.h>
10#include <tracking/trackingUtilities/eventdata/hits/CDCWireHit.h>
12#include <tracking/trackingUtilities/eventdata/trajectories/CDCTrajectory2D.h>
14#include <cdc/topology/CDCWire.h>
15#include <cdc/topology/EStereoKind.h>
16#include <cdc/topology/ISuperLayer.h>
18#include <tracking/trackingUtilities/numerics/ERightLeft.h>
20#include <cdc/dataobjects/CDCSimHit.h>
22#include <framework/logging/Logger.h>
29using namespace TrackingUtilities;
49 double driftLengthVariance)
60 B2ASSERT(
"Average of two CDCRLWireHits with different wire hits requested.",
63 B2ASSERT(
"Average of two CDCRLWireHits with different right left passage information requested.",
66 ERightLeft rlInfo = rlWireHit1.
getRLInfo();
75 CDCRLWireHit result(&wireHit, rlInfo, driftLength, driftLengthVariance);
83 B2ASSERT(
"Average of three CDCRLWireHits with different wire hits requested.",
87 B2ASSERT(
"Average of three CDCRLWireHits with different right left passage information requested.",
92 ERightLeft rlInfo = rlWireHit1.
getRLInfo();
103 CDCRLWireHit result(&wireHit, rlInfo, driftLength, driftLengthVariance);
113 ROOT::Math::XYZVector directionOfFlight{simhit.
getMomentum()};
115 ERightLeft rlInfo = VectorUtil::isRightOrLeftOf(VectorUtil::getXYVector(trackPosToWire),
116 VectorUtil::getXYVector(directionOfFlight));
165 const ROOT::Math::XYVector& refPos2D =
getRefPos2D();
166 ROOT::Math::XYVector recoPos2D = trajectory2D.
getClosest(refPos2D);
171 ROOT::Math::XYVector disp2D = recoPos2D - wirePos2D;
174 if (disp2D.R() != 0.0) {
175 disp2D *= (driftLength / disp2D.R());
177 return wirePos2D + disp2D;
185 if (stereoType == EStereoKind::c_StereoV or stereoType == EStereoKind::c_StereoU) {
187 const double signedDriftLength = isValid(rlInfo) ?
static_cast<double>(rlInfo) *
getRefDriftLength() : 0.0;
188 return trajectory2D.
reconstruct3D(wireLine, signedDriftLength, z);
191 const ROOT::Math::XYVector recoPos2D =
reconstruct2D(trajectory2D);
194 return ROOT::Math::XYZVector(recoPos2D.X(), recoPos2D.Y(), z);
198std::ostream& TrackingUtilities::operator<<(std::ostream& output,
const CDCRLWireHit& rlWireHit)
200 output <<
"CDCRLWireHit(" << rlWireHit.
getWireHit() <<
","
201 <<
static_cast<typename std::underlying_type<ERightLeft>::type
>(rlWireHit.
getRLInfo()) <<
")" ;
Class containing the result of the unpacker in raw data and the result of the digitizer in simulation...
B2Vector3D getPosWire() const
The method to get position on wire.
B2Vector3D getPosTrack() const
The method to get position on the track.
double getDriftLength() const
The method to get drift length.
B2Vector3D getMomentum() const
The method to get momentum.
Class representing a sense wire in the central drift chamber.
double getRefCylindricalR() const
Getter for the cylindrical radius at the wire reference position.
ISuperLayer getISuperLayer() const
Gives the superlayer id ranging from 0 - 8.
const ROOT::Math::XYVector & getRefPos2D() const
Getter for the wire reference position for 2D tracking Gives the wire's reference position projected ...
const WireID & getWireID() const
Getter for the wire id.
bool isAxial() const
Indicates if the wire is axial or stereo.
EStereoKind getStereoKind() const
Getter for the stereo type of the wire.
const WireLine & getWireLine() const
Getter for the wire line representation of the wire.
A three dimensional limited line represented by its closest approach to the z-axes (reference positio...
Class representing an oriented hit wire including a hypotheses whether the causing track passes left ...
double getRefCylindricalR() const
The distance from the beam line at reference position of the underlying wire.
const CDCHit * getHit() const
Getter for the CDCHit pointer into the StoreArray.
const CDCWireHit & getWireHit() const
Getter for the wire hit associated with the oriented hit.
CDC::ISuperLayer getISuperLayer() const
Getter for the superlayer id.
double getRefDriftLengthVariance() const
Getter for the variance of the drift length at the reference position of the wire.
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.
const WireID & getWireID() const
Getter for the WireID of the wire the hit is located on.
bool isAxial() const
Indicator if the underlying wire is axial.
CDCRLWireHit()=default
Default constructor for ROOT.
ERightLeft m_rlInfo
Memory for the right left passage information of the oriented wire hit.
const CDC::CDCWire & getWire() const
Getter for the wire the oriented hit associated to.
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.
double m_refDriftLength
Memory for the reestimated drift length.
ROOT::Math::XYZVector reconstruct3D(const CDCTrajectory2D &trajectory2D, double z=0) const
Attempts to reconstruct a three dimensional position (especially of stereo hits).
double m_refDriftLengthVariance
Memory for the reestimated drift length variance.
ROOT::Math::XYVector reconstruct2D(const CDCTrajectory2D &trajectory2D) const
Reconstructs a position of primary ionisation on the drift circle.
const CDCWireHit * m_wireHit
Memory for the reference to the assiziated wire hit.
CDC::EStereoKind getStereoKind() const
Getter for the stereo type of the underlying wire.
ERightLeft getRLInfo() const
Getter for the right left passage information.
Particle trajectory as it is seen in xy projection represented as a circle.
ROOT::Math::XYVector getClosest(const ROOT::Math::XYVector &point) const
Calculates the closest approach on the trajectory to the given point.
ROOT::Math::XYZVector reconstruct3D(const CDC::WireLine &wireLine, double distance=0.0, double z=0) const
Gives the one three dimensional positions within the CDC closest to the given z where the given drift...
Class representing a hit wire in the central drift chamber.
const CDCHit * getHit() const
Getter for the CDCHit pointer into the StoreArray.
const CDC::CDCWire & getWire() const
Getter for the CDCWire the hit is located on.
static constexpr const double c_simpleDriftLengthVariance
A default value for the drift length variance if no variance from the drift length translation is ava...
Class to identify a wire inside the CDC.
EStereoKind
Type for the stereo property of the wire.
signed short ISuperLayer
The type of the layer and superlayer ids.
Abstract base class for different kinds of events.