EDepSimArbEMField.hh
Go to the documentation of this file.
1 // License and Disclaimer
2 //
3 // For use with software authored by the Geant4 Collaboration
4 //
5 // MIT License
6 //
7 // Copyright (c) 2020 Andrew Cudd
8 //
9 // Permission is hereby granted, free of charge, to any person obtaining a
10 // copy of this software and associated documentation files (the "Software"),
11 // to deal in the Software without restriction, including without limitation
12 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 // and/or sell copies of the Software, and to permit persons to whom the
14 // Software is furnished to do so, subject to the following conditions:
15 //
16 // The above copyright notice and this permission notice shall be included in
17 // all copies or substantial portions of the Software.
18 //
19 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 // DEALINGS IN THE SOFTWARE.
26 //
27 //
28 // class EDepSim::ArbEMField
29 //
30 // Class description:
31 //
32 // Class for storing and handling an arbitrary EM field.
33 //
34 // History:
35 // - 2020.04.14 A.Cudd created
36 // - 2020.07.28 C.McGrew updated license with permission of A.Cudd
37 //
38 // -------------------------------------------------------------------
39 
40 #ifndef EDEPSIMARBEMFIELD_H
41 #define EDEPSIMARBEMFIELD_H
42 
43 #include "G4Types.hh"
44 #include "G4ElectroMagneticField.hh"
45 
46 namespace EDepSim { class ArbEMField; }
47 
48 class EDepSim::ArbEMField : public G4ElectroMagneticField
49 {
50  public:
51  ArbEMField();
52  ArbEMField(G4Field* efield_in, G4Field* bfield_in);
53 
54  ArbEMField(const ArbEMField& cpy);
55  ArbEMField& operator=(const ArbEMField& rhs);
56 
57  virtual ~ArbEMField();
58 
59  virtual void GetFieldValue(const G4double pos[4], G4double *field) const;
60  virtual G4bool DoesFieldChangeEnergy() const { return true; };
61 
62  void SetEField(G4Field* efield_in) { efield = efield_in; };
63  void SetBField(G4Field* bfield_in) { bfield = bfield_in; };
64 
65  private:
66  G4Field* efield;
67  G4Field* bfield;
68 };
69 
70 #endif
virtual G4bool DoesFieldChangeEnergy() const
ArbEMField & operator=(const ArbEMField &rhs)
void SetBField(G4Field *bfield_in)
void SetEField(G4Field *efield_in)
Construct a module from components.
Definition: TG4HitSegment.h:10
virtual void GetFieldValue(const G4double pos[4], G4double *field) const