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/geometry/Vector3D.h>
19#include <tracking/trackingUtilities/geometry/Vector2D.h>
21#include <tracking/trackingUtilities/numerics/ERightLeft.h>
23#include <cdc/dataobjects/CDCSimHit.h>
25#include <framework/logging/Logger.h>
32using namespace TrackingUtilities;
52 double driftLengthVariance)
63 B2ASSERT(
"Average of two CDCRLWireHits with different wire hits requested.",
66 B2ASSERT(
"Average of two CDCRLWireHits with different right left passage information requested.",
69 ERightLeft rlInfo = rlWireHit1.
getRLInfo();
78 CDCRLWireHit result(&wireHit, rlInfo, driftLength, driftLengthVariance);
86 B2ASSERT(
"Average of three CDCRLWireHits with different wire hits requested.",
90 B2ASSERT(
"Average of three CDCRLWireHits with different right left passage information requested.",
95 ERightLeft rlInfo = rlWireHit1.
getRLInfo();
106 CDCRLWireHit result(&wireHit, rlInfo, driftLength, driftLengthVariance);
173 Vector2D disp2D = recoPos2D - wirePos2D;
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);
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.
Vector2D reconstruct2D(const CDCTrajectory2D &trajectory2D) const
Reconstructs a position of primary ionisation on the drift circle.
double m_refDriftLength
Memory for the reestimated drift length.
double m_refDriftLengthVariance
Memory for the reestimated drift length variance.
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.
Vector3D reconstruct3D(const CDCTrajectory2D &trajectory2D, double z=0) const
Attempts to reconstruct a three dimensional position (especially of stereo hits).
Particle trajectory as it is seen in xy projection represented as a circle.
Vector2D getClosest(const Vector2D &point) const
Calculates the closest approach on the trajectory to the given point.
Vector3D 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...
A two dimensional vector which is equipped with functions for correct handling of orientation relate...
double normalizeTo(const double toLength)
Normalizes the vector to the given length.
ERightLeft isRightOrLeftOf(const Vector2D &rhs) const
Indicates if the given vector is more left or more right if you looked in the direction of this vecto...
A three dimensional vector.
const Vector2D & xy() const
Getter for the xy projected vector ( reference ! )
Class to identify a wire inside the CDC.
HepGeom::Vector3D< double > Vector3D
3D Vector
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.