BOSS
8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
ExtBesMagneticField.cxx
Go to the documentation of this file.
1
#include "
ExtBesMagneticField.h
"
2
3
#include "GaudiKernel/Bootstrap.h"
4
#include "GaudiKernel/ISvcLocator.h"
5
#include "GaudiKernel/MsgStream.h"
6
#include "GaudiKernel/SmartDataPtr.h"
7
8
#include "G4FieldManager.hh"
9
#include "G4MagneticField.hh"
10
#include "globals.hh"
11
12
#include "CLHEP/Geometry/Point3D.h"
13
#include "CLHEP/Geometry/Vector3D.h"
14
#include "CLHEP/Units/PhysicalConstants.h"
15
16
#ifndef ENABLE_BACKWARDS_COMPATIBILITY
17
typedef
HepGeom::Point3D<double>
HepPoint3D
;
18
#endif
19
#ifndef ENABLE_BACKWARDS_COMPATIBILITY
20
typedef
HepGeom::Vector3D<double>
HepVector3D
;
21
#endif
22
23
using namespace
CLHEP;
24
25
ExtBesMagneticField::ExtBesMagneticField
() {
26
GetFieldManager
()->SetDetectorField(
this
);
27
GetFieldManager
()->CreateChordFinder(
this
);
28
// GetFieldManager()->SetDeltaOneStep(0.5*mm);
29
// GetFieldManager()->SetDeltaIntersection(0.5*mm);
30
ISvcLocator* svcLocator = Gaudi::svcLocator();
31
StatusCode sc = svcLocator->service(
"MagneticFieldSvc"
, m_pIMF );
32
if
( sc != StatusCode::SUCCESS )
33
{ G4cout <<
"Unable to open Magnetic field service"
<< G4endl; }
34
}
35
36
ExtBesMagneticField::~ExtBesMagneticField
() {}
37
38
void
ExtBesMagneticField::GetFieldValue
(
const
double
Point[3],
double
*
Bfield
)
const
{
39
double
x = Point[0];
40
double
y = Point[1];
41
double
z = Point[2];
42
43
HepPoint3D r( x, y, z );
44
HepVector3D
b;
45
46
if
( m_pIMF->ifRealField() ==
true
) m_pIMF->fieldVector( r, b );
47
else
m_pIMF->uniFieldVector( r, b );
48
49
Bfield
[0] = b.x();
50
Bfield
[1] = b.y();
51
Bfield
[2] = b.z();
52
}
53
54
#include "G4TransportationManager.hh"
55
56
G4FieldManager*
ExtBesMagneticField::GetFieldManager
() {
57
return
G4TransportationManager::GetTransportationManager()->GetFieldManager();
58
}
HepVector3D
HepGeom::Vector3D< double > HepVector3D
Definition
Analysis/VertexFit/src/BField.cxx:13
HepPoint3D
HepGeom::Point3D< double > HepPoint3D
Definition
CosmicGenerator.h:36
ExtBesMagneticField.h
Bfield
Definition
InstallArea/x86_64-el9-gcc13-dbg/include/TrackUtil/Bfield.h:35
ExtBesMagneticField::ExtBesMagneticField
ExtBesMagneticField()
Definition
ExtBesMagneticField.cxx:25
ExtBesMagneticField::GetFieldValue
void GetFieldValue(const double Point[3], double *Bfield) const
Definition
ExtBesMagneticField.cxx:38
ExtBesMagneticField::GetFieldManager
G4FieldManager * GetFieldManager()
Definition
ExtBesMagneticField.cxx:56
ExtBesMagneticField::~ExtBesMagneticField
~ExtBesMagneticField()
Definition
ExtBesMagneticField.cxx:36
8.0.0
BOSS_Source
Reconstruction
TrkExtAlg
src
ExtBesMagneticField.cxx
Generated by
1.16.1