23#include "CLHEP/Alist/AIterator.h"
25#include "GaudiKernel/Bootstrap.h"
26#include "GaudiKernel/SmartDataPtr.h"
27#include "GaudiKernel/IService.h"
28#include "GaudiKernel/ISvcLocator.h"
29#include "GaudiKernel/IDataProviderSvc.h"
41#ifdef MDCXRECO_RESLAYER
45bool MdcxHit::m_countPropTime =
true;
49 :_mdcHit(0), _mdcDigi(pdcdatum), _c0(c0), _cresol(cresol)
55 :_mdcHit(pdchhit),_mdcDigi(pdchhit->digi()), _c0(c0), _cresol(cresol)
61 m_mdcCalibFunSvc = calibSvc;
65 m_countPropTime = countPropTime;
74 assert(m_mdcCalibFunSvc);
100 _wz = (tst*tst < 1.0) ? sqrt(1.0-tst*tst) : 0.0;
135float MdcxHit::d(
float z,
float tof,
float tzero,
int wamb,
float entranceAngle)
const {
139 float t_corr =
tcor(z,tof,tzero);
143 if (fabs(z)>150. || fabs(t_corr)>1500. || fabs(eAngle)>999){
149 if (wamb==1)lrCalib = 0;
150 else if (wamb==-1) lrCalib = 1;
156 if (fabs(driftD)<=0.0001) driftD = 0.001;
161 float doca=hel.
Doca(*
this);
168 float errTemp = fabs(getSigma(dd));
170 float errMin = 1.0e-7;
171 return errTemp<errMin?errMin:errTemp;
176 float doca=hel.
Doca(*
this);
if(hel.
Mode() == 0)doca=fabs(doca);
185 if(hel.
Mode() == 0) doca = fabs(doca);
186 doca +=
v()*hel.
T0();
198 deriv[0] = dtemp - deriv[0];
200 float ewire =
e(dtemp);
201 for (uint32_t i = 0; i < deriv.size(); i++) deriv[i] /= ewire;
210 o <<
" hit" << i <<
" (" <<
Layer() <<
"," <<
WireNo() <<
") ";
212 o <<
"dd " <<
d() <<
" dde "
213 <<
e() <<
" rt " <<
t() << endl;
216double MdcxHit::getSigma(
float driftDist,
int ambig,
double entranceAngle,
217 double dipAngle,
double z)
const {
219 if (ambig != 0) lrCalib = (ambig == 1) ? 0 : 1;
223 driftDist*10., eAngle,
tan(dipAngle), z*10.,
_iAdc);
226#ifdef MDCXRECO_RESLAYER
227 if (
Layer() == g_resLayer) {
double tan(const BesAngle a)
double sin(const BesAngle a)
double cos(const BesAngle a)
static const int viewOfsLayer[11]
double getSigma(int layid, int lr, double dist, double entrance=0.0, double tanlam=0.0, double z=0.0, double Q=1000.0) const
double getT0(int layid, int cellid) const
double driftTimeToDist(double drifttime, int layid, int cellid, int lr, double entrance=0.0) const
double getTprop(int lay, double z) const
double getTimeWalk(int layid, double Q) const
const MdcLayer * Layer(unsigned id) const
static int layer(const Identifier &id)
Values of different levels (failure returns 0)
static int wire(const Identifier &id)
double yWire(int cell) const
double phiOffset(void) const
double zLength(void) const
double stereo(void) const
double xWire(int cell) const
double Doca(double WX, double WY, double WZ, double X, double Y, double Z=0.0)
std::vector< float > derivatives(const MdcxHit &h)
float d(MdcxHel &hel) const
float pull(MdcxHel &hel) const
const MdcDigi * getDigi() const
void printAll(std::ostream &o, int i=0) const
float tcor(float zh=0.0, float tof=0.0, float tzero=0.0) const
std::vector< float > derivatives(MdcxHel &hel) const
float e(float dd=0.0) const
void print(std::ostream &o, int i=0) const
static void setMdcDetector(const MdcDetector *gm)
float residual(MdcxHel &hel) const
MdcxHit(const MdcDigi *pdcdatum, float c0=0, float cresol=.0180)
static void setMdcCalibFunSvc(const MdcCalibFunSvc *calibSvc)
const MdcHit * getMdcHit() const
static void setCountPropTime(bool countPropTime)
static double MdcTime(int timeChannel)
static double MdcCharge(int chargeChannel)
unsigned int getChargeChannel() const
int getTrackIndex() const
unsigned int getTimeChannel() const