LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
mag::GlobalMagneticField Class Reference

#include "GlobalMagneticField.h"

Inheritance diagram for mag::GlobalMagneticField:

Public Member Functions

 GlobalMagneticField ()
 
virtual ~GlobalMagneticField ()
 
virtual void GetFieldValue (const G4double Point[4], G4double *Bfield) const
 

Private Attributes

const mag::MagneticFieldService_bFieldHandle
 

Detailed Description

Definition at line 20 of file GlobalMagneticField.h.

Constructor & Destructor Documentation

mag::GlobalMagneticField::GlobalMagneticField ( )
explicit

Definition at line 28 of file GlobalMagneticField.cxx.

29  {
31  _bFieldHandle = &*bField;
32  }
const mag::MagneticFieldService * _bFieldHandle
virtual mag::GlobalMagneticField::~GlobalMagneticField ( )
inlinevirtual

Definition at line 25 of file GlobalMagneticField.h.

References GetFieldValue().

25 {};

Member Function Documentation

void mag::GlobalMagneticField::GetFieldValue ( const G4double  Point[4],
G4double *  Bfield 
) const
virtual

Definition at line 35 of file GlobalMagneticField.cxx.

References mag::MagneticFieldService::provider().

Referenced by ~GlobalMagneticField().

35  {
36 
37  //Check provider units (geant4 uses mm, your framework can use another unit...)
38  const auto *pProvider = _bFieldHandle->provider();
39 
40  G4ThreeVector point(Point[0], Point[1], Point[2]);//should be in mm
41  const G4ThreeVector field = pProvider->FieldAtPoint(point);//should return tesla
42 
43  Bfield[0] = field.x();
44  Bfield[1] = field.y();
45  Bfield[2] = field.z();
46 
47  // std::cout << "Returned field " << Bfield[0] << ", " << Bfield[1] << ", " << Bfield[2] << std::endl;
48 
49  return;
50  }
const mag::MagneticFieldService * _bFieldHandle
virtual const mag::MagneticField * provider() const =0
std::tuple< double, double, const reco::ClusterHit3D * > Point
Definitions used by the VoronoiDiagram algorithm.
Definition: DCEL.h:42

Member Data Documentation

const mag::MagneticFieldService* mag::GlobalMagneticField::_bFieldHandle
private

Definition at line 32 of file GlobalMagneticField.h.


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