BOSS 7.1.2
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 (double x, double y, double z) const
 returns B field
 
const Hep3Vector & fieldMap (const HepPoint3D &xyz) const
 
void fieldMap (double *position, double *bfield)
 
double bx (double x, double y, double z) const
 returns an element of B field
 
double by (double x, double y, double z) const
 
double bz (double x, double y, double z) const
 
double bx (const HepPoint3D &xyz) const
 
double by (const HepPoint3D &xyz) const
 
double 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.
 
virtual ~Bfield (void)
 
 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 58 of file KalFitAlg/KalFitAlg-00-08-07/src/coil/Bfield.cxx.

58 {
59 std::cout << std::endl;
60 std::cout << "***********************************************" << std::endl;
61 std::cout << " Bfield class MAP ID = " << imap << std::endl;
62 std::cout << " #### R < 174 cm, -152 < Z < 246 cm #### " << std::endl;
63 std::cout << " C++ version 1.00 " << std::endl;
64 std::cout << "***********************************************" << std::endl;
65
66 const double uniformBz[10] = {0, 15, 14.5, 14, 13, 12.5, 12, 11, 10, 15.5};
67
68 //...initialization
69 for(int i=0; i<175; i++)
70 for(int j=0; j<399; j++) {
71 _Bz[i][j] = 0;
72 _Br[i][j] = 0;
73 _Bz[i][j] = 0;
74 if(i<101 && j<163) {
75 _BzQR[i][j] = 0;
76 _BrQR[i][j] = 0;
77 _BphiQR[i][j] = 0;
78 }
79 }
80 for(int i=0; i<17; i++)
81 for(int j=0; j<51; j++)
82 for(int k=0; k<52; k++) {
83 _BzQL[i][j][k] = 0;
84 _BrQL[i][j][k] = 0;
85 _BphiQL[i][j][k] =0;
86 }
87
88 //...
89 _fieldID = imap;
90
91 //...read B field map
92
93 if(imap<10){
94 //
95 // uniform B field map
96 //
97 m_Bx = 0.;
98 m_By = 0.;
99 m_Bz = uniformBz[imap];
100 m_Bfld.setX((double) m_Bx);
101 m_Bfld.setY((double) m_By);
102 m_Bfld.setZ((double) m_Bz);
103 std::cout << "Bfield class >> creating uniform B field with id = " << imap;
104 std::cout << ", (Bx,By,Bz) = "<<m_Bfld<<std::endl;
105 } else {
106 //
107 // non-uniform B field map
108 //
109 std::cout << "Bfield class >> loading non-uniform B field map" << std::endl;
110/*wangdy
111 geo_coil_readmap_(&imap, _Bz, _Br, _Bphi);
112 if( _fieldID == 21 ) {
113 std::cout << "Bfield class >> loading QCS" << std::endl;
114 geo_coil_readqcsrmap_(_BzQR,_BrQR, _BphiQR);
115 geo_coil_readqcslmap_(_BzQL,_BrQL, _BphiQL);
116 }
117 */
118 updateCache(0., 0., 0.);
119 }
120 std::cout << std::endl;
121
122}

Referenced by getBfield().

◆ ~Bfield()

virtual Bfield::~Bfield ( void )
inlineprotectedvirtual

Definition at line 52 of file KalFitAlg/KalFitAlg-00-08-07/KalFitAlg/coil/Bfield.h.

52{};

◆ 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 194 of file KalFitAlg/KalFitAlg-00-08-07/src/coil/Bfield.cxx.

194 {
195
196 if(_fieldID > 10){
197 double x = xyz.x();
198 double y = xyz.y();
199 double z = xyz.z();
200 if(x != m_x || y != m_y || z != m_z) updateCache(x, y, z);
201 }
202
203 return m_Bx;
204}
Double_t x[10]
double y[1000]

◆ bx() [2/6]

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

◆ bx() [3/6]

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

◆ bx() [4/6]

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

returns an element of B field

Definition at line 164 of file KalFitAlg/KalFitAlg-00-08-07/src/coil/Bfield.cxx.

164 {
165
166 if(_fieldID > 10){
167 if(x != m_x || y != m_y || z != m_z) updateCache(x, y, z);
168 }
169
170 return m_Bx;
171}

◆ bx() [5/6]

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

returns an element of B field

Definition at line 132 of file TrackUtil/TrackUtil-00-00-08/src/Bfield.cxx.

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

◆ 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 207 of file KalFitAlg/KalFitAlg-00-08-07/src/coil/Bfield.cxx.

207 {
208
209 if(_fieldID > 10){
210 double x = xyz.x();
211 double y = xyz.y();
212 double z = xyz.z();
213 if(x != m_x || y != m_y || z != m_z) updateCache(x, y, z);
214 }
215
216 return m_By;
217}

◆ by() [2/6]

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

◆ by() [3/6]

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

◆ by() [4/6]

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

Definition at line 174 of file KalFitAlg/KalFitAlg-00-08-07/src/coil/Bfield.cxx.

174 {
175
176 if(_fieldID > 10){
177 if(x != m_x || y != m_y || z != m_z) updateCache(x, y, z);
178 }
179
180 return m_By;
181}

◆ by() [5/6]

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

Definition at line 142 of file TrackUtil/TrackUtil-00-00-08/src/Bfield.cxx.

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

◆ 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 220 of file KalFitAlg/KalFitAlg-00-08-07/src/coil/Bfield.cxx.

220 {
221
222 if(_fieldID > 10){
223 double x = xyz.x();
224 double y = xyz.y();
225 double z = xyz.z();
226 if(x != m_x || y != m_y || z != m_z) updateCache(x, y, z);
227 }
228 return m_Bz;
229}

◆ bz() [2/6]

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

◆ bz() [3/6]

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

◆ bz() [4/6]

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

Definition at line 184 of file KalFitAlg/KalFitAlg-00-08-07/src/coil/Bfield.cxx.

184 {
185
186 if(_fieldID > 10){
187 if(x != m_x || y != m_y || z != m_z) updateCache(x, y, z);
188 }
189
190 return m_Bz;
191}

◆ bz() [5/6]

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

Definition at line 152 of file TrackUtil/TrackUtil-00-00-08/src/Bfield.cxx.

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

◆ 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 57 of file KalFitAlg/KalFitAlg-00-08-07/KalFitAlg/coil/Bfield.h.

57{return _fieldID;}

◆ fieldID() [2/3]

int Bfield::fieldID ( void ) const
inline

returns B field Map ID

Definition at line 49 of file TrackUtil/TrackUtil-00-00-08/TrackUtil/Bfield.h.

49{return _fieldID;}

◆ fieldID() [3/3]

int Bfield::fieldID ( void ) const
inline

returns B field Map ID

Definition at line 49 of file TrkReco/TrkReco-00-09-02/TrkReco/Bfield.h.

49{return _fieldID;}

◆ fieldMap() [1/9]

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

Definition at line 137 of file KalFitAlg/KalFitAlg-00-08-07/src/coil/Bfield.cxx.

137 {
138
139 if(_fieldID > 10){
140 double x = xyz.x();
141 double y = xyz.y();
142 double z = xyz.z();
143 if(x != m_x || y != m_y || z != m_z) updateCache(x, y, z);
144 }
145
146 return m_Bfld;
147}

◆ 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 ( double * position,
double * bfield )

Definition at line 150 of file KalFitAlg/KalFitAlg-00-08-07/src/coil/Bfield.cxx.

150 {
151 if(_fieldID > 10){
152 double x = position[0];
153 double y = position[1];
154 double z = position[2];
155 if(x != m_x || y != m_y || z != m_z) updateCache(x, y, z);
156 }
157 field[0] = m_Bx;
158 field[1] = m_By;
159 field[2] = m_Bz;
160 return;
161}

◆ fieldMap() [5/9]

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

returns B field

Definition at line 127 of file KalFitAlg/KalFitAlg-00-08-07/src/coil/Bfield.cxx.

127 {
128
129 if(_fieldID > 10){
130 if(x != m_x || y != m_y || z != m_z) updateCache(x, y, z);
131 }
132
133 return m_Bfld;
134}

Referenced by get_bfield_().

◆ fieldMap() [6/9]

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

Definition at line 118 of file TrackUtil/TrackUtil-00-00-08/src/Bfield.cxx.

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

◆ fieldMap() [7/9]

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

◆ fieldMap() [8/9]

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

returns B field

Definition at line 95 of file TrackUtil/TrackUtil-00-00-08/src/Bfield.cxx.

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

◆ 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 52 of file KalFitAlg/KalFitAlg-00-08-07/src/coil/Bfield.cxx.

52 {
53 if (! _field[imap]) _field[imap] = new Bfield(imap);
54 return _field[imap];
55}
Bfield(int)
Constructor, Destructor.

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

◆ getBfield() [2/3]

static Bfield * Bfield::getBfield ( int )
static

returns Bfield object.

◆ getBfield() [3/3]

static Bfield * Bfield::getBfield ( int )
static

returns Bfield object.


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