Bayeux  3.4.1
Core Foundation library for SuperNEMO
linear_combination_field.h
Go to the documentation of this file.
1 /* Author(s): Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2012-04-26
4  * Last modified: 2015-04-19
5  *
6  * License:
7  *
8  * Description:
9  *
10  * Uniform electric field
11  *
12  * History:
13  *
14  */
15 
16 #ifndef EMFIELD_LINEAR_COMBINATION_FIELD_H
17 #define EMFIELD_LINEAR_COMBINATION_FIELD_H 1
18 
19 // Standard library:
20 #include <vector>
21 #include <map>
22 
23 // This project:
25 
26 namespace emfield {
27 
30  {
31  public:
32 
35  {
36  std::string label;
38  double weight;
41  };
42 
43  typedef std::map<std::string,combined_field_entry> combined_field_dict_type;
44 
46  linear_combination_field(uint32_t = 0);
47 
49  virtual ~linear_combination_field();
50 
52  virtual void initialize(const ::datatools::properties &,
55 
57  virtual void reset();
58 
61  double time_,
62  ::geomtools::vector_3d & electric_field_) const;
63 
66  double time_,
67  geomtools::vector_3d & magnetic_field_) const;
68 
70  void add_combined_field (const std::string & label_,
72  double weight_ = 1.0,
73  bool force_combined_ = false);
74 
76  virtual void tree_dump(std::ostream & out_ = std::clog,
77  const std::string & title_ = "",
78  const std::string & indent_ = "",
79  bool inherit_ = false) const;
80 
81  private:
82 
83  combined_field_dict_type _combined_fields_;
84 
85  // Macro to automate the registration of the EM field :
87 
88  };
89 
90 } // end of namespace emfield
91 
92 #endif // EMFIELD_LINEAR_COMBINATION_FIELD_H
93 
94 // Local Variables: --
95 // mode: c++ --
96 // c-file-style: "gnu" --
97 // tab-width: 2 --
98 // End: --
#define EMFIELD_REGISTRATION_INTERFACE(EMFIELD_CLASS_NAME)
Definition: electromagnetic_field_macros.h:157
Class representing linear combination of many EM fields.
Definition: linear_combination_field.h:29
virtual void initialize(const ::datatools::properties &, ::datatools::service_manager &, ::emfield::base_electromagnetic_field::field_dict_type &)
Initialization.
combined_field_entry()
linear_combination_field(uint32_t=0)
Default constructor.
std::map< std::string, handle_type > field_dict_type
Definition: base_electromagnetic_field.h:49
double weight
Weight associated to the field.
Definition: linear_combination_field.h:38
std::map< std::string, combined_field_entry > combined_field_dict_type
Definition: linear_combination_field.h:43
Internal class for linear_combination_field.
Definition: linear_combination_field.h:34
std::string label
Label of the field.
Definition: linear_combination_field.h:36
~combined_field_entry()
Abstract base class for all electromagnetic field.
Definition: base_electromagnetic_field.h:43
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
Top-level namespace of the Bayeux/emfield module library.
Definition: base_electromagnetic_field.h:40
virtual ~linear_combination_field()
Destructor.
CLHEP::Hep3Vector vector_3d
Alias for the CLHEP 3D-vector class.
Definition: clhep.h:63
base_electromagnetic_field::handle_type field_handle
Handle to the field.
Definition: linear_combination_field.h:37
void add_combined_field(const std::string &label_, base_electromagnetic_field::handle_type &field_handle_, double weight_=1.0, bool force_combined_=false)
Add a combined field.
virtual int compute_magnetic_field(const ::geomtools::vector_3d &position_, double time_, geomtools::vector_3d &magnetic_field_) const
Compute magnetic field.
virtual int compute_electric_field(const ::geomtools::vector_3d &position_, double time_, ::geomtools::vector_3d &electric_field_) const
Compute electric field.
Service management class.
Definition: service_manager.h:57