9#include <cdc/translators/RealisticTDCCountTranslator.h>
10#include <framework/core/Environment.h>
11#include <framework/geometry/B2Vector3.h>
34 double timeOfFlightEstimator,
36 unsigned short adcCount)
47 const B2Vector3D& backWirePos =
m_cdcp.wireBackwardPosition(wireID, CDCGeometryPar::c_Aligned);
48 const B2Vector3D& diffWirePos =
m_cdcp.wireForwardPosition(wireID, CDCGeometryPar::c_Aligned) - backWirePos;
50 double propLength = z - backWirePos.
Z();
51 double dZ = diffWirePos.
Z();
53 propLength *= diffWirePos.
Mag() / dZ;
55 if (
m_gcp.getSenseWireZposMode() == 1) {
56 propLength +=
m_cdcp.getBwdDeltaZ(layer);
58 driftTime -= propLength *
m_cdcp.getPropSpeedInv(layer);
71 driftTime -= timeOfFlightEstimator;
75 driftTime -=
m_cdcp.getTimeWalk(wireID, adcCount);
76 }
else if (
m_scp.getTimeWalk()) {
77 driftTime -=
m_cdcp.getTimeWalk(wireID, adcCount);
85 double timeOfFlightEstimator,
90 unsigned short adcCount)
92 const double driftTime =
getDriftTime(tdcCount, wireID, timeOfFlightEstimator, z, adcCount);
98 double driftL =
m_cdcp.getDriftLength(driftTime, layer, leftRight, alpha, theta);
106 double alpha,
double theta)
108 static_cast<void>(z);
111 return resol * resol;;
DataType Z() const
access variable Z (= .at(2) without boundary check)
DataType Mag() const
The magnitude (rho in spherical coordinate system).
The Class for CDC Geometry Control Parameters.
The Class for CDC Geometry Parameters.
The Class for CDC Simulation Control Parameters.
StoreObjPtr< EventT0 > m_eventTimeStoreObject
Event timing.
double getDriftLength(unsigned short tdcCount, const WireID &wireID=WireID(), double timeOfFlightEstimator=0, bool leftRight=false, double z=0, double alpha=0, double theta=static_cast< double >(TMath::Pi()/2.), unsigned short adcCount=0) override
Get Drift length.
const double m_tdcBinWidth
Hit timing offset value.
double m_fudgeFactor
Cached fudge factor for space resol.
const CDCSimControlPar & m_scp
Cached reference to CDC SimControlPar object.
const CDCGeometryPar & m_cdcp
Cached reference to CDC GeometryPar object.
bool m_fromTrackCreator
Flag to use EventT0 from SVD and CDC with higher priority.
RealisticTDCCountTranslator(bool useInWirePropagationDelay=false, bool fromTrackCreator=false)
Constructor, with the additional information, if propagation in the wire shall be considered.
double getDriftLengthResolution(double driftLength, const WireID &wireID=WireID(), bool leftRight=false, double z=0, double alpha=0, double=static_cast< double >(TMath::Pi()/2.)) override
Get position resolution^2 corresponding to the drift length from getDriftLength of this class.
bool m_realData
Flag to distinguish betw.
bool m_useInWirePropagationDelay
Flag to activate the propagation delay of the sense wire.
const CDCGeoControlPar & m_gcp
Cached reference to CDC GeoControlPar object.
double getDriftTime(unsigned short tdcCount, const WireID &wireID, double timeOfFlightEstimator, double z, unsigned short adcCount) override
Get Drift time.
bool isMC() const
Do we have generated, not real data?
static Environment & Instance()
Static method to get a reference to the Environment instance.
Class to identify a wire inside the CDC.
unsigned short getICLayer() const
Getter for continuous layer numbering.
B2Vector3< double > B2Vector3D
typedef for common usage with double
Abstract base class for different kinds of events.