Geant4 VMC
Version 6.8
Toggle main menu visibility
Loading...
Searching...
No Matches
source
geometry
src
TG4MagneticField.cxx
Go to the documentation of this file.
1
//------------------------------------------------
2
// The Geant4 Virtual Monte Carlo package
3
// Copyright (C) 2007 - 2014 Ivana Hrivnacova
4
// All rights reserved.
5
//
6
// For the licensing terms see geant4_vmc/LICENSE.
7
// Contact: root-vmc@cern.ch
8
//-------------------------------------------------
9
14
15
#include "
TG4MagneticField.h
"
16
#include "
TG4G3Units.h
"
17
18
#include <TVirtualMagField.h>
19
20
//_____________________________________________________________________________
21
TG4MagneticField::TG4MagneticField
(TVirtualMagField* magField)
22
:
G4MagneticField
(),
fVirtualMagField
(magField)
23
{
25
}
26
27
//_____________________________________________________________________________
28
TG4MagneticField::~TG4MagneticField
()
29
{
31
}
32
33
//
34
// public methods
35
//
36
37
//_____________________________________________________________________________
38
void
TG4MagneticField::GetFieldValue
(
39
const
G4double point[3], G4double* bfield)
const
40
{
42
43
// Set units
44
const
G4double g3point[3] = { point[0] *
TG4G3Units::InverseLength
(),
45
point[1] *
TG4G3Units::InverseLength
(), point[2] *
TG4G3Units::InverseLength
() };
46
47
// Call user field
48
fVirtualMagField
->Field(g3point, bfield);
49
50
// Set units
51
for
(G4int i = 0; i < 3; i++) bfield[i] = bfield[i] *
TG4G3Units::Field
();
52
}
TG4G3Units.h
Definition of the TG4G3Units class.
TG4MagneticField.h
Definition of the TG4MagneticField class.
G4MagneticField
TG4G3Units::Field
static G4double Field()
Definition
TG4G3Units.h:129
TG4G3Units::InverseLength
static G4double InverseLength()
Definition
TG4G3Units.h:135
TG4MagneticField::fVirtualMagField
TVirtualMagField * fVirtualMagField
The associated TGeo magnetic field.
Definition
TG4MagneticField.h:41
TG4MagneticField::GetFieldValue
virtual void GetFieldValue(const G4double point[3], G4double *bfield) const
Definition
TG4MagneticField.cxx:38
TG4MagneticField::~TG4MagneticField
virtual ~TG4MagneticField()
Definition
TG4MagneticField.cxx:28
TG4MagneticField::TG4MagneticField
TG4MagneticField(TVirtualMagField *magField)
Definition
TG4MagneticField.cxx:21
Generated on
for Geant4 VMC by
1.17.0