DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
Geant4Field.h
Go to the documentation of this file.
1 //==========================================================================
2 // AIDA Detector description implementation
3 //--------------------------------------------------------------------------
4 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
5 // All rights reserved.
6 //
7 // For the licensing terms see $DD4hepINSTALL/LICENSE.
8 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
9 //
10 // Author : M.Frank
11 //
12 //==========================================================================
13 
14 #ifndef DDG4_GEANT4FIELD_H
15 #define DDG4_GEANT4FIELD_H
16 
17 // Framework include files
18 #include <DD4hep/Detector.h>
19 
20 // Geant 4 include files
21 #include <G4ElectroMagneticField.hh>
22 #include <G4MagneticField.hh>
23 
25 namespace dd4hep {
26 
28  namespace sim {
29 
30  // Forward declarations
31  class Geant4Field;
32 
34 
39  class Geant4Field : public G4MagneticField {
40  protected:
43 
44  public:
46  Geant4Field(OverlayedField field) : m_field(field) { }
48  virtual ~Geant4Field() { }
50  virtual void GetFieldValue(const double pos[4], double *arr) const override;
52  virtual G4bool DoesFieldChangeEnergy() const override;
53  };
54 
55  } // End namespace sim
56 } // End namespace dd4hep
57 #endif // DDG4_GEANT4FIELD_H
Detector.h
dd4hep::sim::Geant4Field
Mediator class to allow Geant4 accessing magnetic fields defined in dd4hep.
Definition: Geant4Field.h:39
dd4hep::sim::Geant4Field::DoesFieldChangeEnergy
virtual G4bool DoesFieldChangeEnergy() const override
Does field change energy ?
Definition: Geant4Field.cpp:22
dd4hep::sim::Geant4Field::m_field
OverlayedField m_field
Reference to the detector description field.
Definition: Geant4Field.h:42
dd4hep::OverlayedField
Class describing a field overlay with several sources.
Definition: Fields.h:138
dd4hep::sim::Geant4Field::Geant4Field
Geant4Field(OverlayedField field)
Constructor. The sensitive detector element is identified by the detector name.
Definition: Geant4Field.h:46
dd4hep::sim::Geant4Field::GetFieldValue
virtual void GetFieldValue(const double pos[4], double *arr) const override
Access field values at a given point.
Definition: Geant4Field.cpp:26
dd4hep::sim::Geant4Field::~Geant4Field
virtual ~Geant4Field()
Standard destructor.
Definition: Geant4Field.h:48
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
G4MagneticField
Class of the Geant4 toolkit. See http://www-geant4.kek.jp/Reference.
Definition: Geant4Classes.h:11