EDepSimUniformField.hh
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 // $Id$
28 //
29 //
30 // class EDepSim::UniformElectricField
31 //
32 // Class description:
33 //
34 // Class for creation of Uniform electric Magnetic Field.
35 
36 // History:
37 // - 30.01.97 V.Grichine, Created.
38 // - 15.03.17 C.McGrew adapted for EDepSim
39 // - 26.05.20 A.Cudd adapted for arbitrary fields
40 //
41 // -------------------------------------------------------------------
42 
43 #ifndef G4UNIFORMELECTRICFIELD_HH
44 #define G4UNIFORMELECTRICFIELD_HH
45 
46 #include "G4Types.hh"
47 #include "G4ThreeVector.hh"
48 #include "G4ElectricField.hh"
49 
50 namespace EDepSim {class UniformField;}
51 
52 class EDepSim::UniformField : public G4ElectricField
53 {
54  public:
55 
56  UniformField();
57 
58  /// Define a uniform magnetic field. The electric field will be set to
59  /// zero. This is equivalent to G4UniformMagneticField().
60  UniformField(const G4ThreeVector bField);
61 
62  /// Define a uniform magnetic and electric field.
63  UniformField(const G4ThreeVector bField, const G4ThreeVector eField);
64 
65  virtual ~UniformField() ;
66 
67  // Copy constructor and assignment operator
68  UniformField(const UniformField &p);
70 
71  /// Provide the field value at a point [x,y,z,t]. The field follows the
72  /// G4 standard so that the magnetic field is in field[0], field[1], and
73  /// field[2] while the electric field is in field[3], field[3], and
74  /// field[5].
75  virtual void GetFieldValue(const G4double pos[4], G4double *field) const;
76 
77  virtual void SetBField(const G4ThreeVector bField);
78  virtual void SetEField(const G4ThreeVector eField);
79 
80  private:
81 
82  /// The field components follows the G4 standard so that the magnetic
83  /// field is in [0], [1], and [2] while the electric field is in [3], [4],
84  /// and [5].
85  G4double fFieldComponents[6] ;
86 };
87 
88 #endif
Construct a module from components.
Definition: TG4HitSegment.h:10
virtual void SetBField(const G4ThreeVector bField)
p
Definition: test.py:223
virtual void GetFieldValue(const G4double pos[4], G4double *field) const
virtual void SetEField(const G4ThreeVector eField)
UniformField & operator=(const UniformField &p)