5#include "GaudiKernel/MsgStream.h"
6#include "GaudiKernel/Bootstrap.h"
7#include "MagneticField/MagneticFieldSvc.h"
8#include "GaudiKernel/ISvcLocator.h"
9#include "GaudiKernel/IDataProviderSvc.h"
10#include "GaudiKernel/SmartDataPtr.h"
11#include "GaudiKernel/Algorithm.h"
17#include "CLHEP/Matrix/SymMatrix.h"
19double KalFitTrack::EventT0_ = 0.;
20HepSymMatrix KalFitTrack::initMatrix_(5,0);
51 EventT0_ = eventstart;
53 std::cout<<
"in function KalFitTrack::setT0(...), EventT0_ = "<<EventT0_<<std::endl;
62 std::cout<<
"in function KalFitTrack::getT0 ( ), EventT0_ = "<<EventT0_<<std::endl;
76 const double vinner = 220.0e8;
77 const double vouter = 240.0e8;
80 double zhit = (hitmdc.
rechitptr())->getZhit();
86 double wireLen = (fPoint-bPoint).
x()*(fPoint-bPoint).
x()+(fPoint-bPoint).
y()*(fPoint-bPoint).
y()+(fPoint-bPoint).z()*(fPoint-bPoint).z();
87 wireLen = sqrt(wireLen);
88 double wireZLen = fabs(fPoint.z() - bPoint.z());
100 tp = wireLen*fabs(zhit - bPoint.z())/wireZLen/vp;
112 tp = wireLen*fabs(zhit - fPoint.z())/wireZLen/vp;
123 double drifttime1(0.);
124 double drifttime2(0.);
125 double drifttime3(0.);
127 MdcDigiCol::iterator
iter = mdcDigiCol_->begin();
128 for(;
iter != mdcDigiCol_->end();
iter++ ) {
129 if((*iter)->identify() == (hitmdc.
rechitptr())->getMdcId())
break;
137 double timewalk = CalibFunSvc_->
getTimeWalk(layerid, Q);
140 std::cout<<
"CalibFunSvc_->getTimeWalk, timewalk ="<<timewalk<<std::endl;
143 double timeoffset = CalibFunSvc_->
getT0(wireid);
145 std::cout<<
"CalibFunSvc_->getT0, timeoffset ="<<timeoffset<<std::endl;
148 double eventt0 =
getT0();
151 std::cout<<
"the Event T0 we get in the function getDriftTime(...) is "<<eventt0<<std::endl;
155 double tdctime1 = hitmdc.
tdc();
160 std::cout<<
"tdctime1 be here is .."<<tdctime1<<std::endl;
173 std::cout<<
"the time channel be here is .."<<(*iter)->getTimeChannel()<<std::endl;
177 drifttime1 = tdctime1 - eventt0 - toftime - timewalk -timeoffset - tp;
178 drifttime2 = tdctime2 - eventt0 - toftime - timewalk -timeoffset - tp;
179 drifttime3 = tdctime3 - eventt0 - toftime - timewalk -timeoffset - tp;
181 std::cout<<
"we now compare the three kind of tdc , the tdc get from timeChannel() is "<<tdctime2<<
" the tdc get from KalFitHitMdc is "<<tdctime1<<
" the tdc from MdcRecHit is "<<tdctime3<<
" the drifttime1 is ..."<<drifttime1<<
" the drifttime 2 is ..."<<drifttime2<<
" the drifttime3 is ..."<<drifttime3<<std::endl;
199 std::cout<<
"the cellid is .."<<cellid<<std::endl;
205 return CalibFunSvc_->
driftTimeToDist(drifttime, layerid, cellid, lr, entrangle);
218 double temp = CalibFunSvc_->
getSigma(layerid, lr, dist, entrangle, tanlam, z , Q );
225 CalibFunSvc_ = calibsvc;
236 if(MFSvc_==0) cout<<
"KalFitTrack2:: Could not load MagneticFieldSvc!"<<endl;
241 iGeomSvc_ = igeomsvc;
246 mdcDigiCol_ = digicol;
ObjectVector< MdcDigi > MdcDigiCol
Description of a Hit in Mdc.
RecMdcHit * rechitptr(void)
const KalFitWire & wire(void) const
const int layerId(void) const
returns layer ID
static void setMdcDigiCol(MdcDigiCol *digicol)
double getDriftTime(KalFitHitMdc &hitmdc, double toftime) const
static int debug_
for debug
HepSymMatrix getInitMatrix(void) const
static void setInitMatrix(HepSymMatrix m)
double getSigma(int layerId, double driftDist) const
static void setMdcCalibFunSvc(const MdcCalibFunSvc *calibsvc)
static int drifttime_choice_
the drifttime choice
static int tprop_
for signal propagation correction
double getDriftDist(KalFitHitMdc &hitmdc, double drifttime, int lr) const
static void setT0(double t0)
static void setMagneticFieldSvc(IMagneticFieldSvc *)
static void setIMdcGeomSvc(IMdcGeomSvc *igeomsvc)
Description of a Wire class.
unsigned int geoID(void) const
HepPoint3D bck(void) const
HepPoint3D fwd(void) const
Geometry :
const KalFitLayer_Mdc & layer(void) const
HepPoint3D x(double dPhi=0.) const
returns position after rotating angle dPhi in phi direction.
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 getTimeWalk(int layid, double Q) const
static int wire(const Identifier &id)
static double MdcTime(int timeChannel)
static double MdcCharge(int chargeChannel)
const double getZhit(void) const
const double getAdc(void) const
const Identifier getMdcId(void) const
const double getTdc(void) const
const double getDriftT(void) const
const double getEntra(void) const