Public Member Functions | Private Attributes | List of all members
EDepSim::ArbEMField Class Reference

#include <EDepSimArbEMField.hh>

Inheritance diagram for EDepSim::ArbEMField:

Public Member Functions

 ArbEMField ()
 
 ArbEMField (G4Field *efield_in, G4Field *bfield_in)
 
 ArbEMField (const ArbEMField &cpy)
 
ArbEMFieldoperator= (const ArbEMField &rhs)
 
virtual ~ArbEMField ()
 
virtual void GetFieldValue (const G4double pos[4], G4double *field) const
 
virtual G4bool DoesFieldChangeEnergy () const
 
void SetEField (G4Field *efield_in)
 
void SetBField (G4Field *bfield_in)
 

Private Attributes

G4Field * efield
 
G4Field * bfield
 

Detailed Description

Definition at line 48 of file EDepSimArbEMField.hh.

Constructor & Destructor Documentation

EDepSim::ArbEMField::ArbEMField ( )

Definition at line 38 of file EDepSimArbEMField.cc.

39  : efield(nullptr)
40  , bfield(nullptr)
41 {
42 }
EDepSim::ArbEMField::ArbEMField ( G4Field *  efield_in,
G4Field *  bfield_in 
)

Definition at line 44 of file EDepSimArbEMField.cc.

45  : efield(efield_in)
46  , bfield(bfield_in)
47 {
48 }
EDepSim::ArbEMField::ArbEMField ( const ArbEMField cpy)

Definition at line 50 of file EDepSimArbEMField.cc.

51  : EDepSim::ArbEMField(cpy.efield, cpy.bfield)
52 {
53  efield = cpy.efield;
54  bfield = cpy.bfield;
55 }
EDepSim::ArbEMField::~ArbEMField ( )
virtual

Definition at line 69 of file EDepSimArbEMField.cc.

70 {
71  delete bfield;
72  delete efield;
73 }

Member Function Documentation

virtual G4bool EDepSim::ArbEMField::DoesFieldChangeEnergy ( ) const
inlinevirtual

Definition at line 60 of file EDepSimArbEMField.hh.

60 { return true; };
void EDepSim::ArbEMField::GetFieldValue ( const G4double  pos[4],
G4double *  field 
) const
virtual

Definition at line 75 of file EDepSimArbEMField.cc.

76 {
77  //GetFieldValue always expects an array with six elements for both the EField
78  //and BField, even if it only fills one of the fields.
79  double tmp_bfield[6] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
80  double tmp_efield[6] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
81 
82  if(bfield != nullptr)
83  bfield->GetFieldValue(pos, tmp_bfield);
84 
85  if(efield != nullptr)
86  efield->GetFieldValue(pos, tmp_efield);
87 
88  //Geant4 convention is the first three elements are Bx, By, Bz
89  //and the next three are Ex, Ey, Ez
90  field[0] = tmp_bfield[0];
91  field[1] = tmp_bfield[1];
92  field[2] = tmp_bfield[2];
93 
94  field[3] = tmp_efield[3];
95  field[4] = tmp_efield[4];
96  field[5] = tmp_efield[5];
97 }
EDepSim::ArbEMField & EDepSim::ArbEMField::operator= ( const ArbEMField rhs)

Definition at line 57 of file EDepSimArbEMField.cc.

58 {
59  if(&rhs == this)
60  return *this;
61  else
62  {
63  efield = rhs.efield;
64  bfield = rhs.bfield;
65  return *this;
66  }
67 }
void EDepSim::ArbEMField::SetBField ( G4Field *  bfield_in)
inline

Definition at line 63 of file EDepSimArbEMField.hh.

63 { bfield = bfield_in; };
void EDepSim::ArbEMField::SetEField ( G4Field *  efield_in)
inline

Definition at line 62 of file EDepSimArbEMField.hh.

62 { efield = efield_in; };

Member Data Documentation

G4Field* EDepSim::ArbEMField::bfield
private

Definition at line 67 of file EDepSimArbEMField.hh.

G4Field* EDepSim::ArbEMField::efield
private

Definition at line 63 of file EDepSimArbEMField.hh.


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