16 #ifndef EMFIELD_BASE_ELECTROMAGNETIC_FIELD_H 17 #define EMFIELD_BASE_ELECTROMAGNETIC_FIELD_H 1 26 #include <boost/cstdint.hpp> 37 class service_manager;
88 const std::string &
get_name()
const;
152 virtual void reset() = 0;
172 virtual void tree_dump(std::ostream & out_ = std::clog,
173 const std::string & title_ =
"",
174 const std::string & indent_ =
"",
175 bool inherit_ =
false)
const;
207 bool _electric_field_;
208 bool _magnetic_field_;
209 bool _electric_field_can_be_combined_;
210 bool _magnetic_field_can_be_combined_;
211 bool _electric_field_is_time_dependent_;
212 bool _magnetic_field_is_time_dependent_;
223 #endif // EMFIELD_BASE_ELECTROMAGNETIC_FIELD_H status_type
Status at field computation.
Definition: base_electromagnetic_field.h:63
Definition: base_electromagnetic_field.h:53
virtual void initialize_standalone(const datatools::properties &setup_)
Standalone initialization, no external resources are needed, only a set of parameters.
datatools::logger::priority get_logging_priority() const
Set the logging priority.
base_electromagnetic_field(uint32_t flags_=0)
Constructor.
virtual void initialize_simple()
Naked initialization.
Definition: base_electromagnetic_field.h:67
void _set_magnetic_field_can_be_combined(bool=true)
virtual int compute_field(char label_, const geomtools::vector_3d &position_, double time_, geomtools::vector_3d &field_) const
Compute the coordinates of the electric or magnetic field at given position and time.
Definition: base_electromagnetic_field.h:57
void set_logging_priority(datatools::logger::priority priority_)
Return the logging priority.
virtual int compute_electric_field(const geomtools::vector_3d &position_, double time_, geomtools::vector_3d &electric_field_) const
Compute the coordinates of the electric field at given position and time.
virtual int compute_magnetic_field(const geomtools::vector_3d &position_, double time_, geomtools::vector_3d &magnetic_field_) const
Compute the coordinates of the magnetic field at given position and time.
void _set_electric_field_can_be_combined(bool=true)
Definition: base_electromagnetic_field.h:56
std::map< std::string, handle_type > field_dict_type
Definition: base_electromagnetic_field.h:49
void set_name(const std::string &)
Set the name of the field.
void set_debug(bool debug_)
Set debug status.
Definition: base_electromagnetic_field.h:59
flag_type
Initialization flags.
Definition: base_electromagnetic_field.h:52
virtual int compute_electromagnetic_field(const geomtools::vector_3d &position_, double time_, geomtools::vector_3d &electric_field_, geomtools::vector_3d &magnetic_field_) const
Compute the coordinates of the electric and magnetic fields at given position and time.
bool electric_field_is_time_dependent() const
Check if the electric field depends on time.
bool magnetic_field_is_time_dependent() const
Check if the magnetic field depends on time.
virtual void initialize_with_service_only(const datatools::properties &setup_, datatools::service_manager &service_manager_)
Initialization using a set of parameters and a service manager.
void _set_magnetic_field_is_time_dependent(bool=true)
void _set_initialized(bool initialized_)
virtual bool position_and_time_are_valid(const geomtools::vector_3d &position_, double time_) const
Check if position and time are valid for this field.
Definition: base_electromagnetic_field.h:54
Abstract base class for all electromagnetic field.
Definition: base_electromagnetic_field.h:43
virtual void initialize_with_dictionary_only(const datatools::properties &setup_, field_dict_type &dictionary_)
Initialization using a set of parameters and an external dictionary of EM fields.
static const char MAGNETIC_FIELD_LABEL
Definition: base_electromagnetic_field.h:73
Definition: base_electromagnetic_field.h:65
Definition: base_electromagnetic_field.h:55
void _parse_basic_parameters(const datatools::properties &setup_, datatools::service_manager &service_manager_, field_dict_type &dictionary_)
virtual std::string get_class_id() const =0
Return the class string identifier.
Definition: base_electromagnetic_field.h:66
bool magnetic_field_can_be_combined() const
Check if the magnetic field can be combined.
void _set_electric_field_is_time_dependent(bool=true)
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
bool is_electric_field() const
Check if the field is an electric field.
Definition: base_electromagnetic_field.h:58
Definition: base_electromagnetic_field.h:68
Top-level namespace of the Bayeux/emfield module library.
Definition: base_electromagnetic_field.h:40
bool is_magnetic_field() const
Check if the field is a magnetic field.
const std::string & get_name() const
Return the name of the field.
bool electric_field_can_be_combined() const
Check if the electric field can be combined.
Definition: base_electromagnetic_field.h:64
void _set_electric_field(bool=true)
void _set_magnetic_field(bool=true)
static const char ELECTRIC_FIELD_LABEL
Definition: base_electromagnetic_field.h:72
virtual ~base_electromagnetic_field()
Destructor.
virtual void initialize(const datatools::properties &setup_, datatools::service_manager &service_manager_, field_dict_type &dictionary_)=0
Main initialization.
virtual void reset()=0
Reset the field.
#define DATATOOLS_FACTORY_SYSTEM_REGISTER_INTERFACE(BaseType)
Declaration of a system (allocator/functor) factory register as a static member of a base class and s...
Definition: factory_macros.h:52
Definition: base_electromagnetic_field.h:69
Macros to automatically generate some parts of the electromagnetic fields interface.
datatools::handle< base_electromagnetic_field > handle_type
Definition: base_electromagnetic_field.h:48
bool is_debug() const
Check debug status.
void _set_defaults()
Set default attributes values.
bool is_initialized() const
Check initialization status.