#include <BField.h>
Public Member Functions | |
~VertexFitBField () | |
double | getBFieldZ (const HepPoint3D &vtx) |
double | getBFieldZRef () |
double | getCBz (const HepVector &vtx, const HepVector &trackPosition) |
Static Public Member Functions | |
static VertexFitBField * | instance () |
Private Member Functions | |
VertexFitBField () | |
Private Attributes | |
IMagneticFieldSvc * | m_pIMF |
Static Private Attributes | |
static VertexFitBField * | s_bfield = 0 |
static const double | alpha = -0.00299792458 |
Definition at line 22 of file BField.h.
VertexFitBField::VertexFitBField | ( | ) | [private] |
Definition at line 22 of file BField.cxx.
References m_pIMF.
Referenced by instance().
00022 { 00023 #ifndef BEAN 00024 ISvcLocator* svcLocator = Gaudi::svcLocator(); 00025 m_pIMF = NULL; 00026 StatusCode sc = svcLocator->service("MagneticFieldSvc",m_pIMF); 00027 assert(m_pIMF != NULL); 00028 if (sc != StatusCode::SUCCESS) { 00029 std::cout << "ERROR : Unable to open Magnetic field service" << std::endl; 00030 // assert(false); 00031 } 00032 #else 00033 m_pIMF = MagneticFieldSvc::instance(); 00034 assert( m_pIMF != 0 ); 00035 if( (m_pIMF->GetPath()).empty() ) { 00036 cout << " VertexFitBField::ERROR " 00037 "You MUST set path to directory with magnetic fields tables" << endl; 00038 exit(1); 00039 } 00040 if( !m_pIMF->initialize() ) { 00041 cout << "ERROR : Can not initialize MagneticField. Stop." << endl; 00042 exit(1); 00043 } 00044 #endif 00045 }
double VertexFitBField::getBFieldZ | ( | const HepPoint3D & | vtx | ) |
Definition at line 47 of file BField.cxx.
References abs, IMagneticFieldSvc::fieldVector(), IMagneticFieldSvc::getReferField(), and m_pIMF.
Referenced by HTrackParameter::center(), HTrackParameter::dHdp(), HTrackParameter::dHdx(), HTrackParameter::HTrackParameter(), HTrackParameter::positionTwoHelix(), and HTrackParameter::radius().
00047 { 00048 HepVector3D vector(0.0, 0.0, 0.0); 00049 // fixed 2008-8-1 00050 double radius = sqrt(vtx.x()*vtx.x() + vtx.y()*vtx.y()); 00051 if (radius < 150 && abs(vtx.z()) < 150) { 00052 m_pIMF->fieldVector(10.0*vtx, vector); 00053 return 1000 * vector.z(); //unit of m_BFieldZ is Tesla 00054 } else { 00055 return 1000 * m_pIMF->getReferField(); 00056 } 00057 }
double VertexFitBField::getBFieldZRef | ( | ) |
Definition at line 59 of file BField.cxx.
References IMagneticFieldSvc::getReferField(), and m_pIMF.
Referenced by FastVertexFit::addTrack(), and VFHelix::VFHelix().
00059 { 00060 return 1000 * m_pIMF->getReferField(); 00061 }
double VertexFitBField::getCBz | ( | const HepVector & | vtx, | |
const HepVector & | trackPosition | |||
) |
Definition at line 63 of file BField.cxx.
References abs, alpha, IMagneticFieldSvc::fieldVector(), IMagneticFieldSvc::getReferField(), and m_pIMF.
Referenced by VertexFit::BuildVirtualParticle(), SecondVertexFit::Fit(), VertexFit::swimVertex(), VertexFit::UpdateConstraints(), and VertexConstraints::UpdateConstraints().
00063 { 00064 HepPoint3D Vtx(vtx[0], vtx[1], vtx[2]); 00065 HepPoint3D TrkPosition(trackPosition[0], trackPosition[1], trackPosition[2]); 00066 00067 HepVector3D vector_vtx(0.0, 0.0, 0.0); 00068 HepVector3D vector_trk(0.0, 0.0, 0.0); 00069 double radius = sqrt(vtx[0]*vtx[0] + vtx[1]*vtx[1]); 00070 if (radius < 150 && abs(vtx[2]) < 150) { 00071 m_pIMF->fieldVector(10.0*Vtx, vector_vtx); 00072 m_pIMF->fieldVector(10.0*TrkPosition, vector_trk); 00073 return 1000 * alpha * (vector_vtx.z() + vector_trk.z())/2;//unit of m_BFieldZ is Tesla 00074 } else { 00075 return 1000 * alpha* m_pIMF->getReferField(); 00076 } 00077 }
static VertexFitBField* VertexFitBField::instance | ( | ) | [inline, static] |
Definition at line 24 of file BField.h.
References s_bfield, and VertexFitBField().
Referenced by FastVertexFit::addTrack(), VertexFit::BuildVirtualParticle(), HTrackParameter::center(), HTrackParameter::dHdp(), HTrackParameter::dHdx(), SecondVertexFit::Fit(), HTrackParameter::HTrackParameter(), HTrackParameter::positionTwoHelix(), HTrackParameter::radius(), VertexFit::swimVertex(), VertexFit::UpdateConstraints(), VertexConstraints::UpdateConstraints(), and VFHelix::VFHelix().
00024 { 00025 if (s_bfield == 0) { 00026 s_bfield = new VertexFitBField(); 00027 } 00028 return s_bfield; 00029 }
const double VertexFitBField::alpha = -0.00299792458 [static, private] |
IMagneticFieldSvc* VertexFitBField::m_pIMF [private] |
Definition at line 42 of file BField.h.
Referenced by getBFieldZ(), getBFieldZRef(), getCBz(), and VertexFitBField().
VertexFitBField * VertexFitBField::s_bfield = 0 [static, private] |