BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
MdcTrackUtil Class Reference

#include <MdcTrackUtil.h>

Public Member Functions

 MdcTrackUtil ()
 ~MdcTrackUtil ()
int nLayerTrackPassed (const HepVector helix)
int nLayerTrackPassed (const double helix[5])
HepVector patRecPar2BesPar (const HepVector &helixPar)
HepSymMatrix patRecErr2BesErr (const HepSymMatrix &err)
 MdcTrackUtil ()
 ~MdcTrackUtil ()
int nLayerTrackPassed (const HepVector helix)
int nLayerTrackPassed (const double helix[5])
HepVector patRecPar2BesPar (const HepVector &helixPar)
HepSymMatrix patRecErr2BesErr (const HepSymMatrix &err)
 MdcTrackUtil ()
 ~MdcTrackUtil ()
int nLayerTrackPassed (const HepVector helix)
int nLayerTrackPassed (const double helix[5])
HepVector patRecPar2BesPar (const HepVector &helixPar)
HepSymMatrix patRecErr2BesErr (const HepSymMatrix &err)

Static Public Member Functions

static MdcTrackUtilinstance ()
static MdcTrackUtilinstance ()
static MdcTrackUtilinstance ()

Detailed Description

Constructor & Destructor Documentation

◆ MdcTrackUtil() [1/3]

MdcTrackUtil::MdcTrackUtil ( )

Definition at line 35 of file MdcTrackUtil.cxx.

35 {
36 // Initalze magnetic flied
37 m_pIMF = service( "MagneticFieldSvc" );
38 if ( !m_pIMF ) { std::cout << " ERROR Unable to open Magnetic field service " << std::endl; }
39 // get Bz for Check TEMP, Bz may be changed by run
40 double gaussToTesla = 1000.;
41 Bz = m_pIMF->getReferField() * gaussToTesla;
42
43 // Initialize MdcGeomSvc
44 m_mdcGeomSvc = service( "MdcGeomSvc" );
45 if ( !m_mdcGeomSvc ) { std::cout << " FATAL Could not load MdcGeomSvc! " << std::endl; }
46}

Referenced by instance(), and patRecErr2BesErr().

◆ ~MdcTrackUtil() [1/3]

MdcTrackUtil::~MdcTrackUtil ( )
inline

◆ MdcTrackUtil() [2/3]

MdcTrackUtil::MdcTrackUtil ( )

◆ ~MdcTrackUtil() [2/3]

MdcTrackUtil::~MdcTrackUtil ( )
inline

◆ MdcTrackUtil() [3/3]

MdcTrackUtil::MdcTrackUtil ( )

◆ ~MdcTrackUtil() [3/3]

MdcTrackUtil::~MdcTrackUtil ( )
inline

Member Function Documentation

◆ instance() [1/3]

MdcTrackUtil * MdcTrackUtil::instance ( )
static

Definition at line 30 of file MdcTrackUtil.cxx.

30 {
31 if ( 0 == _myself ) { _myself = new MdcTrackUtil(); }
32 return _myself;
33}

◆ instance() [2/3]

MdcTrackUtil * MdcTrackUtil::instance ( )
static

◆ instance() [3/3]

MdcTrackUtil * MdcTrackUtil::instance ( )
static

◆ nLayerTrackPassed() [1/6]

int MdcTrackUtil::nLayerTrackPassed ( const double helix[5])

Definition at line 57 of file MdcTrackUtil.cxx.

57 {
58 int nLayer = 0;
59
60 for ( unsigned iLayer = 0; iLayer < 43; iLayer++ )
61 {
62 // flightLength is the path length of track in the x-y plane
63 // guess flightLength by the radius in middle of the wire.
64 double rMidLayer = m_mdcGeomSvc->Layer( iLayer )->Radius();
65 double flightLength = rMidLayer;
66
67 HepPoint3D pivot( 0., 0., 0. );
68 double dz = helix[3];
69 double c = CLHEP::c_light * 100.; // unit from m/s to cm/s
70 double alpha = 1 / ( c * Bz ); //~333.567
71 double kappa = helix[2];
72 double rc = ( -1. ) * alpha / kappa;
73 // std::cout<<"MdcTrackUtil alpha "<<alpha<<std::endl;
74 double tanl = helix[4];
75 double phi0 = helix[1];
76 double phi = flightLength / rc + phi0; // turning angle
77 double z = pivot.z() + dz - ( alpha / kappa ) * tanl * phi;
78
79 double layerHalfLength = m_mdcGeomSvc->Layer( iLayer )->Length() / 2.;
80
81 // std::cout<<"MdcTrackUtil length "<<layerHalfLength<<std::endl;
82
83 if ( fabs( z ) < fabs( layerHalfLength ) ) ++nLayer;
84 }
85
86 return nLayer;
87}
HepGeom::Point3D< double > HepPoint3D
double alpha

◆ nLayerTrackPassed() [2/6]

int MdcTrackUtil::nLayerTrackPassed ( const double helix[5])

◆ nLayerTrackPassed() [3/6]

int MdcTrackUtil::nLayerTrackPassed ( const double helix[5])

◆ nLayerTrackPassed() [4/6]

int MdcTrackUtil::nLayerTrackPassed ( const HepVector helix)

Definition at line 49 of file MdcTrackUtil.cxx.

49 {
50 double helixParam[5];
51 for ( int i = 0; i < 5; ++i ) helixParam[i] = helix[i];
52
53 return nLayerTrackPassed( helixParam );
54}
int nLayerTrackPassed(const HepVector helix)

Referenced by nLayerTrackPassed().

◆ nLayerTrackPassed() [5/6]

int MdcTrackUtil::nLayerTrackPassed ( const HepVector helix)

◆ nLayerTrackPassed() [6/6]

int MdcTrackUtil::nLayerTrackPassed ( const HepVector helix)

◆ patRecErr2BesErr() [1/3]

HepSymMatrix MdcTrackUtil::patRecErr2BesErr ( const HepSymMatrix & err)

Definition at line 107 of file MdcTrackUtil.cxx.

107 {
108 // error matrix
109 // std::cout<<" err1 "<<err<<" "<<err.num_row()<<std::endl;
110 // V(Y)=S * V(X) * ST , mS = S , mVy = V(Y) , err() = V(X)
111 // int n = err.num_row();
112 HepSymMatrix mS( err.num_row(), 0 );
113 mS[0][0] = -1.; // dr0=-d0
114 mS[1][1] = 1.;
115 mS[2][2] = Bz / -333.567; // pxy -> cpa
116 mS[3][3] = 1.;
117 mS[4][4] = 1.;
118 HepSymMatrix mVy = err.similarity( mS );
119 // std::cout<<" err2 "<<n<<" "<<mVy<<std::endl;
120 return mVy;
121}

◆ patRecErr2BesErr() [2/3]

HepSymMatrix MdcTrackUtil::patRecErr2BesErr ( const HepSymMatrix & err)

◆ patRecErr2BesErr() [3/3]

HepSymMatrix MdcTrackUtil::patRecErr2BesErr ( const HepSymMatrix & err)

◆ patRecPar2BesPar() [1/3]

HepVector MdcTrackUtil::patRecPar2BesPar ( const HepVector & helixPar)

Definition at line 90 of file MdcTrackUtil.cxx.

90 {
91 HepVector helix( 5, 0 );
92 double d0 = -helixPar[0]; // cm
93 double phi0 = helixPar[1] + CLHEP::halfpi;
94 double omega = Bz * helixPar[2] / -333.567;
95 double z0 = helixPar[3]; // cm
96 double tanl = helixPar[4];
97 helix[0] = d0;
98 helix[1] = phi0;
99 helix[2] = omega;
100 helix[3] = z0;
101 helix[4] = tanl;
102 // std::cout<<"helix "<<helix<<std::endl;
103 return helix;
104}

◆ patRecPar2BesPar() [2/3]

HepVector MdcTrackUtil::patRecPar2BesPar ( const HepVector & helixPar)

◆ patRecPar2BesPar() [3/3]

HepVector MdcTrackUtil::patRecPar2BesPar ( const HepVector & helixPar)

The documentation for this class was generated from the following files: