|
DD4hep
1.30.0
Detector Description Toolkit for High Energy Physics
|
Go to the documentation of this file.
13 #ifndef DD4HEP_FIELDS_H
14 #define DD4HEP_FIELDS_H
45 typedef std::map<std::string, std::map<std::string, std::string> >
Properties;
100 return data<Object>()->field_type;
104 const char*
type()
const;
116 void value(
const double* pos,
double* val)
const;
181 return data<Object>()->field_type;
195 double field[3] = { 0e0, 0e0, 0e0 };
197 return {field[0], field[1], field[2]};
210 double field[3] = { 0e0, 0e0, 0e0 };
212 return { field[0], field[1], field[2] };
225 double field[3] = { 0e0, 0e0, 0e0 };
227 return { field[0], field[1], field[2] };
232 double fld[3] = { 0e0, 0e0, 0e0 };
234 field = { fld[0], fld[1], fld[2] };
239 field[0] = field[1] = field[2] = 0.0;
254 double fld[3] = { 0e0, 0e0, 0e0 };
256 field = { fld[0], fld[1], fld[2] };
261 double field[3] = { 0e0, 0e0, 0e0 };
263 return { field[0], field[1], field[2] };
278 #endif // DD4HEP_FIELDS_H
void combinedElectric(const Position &pos, double *field) const
Returns the 3 electric field components (x, y, z) if many components are present.
bool changesEnergy() const
Does the field change the energy of charged particles?
std::map< std::string, std::string > PropertyValues
void magneticField(const double *pos, Direction &field) const
Returns the 3 magnetic field components (x, y, z).
bool isValid() const
Check the validity of the object held by the handle.
Internal data class shared by all handles of a given type.
Handle: a templated class like a shared pointer, which allows specialized access to tgeometry objects...
void add(CartesianField field)
Add a new field component.
void combinedMagnetic(const double *pos, double *field) const
Returns the 3 magnetic field components (x, y, z) if many components are present.
std::vector< double > Coefficents
Utility definition for concrete implementations.
const char * name() const
Access the object name (or "" if not supported by the object)
Direction combinedElectric(const Position &pos) const
Returns the 3 electric field components (x, y, z) if many components are present.
Properties & properties() const
Access to properties container.
int fieldType() const
Access the field type.
OverlayedField(const Handle< Q > &e)
Constructor to be used when reading the already parsed DOM tree.
Class describing a field overlay with several sources.
CartesianField()=default
Default constructor.
virtual ~Object()
Default destructor.
void combinedMagnetic(const Position &pos, double *field) const
Returns the 3 magnetic field components (x, y, z) if many components are present.
void electromagneticField(const double *pos, double *val) const
Returns the 3 electric (val[0]-val[2]) and magnetic field components (val[3]-val[5]).
NamedObject()=default
Standard constructor.
Properties properties
Field extensions.
void electricField(const double *pos, double *field) const
Returns the 3 electric field components (x, y, z).
std::map< std::string, std::map< std::string, std::string > > Properties
void electricField(const Position &pos, double *field) const
Returns the 3 electric field components (x, y, z).
void electricField(const Position &pos, Direction &field) const
Returns the 3 electric field components (x, y, z).
Object()
Default constructor.
int fieldType() const
Access the field type.
std::vector< CartesianField > electric_components
Direction electricField(const Position &pos) const
Returns the 3 electric field components (x, y, z) at a given position.
CartesianField & operator=(const CartesianField &f)=default
Assignment operator.
Properties & properties() const
Access to properties container.
Internal data class shared by all handles.
virtual void fieldComponents(const double *pos, double *field)=0
void value(const Position &pos, Direction &field) const
Returns the 3 field components (x, y, z).
ROOT::Math::XYZVector Position
void magneticField(const double *pos, double *field) const
Returns the 3 magnetic field components (x, y, z).
int field_type
Field type.
void combinedElectric(const double *pos, double *field) const
Returns the 3 electric field components (x, y, z) if many components are present.
Object()
Default constructor.
CartesianField(const Handle< Q > &e)
Constructor to be used when reading the already parsed DOM tree.
Namespace for the AIDA detector description toolkit.
Implementation of a named object.
OverlayedField()=default
Default constructor.
std::vector< CartesianField > magnetic_components
bool changesEnergy() const
Does the field change the energy of charged particles?
Direction magneticField(const Position &pos) const
Returns the 3 electric field components (x, y, z) at a given position.
void magneticField(const Position &pos, double *field) const
Returns the 3 magnetic field components (x, y, z).
std::map< std::string, PropertyValues > Properties
Internal data class shared by all handles of a given type.
Properties properties
Field extensions.
CartesianField(const CartesianField &e)=default
Constructor to be used when reading the already parsed DOM tree.
void electromagneticField(const Position &pos, double *field) const
Returns the 3 electric (val[0]-val[2]) and magnetic field components (val[3]-val[5]).
const char * type() const
Access the field type (string)
virtual ~Object()
Default destructor.
Direction combinedMagnetic(const Position &pos) const
Returns the 3 magnetic field components (x, y, z) at a given position.
Base class describing any field with 3D cartesian vectors for the field strength.