BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/TrackUtil/include/TrackUtil/Bfield.h
Go to the documentation of this file.
1// -*- C++ -*-
2//
3// Bfield class
4//
5// 27-Mar-1999 : KUNIYA Toshio
6// Enabled QCS compornent, phi compornent
7//
8// 21-Feb-1999 : KUNIYA Toshio
9// Keeping comatibility, Bfield class is modified.
10// No longer fortran common block is used for bfield map.
11// Access functions are prepared for fortran call.
12//
13// 22-Feb-1999 : KUNIYA Toshio
14// constructor, destructor are go to protected entries.
15//
16
17#if !defined( BFIELD_H )
18# define BFIELD_H
19
20# include "CLHEP/Vector/ThreeVector.h"
21using CLHEP::Hep3Vector;
22
23# ifndef CLHEP_POINT3D_H
24# include "CLHEP/Geometry/Point3D.h"
25# endif
26# ifndef ENABLE_BACKWARDS_COMPATIBILITY
27typedef HepGeom::Point3D<double> HepPoint3D;
28# endif
29using HepGeom::Point3D;
30
31// class HepPoint3D;
32
33// class Bfield;
34
35class Bfield {
36
37public:
38 /// returns Bfield object.
39 static Bfield* getBfield( int );
40
41protected:
42 /// Constructor, Destructor
43 Bfield( int );
44 // zsl virtual ~Bfield(void) {};
45
46public: // selectors
47 /// returns B field Map ID
48 int fieldID( void ) const { return _fieldID; }
49
50 /// returns B field
51 const Hep3Vector& fieldMap( float x, float y, float z ) const;
52 const Hep3Vector& fieldMap( const HepPoint3D& xyz ) const;
53 void fieldMap( float* position, float* bfield );
54
55 /// returns an element of B field
56 float bx( float x, float y, float z ) const;
57 float by( float x, float y, float z ) const;
58 float bz( float x, float y, float z ) const;
59 float bx( const HepPoint3D& xyz ) const;
60 float by( const HepPoint3D& xyz ) const;
61 float bz( const HepPoint3D& xyz ) const;
62
63private:
64 static Bfield* _field[200];
65 float _Bz[175][399];
66 float _Br[175][399];
67 float _Bphi[175][399];
68 float _BzQR[101][163];
69 float _BrQR[101][163];
70 float _BphiQR[101][163];
71 float _BzQL[17][51][52];
72 float _BrQL[17][51][52];
73 float _BphiQL[17][51][52];
74 int _fieldID;
75 mutable float m_Bx;
76 mutable float m_By;
77 mutable float m_Bz;
78 mutable float m_x;
79 mutable float m_y;
80 mutable float m_z;
81 mutable Hep3Vector m_Bfld;
82
83private:
84 void updateCache( float, float, float ) const;
85};
86
87#endif /* BFIELD_H */
HepGeom::Point3D< double > HepPoint3D
HepGeom::Point3D< double > HepPoint3D
float bz(const HepPoint3D &xyz) const
Bfield(int)
Constructor, Destructor.
float by(float x, float y, float z) const
float bz(float x, float y, float z) const
float bx(const HepPoint3D &xyz) const
void fieldMap(float *position, float *bfield)
int fieldID(void) const
returns B field Map ID
float bx(float x, float y, float z) const
returns an element of B field
const Hep3Vector & fieldMap(const HepPoint3D &xyz) const
const Hep3Vector & fieldMap(float x, float y, float z) const
returns B field
float by(const HepPoint3D &xyz) const
static Bfield * getBfield(int)
returns Bfield object.