Bayeux  3.4.1
Core Foundation library for SuperNEMO
oscillating_field.h
Go to the documentation of this file.
1 /* Author (s): Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2012-05-22
4  * Last modified: 2015-03-07
5  *
6  * License:
7  *
8  * Description:
9  *
10  * Placement field
11  *
12  * History:
13  *
14  */
15 
16 #ifndef EMFIELD_OSCILLATING_FIELD_H
17 #define EMFIELD_OSCILLATING_FIELD_H 1
18 
19 // Third party:
20 // - Bayeux/geomtools:
21 #include <geomtools/placement.h>
22 
23 // This project:
25 
26 namespace emfield {
27 
45  {
46  public:
47 
53  };
54 
56  oscillating_field(uint32_t = 0);
57 
59  virtual ~oscillating_field();
60 
62  virtual void initialize(const ::datatools::properties &,
65 
67  virtual void reset();
68 
71  double time_,
72  ::geomtools::vector_3d & electric_field_) const;
73 
76  double time_,
77  geomtools::vector_3d & magnetic_field_) const;
78 
80 
81  bool is_cosine_mode() const;
82 
83  bool is_sine_mode() const;
84 
85  double get_frequency () const;
86 
87  double get_period () const;
88 
89  double get_phase () const;
90 
91  double get_scale () const;
92 
93  double get_pedestal () const;
94 
95  void set_frequency (double);
96 
97  void set_phase (double);
98 
99  void set_scale (double);
100 
101  void set_pedestal (double);
102 
104 
106  virtual void tree_dump (std::ostream & out_ = std::clog,
107  const std::string & title_ = "",
108  const std::string & indent_ = "",
109  bool inherit_ = false) const;
110 
111  protected:
112 
113  void _set_defaults();
114 
115  double _get_coefficient(double time_) const;
116 
117  private:
118 
120  mode_sin_cos_type _sin_cos_mode_;
121  double _frequency_;
122  double _phase_;
123  double _pedestal_;
124  double _scale_;
125 
126  // Macro to automate the registration of the EM field :
128 
129  };
130 
131 } // end of namespace emfield
132 
133 #endif // EMFIELD_OSCILLATING_FIELD_H
134 
135 // Local Variables: --
136 // mode: c++ --
137 // c-file-style: "gnu" --
138 // tab-width: 2 --
139 // End: --
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
double get_frequency() const
#define EMFIELD_REGISTRATION_INTERFACE(EMFIELD_CLASS_NAME)
Definition: electromagnetic_field_macros.h:157
void set_field(base_electromagnetic_field::handle_type &)
oscillating_field(uint32_t=0)
Default constructor.
void set_sine_cosine_mode(mode_sin_cos_type)
virtual ~oscillating_field()
Destructor.
Class representing a weighted electric/magnetic field with some oscillating coefficient.
Definition: oscillating_field.h:44
Sine mode.
Definition: oscillating_field.h:51
double get_pedestal() const
std::map< std::string, handle_type > field_dict_type
Definition: base_electromagnetic_field.h:49
virtual int compute_magnetic_field(const ::geomtools::vector_3d &position_, double time_, geomtools::vector_3d &magnetic_field_) const
Compute magnetic field.
Abstract base class for all electromagnetic field.
Definition: base_electromagnetic_field.h:43
Cosine mode.
Definition: oscillating_field.h:50
Top-level namespace of the Bayeux/emfield module library.
Definition: base_electromagnetic_field.h:40
virtual int compute_electric_field(const ::geomtools::vector_3d &position_, double time_, ::geomtools::vector_3d &electric_field_) const
Compute electric field.
CLHEP::Hep3Vector vector_3d
Alias for the CLHEP 3D-vector class.
Definition: clhep.h:63
Invalid sine/cosine mode.
Definition: oscillating_field.h:49
double _get_coefficient(double time_) const
virtual void initialize(const ::datatools::properties &, ::datatools::service_manager &, ::emfield::base_electromagnetic_field::field_dict_type &)
Initialization.
Default mode.
Definition: oscillating_field.h:52
mode_sin_cos_type
Definition: oscillating_field.h:48
Service management class.
Definition: service_manager.h:57
virtual void reset()
Reset.