9#include <cdc/translators/RealisticTDCCountTranslator.h>
10#include <framework/core/Environment.h>
11#include <framework/geometry/B2Vector3.h>
32 cout <<
"RealisticTDCCountTranslator constructor" << endl;
33 cout <<
"m_cdcp=" << &
m_cdcp << endl;
41 double timeOfFlightEstimator,
43 unsigned short adcCount)
55 const B2Vector3D& backWirePos =
m_cdcp.wireBackwardPosition(wireID, CDCGeometryPar::c_Aligned);
56 const B2Vector3D& diffWirePos =
m_cdcp.wireForwardPosition(wireID, CDCGeometryPar::c_Aligned) - backWirePos;
59 double propLength = z - backWirePos.
Z();
60 double dZ = diffWirePos.
Z();
62 propLength *= diffWirePos.
Mag() / dZ;
64 if (
m_gcp.getSenseWireZposMode() == 1) {
66 propLength +=
m_cdcp.getBwdDeltaZ(layer);
68 driftTime -= propLength *
m_cdcp.getPropSpeedInv(layer);
77 driftTime -= timeOfFlightEstimator;
81 driftTime -=
m_cdcp.getTimeWalk(wireID, adcCount);
83 }
else if (
m_scp.getTimeWalk()) {
84 driftTime -=
m_cdcp.getTimeWalk(wireID, adcCount);
94 double timeOfFlightEstimator,
99 unsigned short adcCount)
101 const double driftTime =
getDriftTime(tdcCount, wireID, timeOfFlightEstimator, z, adcCount);
109 double driftL =
m_cdcp.getDriftLength(driftTime, layer, leftRight, alpha, theta);
111#if defined(CDC_DEBUG)
113 cout <<
"RealisticTDCCountTranslator::getDriftLength" << endl;
114 cout <<
"driftTime=" << driftTime << endl;
115 cout <<
"layer=" << layer << endl;
116 cout <<
"leftright=" << leftRight << endl;
117 cout <<
"driftL= " << driftL << endl;
127 double alpha,
double theta)
129 static_cast<void>(z);
133#if defined(CDC_DEBUG)
135 cout <<
"RealisticTDCCountTranslator::getDriftLengthResolution" << endl;
136 cout <<
"spaceResol= " << resol << endl;
139 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.
RealisticTDCCountTranslator(bool useInWirePropagationDelay=false)
Constructor, with the additional information, if propagation in the wire shall be considered.
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.
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.