Belle II Software development
DriftTimeUtil Struct Reference

Structure to expose some drift time and length functions from the CDCGeometryPar to Python. More...

#include <DriftTimeUtil.h>

Static Public Member Functions

static double getDriftV (double driftTime, unsigned short iCLayer, unsigned short lr, double alpha=0., double theta=0.5 *M_PI)
 Get the realistic drift velocity.
 
static double getDriftLength (double driftTime, unsigned short iCLayer, unsigned short lr, double alpha=0., double theta=0.5 *M_PI)
 Return the drift length to the sense wire.
 
static double getDriftTime (double dist, unsigned short iCLayer, unsigned short lr, double alpha, double theta)
 Return the drift time to the sense wire.
 
static double getPropTime (const WireID &wireID, double z)
 Getter for the in wire propagation time.
 
static double getTimeWalk (const WireID &wireID, unsigned short adcCount)
 Returns time-walk.
 
static double getMeasuredTime (const WireID &wireID, unsigned short tdcCount, bool smear)
 Returns the time measured at the readout board.
 

Detailed Description

Structure to expose some drift time and length functions from the CDCGeometryPar to Python.

Definition at line 22 of file DriftTimeUtil.h.

Member Function Documentation

◆ getDriftLength()

static double getDriftLength ( double driftTime,
unsigned short iCLayer,
unsigned short lr,
double alpha = 0.,
double theta = 0.5 * M_PI )
inlinestatic

Return the drift length to the sense wire.

Parameters
driftTimeDrift time (ns).
iCLayerContinuous layer id.
lrLeft/Right boolean.
alphaIncident angle (in rphi plane) w.r.t. the cell (rad).
thetaIncident angle (polar angle) (rad).

Definition at line 49 of file DriftTimeUtil.h.

54 {
55 return CDC::CDCGeometryPar::Instance().getDriftLength(driftTime, iCLayer, lr, alpha, theta);
56 }

◆ getDriftTime()

static double getDriftTime ( double dist,
unsigned short iCLayer,
unsigned short lr,
double alpha,
double theta )
inlinestatic

Return the drift time to the sense wire.

Parameters
distDrift length (cm).
iCLayerContinuous layer id
lrLeft/Right boolean
alphaIncident angle (in rphi plane) w.r.t. the cell (rad).
thetaIncident angle (polar angle) (rad).

Definition at line 66 of file DriftTimeUtil.h.

71 {
72 return CDC::CDCGeometryPar::Instance().getDriftTime(dist, iCLayer, lr, alpha, theta);
73 }

◆ getDriftV()

static double getDriftV ( double driftTime,
unsigned short iCLayer,
unsigned short lr,
double alpha = 0.,
double theta = 0.5 * M_PI )
inlinestatic

Get the realistic drift velocity.

Parameters
driftTimeDrift time (ns).
iCLayerContinuous layer id
lrLeft/Right
alphaIncident angle (in rphi plane) w.r.t. the cell (rad).
thetaIncident angle (polar angle) (rad).

Definition at line 32 of file DriftTimeUtil.h.

37 {
38 return CDC::CDCGeometryPar::Instance().getDriftV(driftTime, iCLayer, lr, alpha, theta);
39 }

◆ getMeasuredTime()

static double getMeasuredTime ( const WireID & wireID,
unsigned short tdcCount,
bool smear )
inlinestatic

Returns the time measured at the readout board.

Parameters
wireIDwire id
tdcCountTDC count
smearif true result will be varied randomly
Returns
measured time (in ns)

Definition at line 118 of file DriftTimeUtil.h.

119 {
120 double smearing = 0;
121 if (smear) {
122 smearing = gRandom->Rndm() - 0.5;
123 }
124 double channelT0 = static_cast<double>(CDC::CDCGeometryPar::Instance().getT0(wireID));
125 double measuredTime =
126 channelT0 - (tdcCount + smearing) * CDC::CDCGeometryPar::Instance().getTdcBinWidth();
127 if (measuredTime > 2000) {
128 B2INFO("channelT0 " << channelT0);
129 B2INFO("measuredTime " << measuredTime);
130 }
131 return measuredTime;
132 }

◆ getPropTime()

static double getPropTime ( const WireID & wireID,
double z )
inlinestatic

Getter for the in wire propagation time.

Parameters
wireIDwire id
zstart location of the signal propagation on the wire

Definition at line 80 of file DriftTimeUtil.h.

81 {
82 unsigned short iCLayer = wireID.getICLayer();
83 const CDC::CDCGeometryPar& geometryPar = CDC::CDCGeometryPar::Instance();
84 const CDC::CDCGeoControlPar& controlPar = CDC::CDCGeoControlPar::getInstance();
85 const ROOT::Math::XYZVector& backwardWirePos = geometryPar.wireBackwardPosition(wireID, CDC::CDCGeometryPar::c_Aligned);
86 const ROOT::Math::XYZVector& forwardWirePos = geometryPar.wireForwardPosition(wireID, CDC::CDCGeometryPar::c_Aligned);
87 double zDistance = z - backwardWirePos.Z();
88
89 // Actually are very small correction
90 double stereoFactor =
91 (forwardWirePos - backwardWirePos).R() / (forwardWirePos.Z() - backwardWirePos.Z());
92
93 double distance = zDistance * stereoFactor;
94 if (controlPar.getSenseWireZposMode() == 1) {
95 distance += geometryPar.getBwdDeltaZ(iCLayer);
96 }
97 return distance * geometryPar.getPropSpeedInv(iCLayer);
98 }
double R
typedef autogenerated by FFTW

◆ getTimeWalk()

static double getTimeWalk ( const WireID & wireID,
unsigned short adcCount )
inlinestatic

Returns time-walk.

Parameters
wireIDwire id
adcCountADC count
Returns
time-walk (in ns)

Definition at line 106 of file DriftTimeUtil.h.

107 {
108 return CDC::CDCGeometryPar::Instance().getTimeWalk(wireID, adcCount);
109 }

The documentation for this struct was generated from the following file: