ACTARSim
ACTAR TPC Simulation Reference Guide
ActarSimUniformEMField.hh
Go to the documentation of this file.
1 // - AUTHOR: Hector Alvarez-Pol 01/2006
2 /******************************************************************
3  * Copyright (C) 2005-2016, Hector Alvarez-Pol *
4  * All rights reserved. *
5  * *
6  * License according to GNU LESSER GPL (see lgpl-3.0.txt). *
7  * For the list of contributors see CREDITS. *
8  ******************************************************************/
9 
10 #ifndef ActarSimUniformEMField_H
11 #define ActarSimUniformEMField_H 1
12 
13 #include "G4ElectroMagneticField.hh"
14 #include "G4ThreeVector.hh"
15 
16 class G4ChordFinder;
17 class G4MagIntegratorStepper;
18 class G4EqMagElectricField;
19 class G4FieldManager;
20 
21 class ActarSimUniformEMField: public G4ElectroMagneticField {
22 private:
23  G4double fieldComponents[6]; ///< The EM field: follows the G4ElectroMagneticField convention
24 
25  G4ChordFinder* theChordFinder; ///< Chord parameter
26  G4MagIntegratorStepper* stepper; ///< Integrator stepper
27  G4EqMagElectricField* equation; ///< Equation
28 
29 public:
31  ActarSimUniformEMField(const G4ThreeVector magFieldVector,
32  const G4ThreeVector elecFieldVector);
35 
37 
38  void SetFieldValue(const G4ThreeVector magFieldVector,
39  const G4ThreeVector elecFieldVector);
40 
41  //Set the field as pure electric or magnetic NOT YET USED...
42  void SetPureElectricFieldValue(G4ThreeVector fieldVector);
43  void SetPureMagneticFieldValue(G4ThreeVector fieldVector);
44 
45  ///This is a virtual function in G4ElectroMagneticField to be instanciated here
46  ///Return as Bfield[0], [1], [2] the magnetic field x, y & z components
47  /// and as Bfield[3], [4], [5] the electric field x, y & z components
48  void GetFieldValue(const G4double thePoint[4], G4double* theField) const;
49 
50  G4ThreeVector GetMagneticFieldValue();
51  G4ThreeVector GetElectricFieldValue();
52 
53  G4bool DoesFieldChangeEnergy() const {return true;}
54  //does not work in other way???
55 
56  // void DefineUnits();
57 protected:
58  /// Find the global Field Manager
59  G4FieldManager* GetGlobalFieldManager(); // static
60 };
61 #endif
ActarSimUniformEMField operator=(const ActarSimUniformEMField &p)
Operator =.
G4FieldManager * GetGlobalFieldManager()
Find the global Field Manager.
void SetPureElectricFieldValue(G4ThreeVector fieldVector)
Set the value of the Electric Field to fieldVector.
G4ThreeVector GetMagneticFieldValue()
Returns the uniform magnetic field value.
void SetPureMagneticFieldValue(G4ThreeVector fieldVector)
Set the value of the Magnetic Field to fieldVector.
G4double fieldComponents[6]
The EM field: follows the G4ElectroMagneticField convention.
G4ThreeVector GetElectricFieldValue()
Returns the uniform electric field value.
G4EqMagElectricField * equation
Equation.
G4bool DoesFieldChangeEnergy() const
ActarSimUniformEMField()
Default zero field constructor.
void GetFieldValue(const G4double thePoint[4], G4double *theField) const
G4ChordFinder * theChordFinder
Chord parameter.
G4MagIntegratorStepper * stepper
Integrator stepper.
void SetFieldValue(const G4ThreeVector magFieldVector, const G4ThreeVector elecFieldVector)
Set the value of the Global Field to fieldVector along Y.