1#include "TrackUtil/MdcTrackUtil.h"
2#include "GaudiKernel/MsgStream.h"
3#include "GaudiKernel/SmartDataPtr.h"
4#include "GaudiKernel/Bootstrap.h"
5#include "GaudiKernel/ISvcLocator.h"
6#include "EventModel/EventHeader.h"
7#include "RawEvent/RawDataUtil.h"
8#include "CLHEP/Units/PhysicalConstants.h"
10#include "Identifier/MdcID.h"
11#include "MdcRawEvent/MdcDigi.h"
13#ifndef ENABLE_BACKWARDS_COMPATIBILITY
19#include "MdcRecEvent/RecMdcTrack.h"
20#include "MdcRecEvent/RecMdcHit.h"
23#include "MdcGeomSvc/MdcGeomSvc.h"
42 Gaudi::svcLocator()->getService(
"MagneticFieldSvc",svc);
45 std::cout<<
" ERROR Unable to open Magnetic field service "<<std::endl;
48 double gaussToTesla = 1000.;
52 Gaudi::svcLocator()->getService(
"MdcGeomSvc",svc);
55 std::cout<<
" FATAL Could not load MdcGeomSvc! "<<std::endl;
62 for(
int i=0; i<5; ++i) helixParam[i] = helix[i];
71 for(
unsigned iLayer=0; iLayer<43; iLayer++){
74 double rMidLayer = m_mdcGeomSvc->
Layer(iLayer)->
Radius();
75 double flightLength = rMidLayer;
79 double c = CLHEP::c_light * 100.;
80 double alpha = 1/(c * Bz);
81 double kappa = helix[2];
82 double rc = (-1.)*
alpha/kappa;
84 double tanl = helix[4];
85 double phi0 = helix[1];
86 double phi = flightLength/rc + phi0;
87 double z = pivot.z() + dz - (
alpha/kappa) * tanl * phi;
89 double layerHalfLength = m_mdcGeomSvc->
Layer(iLayer)->
Length()/2.;
93 if (fabs(z) < fabs(layerHalfLength)) ++nLayer;
101 HepVector helix(5,0);
102 double d0 = -helixPar[0];
103 double phi0 = helixPar[1]+ CLHEP::halfpi;
104 double omega = Bz*helixPar[2]/-333.567;
105 double z0 = helixPar[3];
106 double tanl = helixPar[4];
122 HepSymMatrix mS(err.num_row(),0);
125 mS[2][2]=Bz/-333.567;
128 HepSymMatrix mVy= err.similarity(mS);
HepGeom::Point3D< double > HepPoint3D
virtual double getReferField()=0
double Radius(void) const
double Length(void) const
const MdcGeoLayer *const Layer(unsigned id)
static MdcTrackUtil * instance()
int nLayerTrackPassed(const HepVector helix)
HepSymMatrix patRecErr2BesErr(const HepSymMatrix &err)
HepVector patRecPar2BesPar(const HepVector &helixPar)