8#include <tracking/trackFindingCDC/eventdata/hits/CDCWireHit.h>
10#include <tracking/trackFindingCDC/eventdata/trajectories/CDCTrajectory2D.h>
12#include <tracking/trackFindingCDC/topology/CDCWireSuperLayer.h>
13#include <tracking/trackFindingCDC/topology/CDCWire.h>
14#include <tracking/trackFindingCDC/topology/EStereoKind.h>
16#include <tracking/trackFindingCDC/geometry/Circle2D.h>
17#include <tracking/trackFindingCDC/geometry/Vector3D.h>
18#include <tracking/trackFindingCDC/geometry/Vector2D.h>
20#include <tracking/trackFindingCDC/numerics/ERightLeft.h>
21#include <tracking/trackFindingCDC/numerics/Index.h>
23#include <cdc/translators/RealisticTDCCountTranslator.h>
24#include <cdc/translators/LinearGlobalADCCountTranslator.h>
26#include <cdc/translators/TDCCountTranslatorBase.h>
27#include <cdc/translators/ADCCountTranslatorBase.h>
29#include <cdc/dataobjects/CDCHit.h>
30#include <cdc/dataobjects/WireID.h>
31#include <framework/logging/Logger.h>
37using namespace TrackFindingCDC;
42 return s_tdcCountTranslator;
48 return s_adcCountTranslator;
52 const double driftLength,
53 const double driftLengthVariance,
54 const double chargeDeposit,
55 const double driftTime)
56 : m_wireID(ptrHit->
getID())
57 , m_wire(
CDCWire::getInstance(*ptrHit))
59 , m_refDriftLength(driftLength)
60 , m_refDriftLengthVariance(driftLengthVariance)
61 , m_refChargeDeposit(chargeDeposit)
62 , m_refDriftTime(driftTime)
70 : m_wireID(ptrHit->
getID())
71 , m_wire(ptrHit ?
CDCWire::getInstance(*ptrHit) : nullptr)
76 B2ERROR(
"CDCWireHit constructor invoked with nullptr CDCHit");
79 const CDCHit& hit = *ptrHit;
86 float initialTOFEstimate = 0;
88 float refDriftLengthRight = tdcCountTranslator.
getDriftLength(hit.getTDCCount(),
94 float refDriftLengthLeft = tdcCountTranslator.
getDriftLength(hit.getTDCCount(),
121 const double driftLength,
122 const double driftLengthVariance,
123 const double chargeDeposit)
125 , m_wire(
CDCWire::getInstance(wireID))
127 , m_refDriftLength(driftLength)
128 , m_refDriftLengthVariance(driftLengthVariance)
129 , m_refChargeDeposit(chargeDeposit)
149bool TrackFindingCDC::operator<(
const CDCWireHit& wireHit,
const CDCHit& hit)
154bool TrackFindingCDC::operator<(
const CDCHit& hit,
const CDCWireHit& wireHit)
174 Vector2D disp2D = recoPos2D - wirePos2D;
178 return wirePos2D + disp2D;
183 const double z)
const
187 if (stereoType == EStereoKind::c_StereoV or stereoType == EStereoKind::c_StereoU) {
189 const double signedDriftLength = isValid(rlInfo) ?
static_cast<double>(rlInfo) *
getRefDriftLength() : 0.0;
190 return trajectory2D.
reconstruct3D(wireLine, signedDriftLength, z);
227std::ostream& TrackFindingCDC::operator<<(std::ostream& output,
const CDCWireHit& wirehit)
229 return output <<
"CDCWireHit(" << wirehit.
getWireID()
Class containing the result of the unpacker in raw data and the result of the digitizer in simulation...
unsigned short getID() const
Getter for encoded wire number.
Abstract Base class for the ADC count translator.
virtual float getCharge(unsigned short adcCount=0, const WireID &wireID=WireID(), bool ambiguityDiscriminator=false, float z=0, float theta=static_cast< float >(TMath::Pi()/2.))=0
Function, for which this actually was meant.
This class simply assumes a linear translation through (0,0)
Translator mirroring the realistic Digitization.
Base class for translation of Drift Time into Drift Length.
virtual double getDriftLength(unsigned short tdcCount=0, const WireID &wireID=WireID(), double timeOfFlightEstimator=0., bool ambiguityDiscriminator=false, double z=0, double alpha=0, double theta=static_cast< double >(TMath::Pi()/2.), unsigned short adcCount=0)=0
Function for getting a drift length estimation.
virtual double getDriftLengthResolution(double driftLength=0., const WireID &wireID=WireID(), bool ambiguityDiscriminator=false, double z=0, double alpha=0, double theta=static_cast< double >(TMath::Pi()/2.))=0
Uncertainty corresponding to drift length from getDriftLength of this class.
virtual double getDriftTime(unsigned short tdcCount, const WireID &wireID, double timeOfFlightEstimator, double z, unsigned short adcCount)=0
Get Drift time.
int getArrayIndex() const
Returns this object's array index (in StoreArray), or -1 if not found.
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 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.
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.
static CDC::TDCCountTranslatorBase & getTDCCountTranslator()
Return an instance of the used TDC count translator.
ISuperLayer getISuperLayer() const
Getter for the super layer id.
double getRefDriftLength() const
Getter for the drift length at the reference position of the wire.
const WireID & getWireID() const
Getter for the WireID of the wire the hit is located on.
friend bool operator<(const CDCWireHit &wireHit, const CDCWire &wire)
Defines CDCWires and CDCWireHits to be coaligned on the wire on which they are based.
CDCWireHit()=default
Default constructor for ROOT compatibility.
const CDCWire & getWire() const
Getter for the CDCWire the hit is located on.
static CDC::ADCCountTranslatorBase & getADCCountTranslator()
Return an instance of the used ADC count translator.
const Vector3D & getRefPos3D() const
The three dimensional reference position of the underlying wire.
Vector2D reconstruct2D(const CDCTrajectory2D &trajectory2D) const
Reconstructs a position of primary ionisation on the drift circle.
const CDCWire & attachWire() const
Reestablishes the pointer of the hit to the wire and returns it Since the DataStore only transport th...
WireID m_wireID
Memory for the WireID.
double m_refDriftLength
Memory for the drift length at the wire reference point.
Index getStoreIHit() const
Getter for the index of the hit in the StoreArray holding this hit.
const Vector2D & getRefPos2D() const
The two dimensional reference position (z=0) of the underlying wire.
CDCWire const * m_wire
Memory for the CDCWire pointer - Trailing comment indicates to not stream this member.
Circle2D conformalTransformed(const Vector2D &relativeTo) const
Applies the conformal transformation to the drift circle this hit represents.
double m_refDriftLengthVariance
Memory for the variance of the drift length at the wire reference point.
Vector3D reconstruct3D(const CDCTrajectory2D &trajectory2D, ERightLeft rlInfo, double z=0) const
Attempts to reconstruct a three dimensional position (especially of stereo hits).
EStereoKind getStereoKind() const
Getter for the stereo type of the underlying wire.
double m_refChargeDeposit
Memory for the charge induced by the energy deposit in the drift cell.
double m_refDriftTime
Measured drift time of the CDC hit.
Class representing a sense wire superlayer in the central drift chamber.
ISuperLayer getISuperLayer() const
Getter for the super layer id.
Class representing a sense wire in the central drift chamber.
double getRefCylindricalR() const
Getter for the cylindrical radius at the wire reference position.
static const CDCWire * getInstance(const WireID &wireID)
Getter from the wireID convenience object. Does not construct a new object.
const Vector3D & getRefPos3D() const
Getter for the wire reference position.
const Vector2D & getRefPos2D() const
Getter for the wire reference position for 2D tracking Gives the wire's reference position projected ...
double getRefZ() const
Getter for the wire reference z coordinate Gives the wire's reference z coordinate.
const WireLine & getWireLine() const
Getter for the wire line representation of the wire.
A two dimensional circle in its natural representation using center and radius as parameters.
void conformalTransform()
Transforms the circle to conformal space inplace.
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.
A three dimensional vector.
A three dimensional limited line represented by its closest approach to the z-axes (reference positio...
Class to identify a wire inside the CDC.
unsigned short getEWire() const
Getter for encoded wire number.
int getID(const std::vector< double > &breaks, double t)
get id of the time point t
ERightLeft
Enumeration to represent the distinct possibilities of the right left passage.
Abstract base class for different kinds of events.