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

#include <Bfield.h>

Public Member Functions

int fieldID (void) const
 returns B field Map ID
const Hep3Vector & fieldMap (float x, float y, float z) const
 returns B field
const Hep3Vector & fieldMap (const HepPoint3D &xyz) const
void fieldMap (float *position, float *bfield)
float bx (float x, float y, float z) const
 returns an element of B field
float by (float x, float y, float z) const
float bz (float x, float y, float z) const
float bx (const HepPoint3D &xyz) const
float by (const HepPoint3D &xyz) const
float bz (const HepPoint3D &xyz) const
int fieldID (void) const
 returns B field Map ID
const Hep3Vector & fieldMap (float x, float y, float z) const
 returns B field
const Hep3Vector & fieldMap (const HepPoint3D &xyz) const
void fieldMap (float *position, float *bfield)
float bx (float x, float y, float z) const
 returns an element of B field
float by (float x, float y, float z) const
float bz (float x, float y, float z) const
float bx (const HepPoint3D &xyz) const
float by (const HepPoint3D &xyz) const
float bz (const HepPoint3D &xyz) const
int fieldID (void) const
 returns B field Map ID
const Hep3Vector & fieldMap (float x, float y, float z) const
 returns B field
const Hep3Vector & fieldMap (const HepPoint3D &xyz) const
void fieldMap (float *position, float *bfield)
float bx (float x, float y, float z) const
 returns an element of B field
float by (float x, float y, float z) const
float bz (float x, float y, float z) const
float bx (const HepPoint3D &xyz) const
float by (const HepPoint3D &xyz) const
float bz (const HepPoint3D &xyz) const

Static Public Member Functions

static BfieldgetBfield (int)
 returns Bfield object.
static BfieldgetBfield (int)
 returns Bfield object.
static BfieldgetBfield (int)
 returns Bfield object.

Protected Member Functions

 Bfield (int)
 Constructor, Destructor.
 Bfield (int)
 Constructor, Destructor.
 Bfield (int)
 Constructor, Destructor.

Detailed Description

Constructor & Destructor Documentation

◆ Bfield() [1/3]

Bfield::Bfield ( int imap)
protected

Constructor, Destructor.

Definition at line 23 of file TrackUtil/src/Bfield.cxx.

23 {
24 std::cout << std::endl;
25 std::cout << "***********************************************" << std::endl;
26 std::cout << " Bfield class MAP ID = " << imap << std::endl;
27 std::cout << " #### R < 174 cm, -152 < Z < 246 cm #### " << std::endl;
28 std::cout << " C++ version 1.00 " << std::endl;
29 std::cout << "***********************************************" << std::endl;
30
31 const float uniformBz[10] = { 0, 15, 14.5, 14, 13, 12.5, 12, 11, 10, 15.5 };
32
33 //...initialization
34 for ( int i = 0; i < 175; i++ )
35 for ( int j = 0; j < 399; j++ )
36 {
37 _Bz[i][j] = 0;
38 _Br[i][j] = 0;
39 _Bz[i][j] = 0;
40 if ( i < 101 && j < 163 )
41 {
42 _BzQR[i][j] = 0;
43 _BrQR[i][j] = 0;
44 _BphiQR[i][j] = 0;
45 }
46 }
47 for ( int i = 0; i < 17; i++ )
48 for ( int j = 0; j < 51; j++ )
49 for ( int k = 0; k < 52; k++ )
50 {
51 _BzQL[i][j][k] = 0;
52 _BrQL[i][j][k] = 0;
53 _BphiQL[i][j][k] = 0;
54 }
55
56 //...
57 _fieldID = imap;
58
59 //...read B field map
60
61 if ( imap < 10 )
62 {
63 //
64 // uniform B field map
65 //
66 m_Bx = 0.;
67 m_By = 0.;
68 m_Bz = uniformBz[imap];
69 m_Bfld.setX( (double)m_Bx );
70 m_Bfld.setY( (double)m_By );
71 m_Bfld.setZ( (double)m_Bz );
72 std::cout << "Bfield class >> creating uniform B field with id = " << imap;
73 std::cout << ", (Bx,By,Bz) = " << m_Bfld << std::endl;
74 }
75 else
76 {
77 //
78 // non-uniform B field map
79 //
80 /*
81 std::cout << "Bfield class >> loading non-uniform B field map" << std::endl;
82 geo_coil_readmap_(&imap, _Bz, _Br, _Bphi);
83 if( _fieldID == 21 ) {
84 std::cout << "Bfield class >> loading QCS" << std::endl;
85 geo_coil_readqcsrmap_(_BzQR,_BrQR, _BphiQR);
86 geo_coil_readqcslmap_(_BzQL,_BrQL, _BphiQL);
87 }
88 updateCache(0., 0., 0.);
89 */
90 }
91 std::cout << std::endl;
92}

Referenced by bz(), and getBfield().

◆ Bfield() [2/3]

Bfield::Bfield ( int )
protected

Constructor, Destructor.

◆ Bfield() [3/3]

Bfield::Bfield ( int )
protected

Constructor, Destructor.

Member Function Documentation

◆ bx() [1/6]

float Bfield::bx ( const HepPoint3D & xyz) const

Definition at line 163 of file TrackUtil/src/Bfield.cxx.

163 {
164
165 if ( _fieldID > 10 )
166 {
167 float x = xyz.x();
168 float y = xyz.y();
169 float z = xyz.z();
170 if ( x != m_x || y != m_y || z != m_z ) updateCache( x, y, z );
171 }
172
173 return m_Bx;
174}
Double_t x[10]

◆ bx() [2/6]

float Bfield::bx ( const HepPoint3D & xyz) const

◆ bx() [3/6]

float Bfield::bx ( const HepPoint3D & xyz) const

◆ bx() [4/6]

float Bfield::bx ( float x,
float y,
float z ) const

returns an element of B field

Definition at line 133 of file TrackUtil/src/Bfield.cxx.

133 {
134
135 if ( _fieldID > 10 )
136 {
137 if ( x != m_x || y != m_y || z != m_z ) updateCache( x, y, z );
138 }
139
140 return m_Bx;
141}

◆ bx() [5/6]

float Bfield::bx ( float x,
float y,
float z ) const

returns an element of B field

◆ bx() [6/6]

float Bfield::bx ( float x,
float y,
float z ) const

returns an element of B field

◆ by() [1/6]

float Bfield::by ( const HepPoint3D & xyz) const

Definition at line 176 of file TrackUtil/src/Bfield.cxx.

176 {
177
178 if ( _fieldID > 10 )
179 {
180 float x = xyz.x();
181 float y = xyz.y();
182 float z = xyz.z();
183 if ( x != m_x || y != m_y || z != m_z ) updateCache( x, y, z );
184 }
185
186 return m_By;
187}

◆ by() [2/6]

float Bfield::by ( const HepPoint3D & xyz) const

◆ by() [3/6]

float Bfield::by ( const HepPoint3D & xyz) const

◆ by() [4/6]

float Bfield::by ( float x,
float y,
float z ) const

Definition at line 143 of file TrackUtil/src/Bfield.cxx.

143 {
144
145 if ( _fieldID > 10 )
146 {
147 if ( x != m_x || y != m_y || z != m_z ) updateCache( x, y, z );
148 }
149
150 return m_By;
151}

◆ by() [5/6]

float Bfield::by ( float x,
float y,
float z ) const

◆ by() [6/6]

float Bfield::by ( float x,
float y,
float z ) const

◆ bz() [1/6]

float Bfield::bz ( const HepPoint3D & xyz) const

Definition at line 189 of file TrackUtil/src/Bfield.cxx.

189 {
190
191 if ( _fieldID > 10 )
192 {
193 float x = xyz.x();
194 float y = xyz.y();
195 float z = xyz.z();
196 if ( x != m_x || y != m_y || z != m_z ) updateCache( x, y, z );
197 }
198 return m_Bz;
199}

◆ bz() [2/6]

float Bfield::bz ( const HepPoint3D & xyz) const

◆ bz() [3/6]

float Bfield::bz ( const HepPoint3D & xyz) const

◆ bz() [4/6]

float Bfield::bz ( float x,
float y,
float z ) const

Definition at line 153 of file TrackUtil/src/Bfield.cxx.

153 {
154
155 if ( _fieldID > 10 )
156 {
157 if ( x != m_x || y != m_y || z != m_z ) updateCache( x, y, z );
158 }
159
160 return m_Bz;
161}

◆ bz() [5/6]

float Bfield::bz ( float x,
float y,
float z ) const

◆ bz() [6/6]

float Bfield::bz ( float x,
float y,
float z ) const

◆ fieldID() [1/3]

int Bfield::fieldID ( void ) const
inline

returns B field Map ID

Definition at line 48 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrackUtil/Bfield.h.

48{ return _fieldID; }

◆ fieldID() [2/3]

int Bfield::fieldID ( void ) const
inline

returns B field Map ID

Definition at line 48 of file InstallArea/x86_64-el9-gcc13-opt/include/TrackUtil/Bfield.h.

48{ return _fieldID; }

◆ fieldID() [3/3]

int Bfield::fieldID ( void ) const
inline

returns B field Map ID

Definition at line 48 of file Reconstruction/TrackUtil/include/TrackUtil/Bfield.h.

48{ return _fieldID; }

◆ fieldMap() [1/9]

const Hep3Vector & Bfield::fieldMap ( const HepPoint3D & xyz) const

Definition at line 106 of file TrackUtil/src/Bfield.cxx.

106 {
107
108 if ( _fieldID > 10 )
109 {
110 float x = xyz.x();
111 float y = xyz.y();
112 float z = xyz.z();
113 if ( x != m_x || y != m_y || z != m_z ) updateCache( x, y, z );
114 }
115
116 return m_Bfld;
117}

◆ fieldMap() [2/9]

const Hep3Vector & Bfield::fieldMap ( const HepPoint3D & xyz) const

◆ fieldMap() [3/9]

const Hep3Vector & Bfield::fieldMap ( const HepPoint3D & xyz) const

◆ fieldMap() [4/9]

void Bfield::fieldMap ( float * position,
float * bfield )

Definition at line 119 of file TrackUtil/src/Bfield.cxx.

119 {
120 if ( _fieldID > 10 )
121 {
122 float x = position[0];
123 float y = position[1];
124 float z = position[2];
125 if ( x != m_x || y != m_y || z != m_z ) updateCache( x, y, z );
126 }
127 field[0] = m_Bx;
128 field[1] = m_By;
129 field[2] = m_Bz;
130 return;
131}

◆ fieldMap() [5/9]

void Bfield::fieldMap ( float * position,
float * bfield )

◆ fieldMap() [6/9]

void Bfield::fieldMap ( float * position,
float * bfield )

◆ fieldMap() [7/9]

const Hep3Vector & Bfield::fieldMap ( float x,
float y,
float z ) const

returns B field

Definition at line 96 of file TrackUtil/src/Bfield.cxx.

96 {
97
98 if ( _fieldID > 10 )
99 {
100 if ( x != m_x || y != m_y || z != m_z ) updateCache( x, y, z );
101 }
102
103 return m_Bfld;
104}

◆ fieldMap() [8/9]

const Hep3Vector & Bfield::fieldMap ( float x,
float y,
float z ) const

returns B field

◆ fieldMap() [9/9]

const Hep3Vector & Bfield::fieldMap ( float x,
float y,
float z ) const

returns B field

◆ getBfield() [1/3]

Bfield * Bfield::getBfield ( int imap)
static

returns Bfield object.

Definition at line 18 of file TrackUtil/src/Bfield.cxx.

18 {
19 if ( !_field[imap] ) _field[imap] = new Bfield( imap );
20 return _field[imap];
21}
Bfield(int)
Constructor, Destructor.

Referenced by TRunge::BfieldID(), init_bfield_(), main(), TRunge::TRunge(), TRunge::TRunge(), TRunge::TRunge(), TRunge::TRunge(), and TRunge::TRunge().

◆ getBfield() [2/3]

Bfield * Bfield::getBfield ( int )
static

returns Bfield object.

◆ getBfield() [3/3]

Bfield * Bfield::getBfield ( int )
static

returns Bfield object.


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