#include <MdcTrackUtil.h>
Public Member Functions | |
MdcTrackUtil () | |
MdcTrackUtil () | |
int | nLayerTrackPassed (const double helix[5]) |
int | nLayerTrackPassed (const HepVector helix) |
int | nLayerTrackPassed (const double helix[5]) |
int | nLayerTrackPassed (const HepVector helix) |
HepSymMatrix | patRecErr2BesErr (const HepSymMatrix &err) |
HepSymMatrix | patRecErr2BesErr (const HepSymMatrix &err) |
HepVector | patRecPar2BesPar (const HepVector &helixPar) |
HepVector | patRecPar2BesPar (const HepVector &helixPar) |
~MdcTrackUtil () | |
~MdcTrackUtil () | |
Static Public Member Functions | |
MdcTrackUtil * | instance () |
MdcTrackUtil * | instance () |
Private Attributes | |
double | Bz |
MdcGeomSvc * | m_mdcGeomSvc |
MdcGeomSvc * | m_mdcGeomSvc |
IMagneticFieldSvc * | m_pIMF |
IMagneticFieldSvc * | m_pIMF |
Static Private Attributes | |
MdcTrackUtil * | _myself |
MdcTrackUtil * | _myself = 0 |
|
00039 { 00040 //Initalze magnetic flied 00041 IService* svc; 00042 Gaudi::svcLocator()->getService("MagneticFieldSvc",svc); 00043 m_pIMF = dynamic_cast<IMagneticFieldSvc*> (svc); 00044 if(! m_pIMF){ 00045 std::cout<<" ERROR Unable to open Magnetic field service "<<std::endl; 00046 } 00047 //get Bz for Check TEMP, Bz may be changed by run 00048 double gaussToTesla = 1000.; 00049 Bz = m_pIMF->getReferField()*gaussToTesla; 00050 00051 // Initialize MdcGeomSvc 00052 Gaudi::svcLocator()->getService("MdcGeomSvc",svc); 00053 m_mdcGeomSvc= dynamic_cast<MdcGeomSvc*> (svc); 00054 if(! m_mdcGeomSvc){ 00055 std::cout<<" FATAL Could not load MdcGeomSvc! "<<std::endl; 00056 } 00057 }
|
|
00012 {};
|
|
|
|
00012 {};
|
|
|
|
00031 { 00032 if( 0 == _myself ) { 00033 _myself = new MdcTrackUtil(); 00034 } 00035 return _myself; 00036 }
|
|
|
|
|
|
00068 { 00069 int nLayer = 0; 00070 00071 for(unsigned iLayer=0; iLayer<43; iLayer++){ 00072 //flightLength is the path length of track in the x-y plane 00073 //guess flightLength by the radius in middle of the wire. 00074 double rMidLayer = m_mdcGeomSvc->Layer(iLayer)->Radius(); 00075 double flightLength = rMidLayer; 00076 00077 HepPoint3D pivot(0.,0.,0.); 00078 double dz = helix[3]; 00079 double c = CLHEP::c_light * 100.; //unit from m/s to cm/s 00080 double alpha = 1/(c * Bz);//~333.567 00081 double kappa = helix[2]; 00082 double rc = (-1.)*alpha/kappa; 00083 //std::cout<<"MdcTrackUtil alpha "<<alpha<<std::endl; 00084 double tanl = helix[4]; 00085 double phi0 = helix[1]; 00086 double phi = flightLength/rc + phi0;//turning angle 00087 double z = pivot.z() + dz - (alpha/kappa) * tanl * phi; 00088 00089 double layerHalfLength = m_mdcGeomSvc->Layer(iLayer)->Length()/2.; 00090 00091 //std::cout<<"MdcTrackUtil length "<<layerHalfLength<<std::endl; 00092 00093 if (fabs(z) < fabs(layerHalfLength)) ++nLayer; 00094 } 00095 00096 return nLayer; 00097 }
|
|
00060 { 00061 double helixParam[5]; 00062 for(int i=0; i<5; ++i) helixParam[i] = helix[i]; 00063 00064 return nLayerTrackPassed(helixParam); 00065 }
|
|
|
|
00117 { 00118 //error matrix 00119 //std::cout<<" err1 "<<err<<" "<<err.num_row()<<std::endl; 00120 //V(Y)=S * V(X) * ST , mS = S , mVy = V(Y) , err() = V(X) 00121 //int n = err.num_row(); 00122 HepSymMatrix mS(err.num_row(),0); 00123 mS[0][0]=-1.;//dr0=-d0 00124 mS[1][1]=1.; 00125 mS[2][2]=Bz/-333.567;//pxy -> cpa 00126 mS[3][3]=1.; 00127 mS[4][4]=1.; 00128 HepSymMatrix mVy= err.similarity(mS); 00129 //std::cout<<" err2 "<<n<<" "<<mVy<<std::endl; 00130 return mVy; 00131 }
|
|
|
|
00100 { 00101 HepVector helix(5,0); 00102 double d0 = -helixPar[0]; //cm 00103 double phi0 = helixPar[1]+ CLHEP::halfpi; 00104 double omega = Bz*helixPar[2]/-333.567; 00105 double z0 = helixPar[3]; //cm 00106 double tanl = helixPar[4]; 00107 helix[0] = d0; 00108 helix[1] = phi0; 00109 helix[2] = omega; 00110 helix[3] = z0; 00111 helix[4] = tanl; 00112 //std::cout<<"helix "<<helix<<std::endl; 00113 return helix; 00114 }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|