9#include <cdc/translators/RealisticTDCCountTranslator.h>
10#include <framework/core/Environment.h>
11#include <framework/geometry/B2Vector3.h>
33 cout <<
"RealisticTDCCountTranslator constructor" << endl;
34 cout <<
"m_cdcp=" << &
m_cdcp << endl;
42 double timeOfFlightEstimator,
44 unsigned short adcCount)
56 const B2Vector3D& backWirePos =
m_cdcp.wireBackwardPosition(wireID, CDCGeometryPar::c_Aligned);
57 const B2Vector3D& diffWirePos =
m_cdcp.wireForwardPosition(wireID, CDCGeometryPar::c_Aligned) - backWirePos;
60 double propLength = z - backWirePos.
Z();
61 double dZ = diffWirePos.
Z();
63 propLength *= diffWirePos.
Mag() / dZ;
65 if (
m_gcp.getSenseWireZposMode() == 1) {
67 propLength +=
m_cdcp.getBwdDeltaZ(layer);
69 driftTime -= propLength *
m_cdcp.getPropSpeedInv(layer);
82 driftTime -= timeOfFlightEstimator;
86 driftTime -=
m_cdcp.getTimeWalk(wireID, adcCount);
88 }
else if (
m_scp.getTimeWalk()) {
89 driftTime -=
m_cdcp.getTimeWalk(wireID, adcCount);
99 double timeOfFlightEstimator,
104 unsigned short adcCount)
106 const double driftTime =
getDriftTime(tdcCount, wireID, timeOfFlightEstimator, z, adcCount);
114 double driftL =
m_cdcp.getDriftLength(driftTime, layer, leftRight, alpha, theta);
116#if defined(CDC_DEBUG)
118 cout <<
"RealisticTDCCountTranslator::getDriftLength" << endl;
119 cout <<
"driftTime=" << driftTime << endl;
120 cout <<
"layer=" << layer << endl;
121 cout <<
"leftright=" << leftRight << endl;
122 cout <<
"driftL= " << driftL << endl;
132 double alpha,
double theta)
134 static_cast<void>(z);
138#if defined(CDC_DEBUG)
140 cout <<
"RealisticTDCCountTranslator::getDriftLengthResolution" << endl;
141 cout <<
"spaceResol= " << resol << endl;
144 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.