#include <MdcxHit.h>
Public Member Functions | |
float | d (float zh=0.0, float tof=0.0, float tzero=0.0, int wamb=0, float eang=0.0) const |
float | d (MdcxHel &hel) const |
float | d (float zh=0.0, float tof=0.0, float tzero=0.0, int wamb=0, float eang=0.0) const |
float | d (MdcxHel &hel) const |
std::vector< float > | derivatives (MdcxHel &hel) const |
std::vector< float > | derivatives (MdcxHel &hel) const |
float | e (float dd=0.0) const |
float | e (float dd=0.0) const |
const MdcDigi * | getDigi () const |
const MdcDigi * | getDigi () const |
const MdcHit * | getMdcHit () const |
const MdcHit * | getMdcHit () const |
int | GetUsedOnHel () const |
int | GetUsedOnHel () const |
int | Layer () const |
int | Layer () const |
MdcxHit (const MdcHit *pdchhit, float c0=0, float cresol=.0180) | |
MdcxHit (const MdcDigi *pdcdatum, float c0=0, float cresol=.0180) | |
MdcxHit (const MdcHit *pdchhit, float c0=0, float cresol=.0180) | |
MdcxHit (const MdcDigi *pdcdatum, float c0=0, float cresol=.0180) | |
float | phiMid () const |
float | phiMid () const |
void | print (std::ostream &o, int i=0) const |
void | print (std::ostream &o, int i=0) const |
void | printAll (std::ostream &o, int i=0) const |
void | printAll (std::ostream &o, int i=0) const |
float | pull (MdcxHel &hel) const |
float | pull (MdcxHel &hel) const |
float | pw () const |
float | pw () const |
float | residual (MdcxHel &hel) const |
float | residual (MdcxHel &hel) const |
void | SetConstErr (int i) |
void | SetConstErr (int i) |
void | SetUsedOnHel (int i) |
void | SetUsedOnHel (int i) |
float | stereo () const |
float | stereo () const |
int | SuperLayer () const |
int | SuperLayer () const |
float | t () const |
float | t () const |
float | tcor (float zh=0.0, float tof=0.0, float tzero=0.0) const |
float | tcor (float zh=0.0, float tof=0.0, float tzero=0.0) const |
int | type () const |
int | type () const |
float | v () const |
float | v () const |
int | WireNo () const |
int | WireNo () const |
float | wx () const |
float | wx () const |
float | wy () const |
float | wy () const |
float | wz () const |
float | wz () const |
float | x () const |
float | x () const |
float | xneg () const |
float | xneg () const |
float | xpos () const |
float | xpos () const |
float | y () const |
float | y () const |
float | yneg () const |
float | yneg () const |
float | ypos () const |
float | ypos () const |
virtual | ~MdcxHit () |
virtual | ~MdcxHit () |
Static Public Member Functions | |
void | setCountPropTime (bool countPropTime) |
void | setCountPropTime (bool countPropTime) |
void | setMdcCalibFunSvc (const MdcCalibFunSvc *calibSvc) |
void | setMdcCalibFunSvc (const MdcCalibFunSvc *calibSvc) |
void | setMdcDetector (const MdcDetector *gm) |
void | setMdcDetector (const MdcDetector *gm) |
Protected Member Functions | |
void | process () |
void | process () |
Protected Attributes | |
float | _c0 |
int | _consterr |
float | _cp |
float | _cresol |
float | _d |
float | _e |
unsigned | _iAdc |
unsigned | _iTdc |
float | _L |
unsigned | _layernumber |
const MdcDigi * | _mdcDigi |
const MdcDigi * | _mdcDigi |
const MdcHit * | _mdcHit |
const MdcHit * | _mdcHit |
float | _p |
double | _pw |
float | _q |
float | _r |
float | _s |
float | _sp |
unsigned | _superlayer |
float | _t |
float | _T0Walk |
int | _type |
float | _v |
unsigned | _wirenumber |
double | _wx |
double | _wy |
double | _wz |
float | _x |
float | _xneg |
float | _xpos |
float | _y |
float | _yneg |
float | _ypos |
int | usedonhel |
Private Member Functions | |
double | getSigma (float driftDist, int ambig=0, double entrAngle=0, double dipAngle=0, double z=0) const |
double | getSigma (float driftDist, int ambig=0, double entrAngle=0, double dipAngle=0, double z=0) const |
MdcxHit (const MdcxHit &) | |
MdcxHit (const MdcxHit &) | |
MdcxHit & | operator= (const MdcxHit &) |
MdcxHit & | operator= (const MdcxHit &) |
bool | operator== (const MdcxHit &) const |
bool | operator== (const MdcxHit &) const |
Static Private Attributes | |
bool | m_countPropTime = true |
const MdcDetector * | m_gm |
const MdcDetector * | m_gm = 0 |
const MdcCalibFunSvc * | m_mdcCalibFunSvc |
const MdcCalibFunSvc * | m_mdcCalibFunSvc = 0 |
|
|
|
00055 :_mdcHit(pdchhit),_mdcDigi(pdchhit->digi()), _c0(c0), _cresol(cresol) 00056 { 00057 process(); 00058 }
|
|
00050 { };
|
|
|
|
|
|
|
|
00050 { };
|
|
|
|
|
|
|
|
00135 { 00136 00137 //std::cout<<__FILE__<<" "<<__LINE__<<" call entrance "<< entranceAngle<< std::endl; 00138 //tof = hel.Doca_Tof();//yzhang delete for csmc temp FIXME 00139 float t_corr = tcor(z,tof,tzero); 00140 int lrCalib = 2; 00141 if (wamb==1)lrCalib = 0; 00142 else if (wamb==-1) lrCalib = 1; 00143 double eAngle = EntranceAngle(entranceAngle); 00144 00145 double driftD = 0.1 * m_mdcCalibFunSvc->driftTimeToDist(t_corr,_layernumber,_wirenumber,lrCalib,eAngle);//to cm 00146 00147 00148 if (driftD<=0.0001) driftD = 0.001; 00149 return driftD; 00150 }
|
|
00152 { 00153 float doca=hel.Doca(*this); // changes hel's internal state... 00154 return d(hel.Doca_Zh(),hel.Doca_Tof(),hel.T0(), 00155 hel.Doca_Wamb(),hel.Doca_Eang()); 00156 }//endof d
|
|
|
|
00184 { 00185 // compute derivatives for |hel| 00186 std::vector<float> deriv = hel.derivatives(*this); 00187 float dtemp = d(hel.Doca_Zh(), hel.Doca_Tof(), hel.T0(), 00188 hel.Doca_Wamb(), hel.Doca_Eang()); 00189 //float dtemp = d(hel); 00190 deriv[0] = dtemp - deriv[0]; 00191 // deriv[0] -= v()*hel.T0(); 00192 float ewire = e(dtemp); 00193 for (uint32_t i = 0; i < deriv.size(); i++) deriv[i] /= ewire; 00194 return deriv; 00195 }//endof derivatives
|
|
|
|
00158 { 00159 //if (0!=_consterr) return _cresol;//yzhang delete 2009-11-03 00160 float errTemp = fabs(getSigma(dd)); 00161 // protect against resolution = 0; set min resol to 1 nm 00162 float errMin = 1.0e-7; 00163 return errTemp<errMin?errMin:errTemp; 00164 }
|
|
00063 {return _mdcDigi;}
|
|
00063 {return _mdcDigi;}
|
|
00064 {return _mdcHit;}
|
|
00064 {return _mdcHit;}
|
|
|
|
00209 { 00210 int lrCalib = 2; 00211 if (ambig != 0) lrCalib = (ambig == 1) ? 0 : 1; 00212 double eAngle = EntranceAngle(entranceAngle); 00213 double sig = 0.1 * m_mdcCalibFunSvc->getSigma(_layernumber, lrCalib, 00214 driftDist*10., eAngle, tan(dipAngle), z*10., _iAdc); 00215 //double sig = 0.1 * m_mdcCalibFunSvc->getSigma(_layernumber, _wirenumber, lrCalib, 00216 //driftDist*10., eAngle, tan(dipAngle), z*10., _iAdc); 00217 #ifdef MDCXRECO_RESLAYER 00218 if (Layer() == g_resLayer) { 00219 //give a huge sigma to skip this layer when fit track 00220 return 9999.; 00221 } 00222 #endif 00223 return sig; 00224 }
|
|
00103 {return usedonhel;}
|
|
00103 {return usedonhel;}
|
|
00067 {return _layernumber;}// layer#
|
|
00067 {return _layernumber;}// layer#
|
|
|
|
|
|
|
|
|
|
00079 {return _pw;} //yzhang add
|
|
00079 {return _pw;} //yzhang add
|
|
|
|
|
|
|
|
00201 { 00202 o << " hit" << i << " (" << Layer() << "," << WireNo() << ") "; 00203 if (getMdcHit()) o << " phi "<< getMdcHit()->phi(); 00204 o << "dd " << d() << " dde " 00205 << e() << " rt " << t() << endl; 00206 }
|
|
|
|
00072 { 00073 assert(m_gm); 00074 assert(m_mdcCalibFunSvc); 00075 Identifier _id = (*_mdcDigi).identify(); 00076 _layernumber=MdcID::layer(_id); 00077 _wirenumber=MdcID::wire(_id); 00078 _superlayer=(_layernumber)/4; 00079 _iTdc = _mdcDigi->getTimeChannel(); 00080 _iAdc = _mdcDigi->getChargeChannel(); 00081 _t = RawDataUtil::MdcTime(_iTdc); 00082 _q = RawDataUtil::MdcCharge(_iAdc); 00083 _T0Walk = m_mdcCalibFunSvc->getT0(_layernumber,_wirenumber) 00084 + m_mdcCalibFunSvc->getTimeWalk(_layernumber,_iAdc); 00085 // pointer to layer 00086 const MdcLayer* layerPtr= m_gm->Layer(_layernumber); 00087 _L = layerPtr->zLength(); 00088 _x = layerPtr->xWire(_wirenumber); 00089 _y = layerPtr->yWire(_wirenumber); 00090 _r = sqrt(_x*_x + _y*_y); 00091 _s = layerPtr->stereo(); 00092 _p = layerPtr->phiOffset() + _wirenumber*layerPtr->dPhi(); 00093 //double deltaz = m_gm->zOffSet(); //yzhang to BESIII 00094 //double deltaz = 0.0; 00095 double tst = _s; 00096 double pw = atan2(_y, _x); 00097 _pw = pw; 00098 _wx = -tst*sin(pw); 00099 _wy = tst*cos(pw); 00100 _wz = (tst*tst < 1.0) ? sqrt(1.0-tst*tst) : 0.0; 00101 _sp = sin(_p); 00102 _cp = cos(_p); 00103 _consterr = 0; //zoujh FIXME 00104 _e = _cresol; 00105 _d = d(); 00106 // note _v is a total cludge 00107 _v = (_t-_c0 > 0.0) ? _d/(_t-_c0) : 0.0013;//yzhang 2009-11-03 00108 _xneg = _x + _d*_sp; 00109 _yneg = _y - _d*_cp; 00110 _xpos = _x - _d*_sp; 00111 _ypos = _y + _d*_cp; 00112 usedonhel = 0; 00113 _type = Constants::viewOfsLayer[_superlayer]; 00114 }
|
|
|
|
00166 { 00167 // compute pulls for |hel| 00168 float doca=hel.Doca(*this); if(hel.Mode() == 0)doca=fabs(doca); 00169 return (d(hel.Doca_Zh(),hel.Doca_Tof(),hel.T0(), 00170 hel.Doca_Wamb(),hel.Doca_Eang())-doca)/e(doca); 00171 //return residual(hel)/e(); 00172 }
|
|
00078 {return _pw;}
|
|
00078 {return _pw;}
|
|
|
|
00174 { 00175 // compute residuals for |hel| 00176 float doca = hel.Doca(_wx, _wy, _wz, _x, _y); 00177 if(hel.Mode() == 0) doca = fabs(doca); 00178 doca += v()*hel.T0(); 00179 return d(hel.Doca_Zh(),hel.Doca_Tof(),hel.T0(), 00180 hel.Doca_Wamb(),hel.Doca_Eang())-doca; 00181 //return d(hel) - doca; 00182 }
|
|
00085 {_consterr = i;}
|
|
00085 {_consterr = i;}
|
|
|
|
00064 { 00065 m_countPropTime = countPropTime; 00066 }
|
|
|
|
00060 { 00061 m_mdcCalibFunSvc = calibSvc; 00062 }
|
|
|
|
00068 { 00069 m_gm = gm; 00070 }
|
|
00102 {usedonhel=i;}
|
|
00102 {usedonhel=i;}
|
|
00080 {return _s;} // stereo angle of wire
|
|
00080 {return _s;} // stereo angle of wire
|
|
00065 {return _superlayer;} //SuperLayer#
|
|
00065 {return _superlayer;} //SuperLayer#
|
|
00068 {return _t;} // drift time
|
|
00068 {return _t;} // drift time
|
|
|
|
00116 { 00117 //drift time 00118 double tprop = 0.; 00119 if (m_countPropTime){ tprop = m_mdcCalibFunSvc->getTprop(_layernumber,z*10); } 00120 double dt = (_t - _T0Walk -_c0 - tprop - tof - tzero); 00121 /* 00122 std::cout<<"("<<_layernumber<<","<<_wirenumber<<") dt "<<dt 00123 <<" rt "<<_t 00124 <<" t0walk "<< _T0Walk 00125 <<" z "<<z 00126 <<" _c0 "<<_c0 00127 <<" tzero "<<tzero 00128 <<" tof "<<tof 00129 <<" tprop "<<tprop 00130 <<std::endl; 00131 */ 00132 return dt; 00133 }
|
|
00082 {return _type;} // flags |MdcxHit|
|
|
00082 {return _type;} // flags |MdcxHit|
|
|
00081 {return _v;} // drift velocity
|
|
00081 {return _v;} // drift velocity
|
|
00066 {return _wirenumber;} // Wire#
|
|
00066 {return _wirenumber;} // Wire#
|
|
00075 {return _wx;}
|
|
00075 {return _wx;}
|
|
00076 {return _wy;}
|
|
00076 {return _wy;}
|
|
00077 {return _wz;}
|
|
00077 {return _wz;}
|
|
00069 {return _x;} // x of wire
|
|
00069 {return _x;} // x of wire
|
|
00073 {return _xneg;}
|
|
00073 {return _xneg;}
|
|
00071 {return _xpos;}
|
|
00071 {return _xpos;}
|
|
00070 {return _y;} // y of wire
|
|
00070 {return _y;} // y of wire
|
|
00074 {return _yneg;}
|
|
00074 {return _yneg;}
|
|
00072 {return _ypos;}
|
|
00072 {return _ypos;}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|