DD4hep  1.28.0
Detector Description Toolkit for High Energy Physics
Classes | Public Types | Public Member Functions | List of all members
dd4hep::OverlayedField Class Reference

Class describing a field overlay with several sources. More...

#include <Fields.h>

Inheritance diagram for dd4hep::OverlayedField:
dd4hep::Handle< NamedObject >

Classes

class  Object
 Internal data class shared by all handles. More...
 

Public Types

enum  FieldType { ELECTRIC = CartesianField::ELECTRIC, MAGNETIC = CartesianField::MAGNETIC, OVERLAY = CartesianField::OVERLAY }
 
typedef std::map< std::string, std::string > PropertyValues
 
typedef std::map< std::string, PropertyValuesProperties
 
- Public Types inherited from dd4hep::Handle< NamedObject >
typedef NamedObject Object
 Extern accessible definition of the contained element type. More...
 
typedef Handle< NamedObjectBase
 Self type: used by sub-classes. More...
 

Public Member Functions

 OverlayedField ()=default
 Default constructor. More...
 
template<typename Q >
 OverlayedField (const Handle< Q > &e)
 Constructor to be used when reading the already parsed DOM tree. More...
 
 OverlayedField (const std::string &name)
 Object constructor. More...
 
int fieldType () const
 Access the field type. More...
 
bool changesEnergy () const
 Does the field change the energy of charged particles? More...
 
void add (CartesianField field)
 Add a new field component. More...
 
void combinedElectric (const Position &pos, double *field) const
 Returns the 3 electric field components (x, y, z) if many components are present. More...
 
Direction combinedElectric (const Position &pos) const
 Returns the 3 electric field components (x, y, z) if many components are present. More...
 
void combinedElectric (const double *pos, double *field) const
 Returns the 3 electric field components (x, y, z) if many components are present. More...
 
void combinedMagnetic (const Position &pos, double *field) const
 Returns the 3 magnetic field components (x, y, z) if many components are present. More...
 
Direction combinedMagnetic (const Position &pos) const
 Returns the 3 magnetic field components (x, y, z) at a given position. More...
 
void combinedMagnetic (const double *pos, double *field) const
 Returns the 3 magnetic field components (x, y, z) if many components are present. More...
 
void electricField (const Position &pos, double *field) const
 Returns the 3 electric field components (x, y, z). More...
 
Direction electricField (const Position &pos) const
 Returns the 3 electric field components (x, y, z) at a given position. More...
 
void electricField (const Position &pos, Direction &field) const
 Returns the 3 electric field components (x, y, z). More...
 
void electricField (const double *pos, double *field) const
 Returns the 3 electric field components (x, y, z). More...
 
void magneticField (const Position &pos, double *field) const
 Returns the 3 magnetic field components (x, y, z). More...
 
void magneticField (const double *pos, double *field) const
 Returns the 3 magnetic field components (x, y, z). More...
 
void magneticField (const double *pos, Direction &field) const
 Returns the 3 magnetic field components (x, y, z). More...
 
Direction magneticField (const Position &pos) const
 Returns the 3 electric field components (x, y, z) at a given position. More...
 
void electromagneticField (const Position &pos, double *field) const
 Returns the 3 electric (val[0]-val[2]) and magnetic field components (val[3]-val[5]). More...
 
void electromagneticField (const double *pos, double *val) const
 Returns the 3 electric (val[0]-val[2]) and magnetic field components (val[3]-val[5]). More...
 
Propertiesproperties () const
 Access to properties container. More...
 
- Public Member Functions inherited from dd4hep::Handle< NamedObject >
 Handle ()=default
 Default constructor. More...
 
 Handle (Handle< NamedObject > &&element)=default
 Copy constructor. More...
 
 Handle (const Handle< NamedObject > &element)=default
 Copy constructor. More...
 
 Handle (NamedObject *element)
 Initializing constructor from pointer. More...
 
 Handle (Q *element)
 Initializing constructor from unrelated pointer with type checking. More...
 
 Handle (const Handle< Q > &element)
 Initializing constructor from unrelated handle with type checking. More...
 
Handle< NamedObject > & operator= (Handle< NamedObject > &&element)=default
 Assignment move operator. More...
 
Handle< NamedObject > & operator= (const Handle< NamedObject > &element)=default
 Assignment copy operator. More...
 
bool operator== (const Handle< NamedObject > &element) const
 Boolean operator == used for RB tree insertions. More...
 
bool operator< (const Handle< NamedObject > &element) const
 Boolean operator < used for RB tree insertions. More...
 
bool operator> (const Handle< NamedObject > &element) const
 Boolean operator > used for RB tree insertions. More...
 
bool isValid () const
 Check the validity of the object held by the handle. More...
 
bool operator! () const
 Check the validity of the object held by the handle. More...
 
Handle< NamedObject > & clear ()
 Release the object held by the handle. More...
 
NamedObjectoperator-> () const
 Access the held object using the -> operator. More...
 
 operator NamedObject & () const
 Automatic type conversion to an object references. More...
 
NamedObjectoperator* () const
 Access the held object using the * operator. More...
 
NamedObjectptr () const
 Access to the held object. More...
 
Q * _ptr () const
 Access to an unrelated object type. More...
 
Q * data () const
 Access to an unrelated object type. More...
 
Q & object () const
 Access to an unrelated object type. More...
 
NamedObjectaccess () const
 Checked object access. Throws invalid handle runtime exception if invalid handle. More...
 
const char * name () const
 Access the object name (or "" if not supported by the object) More...
 
const char * name () const
 
const char * name () const
 
void assign (Object *n, const std::string &nam, const std::string &title)
 Assign a new named object. Note: object references must be managed by the user. More...
 
void assign (_Segmentation *s, const std::string &n, const std::string &)
 
void assign (NamedObject *p, const std::string &n, const std::string &t)
 
void destroy ()
 Destroy the underlying object (be careful here: things are not reference counted)! More...
 

Additional Inherited Members

- Static Public Member Functions inherited from dd4hep::Handle< NamedObject >
static void bad_assignment (const std::type_info &from, const std::type_info &to)
 Helper routine called when unrelated types are assigned. More...
 
- Public Attributes inherited from dd4hep::Handle< NamedObject >
NamedObjectm_element
 Single and only data member: Reference to the actual element. More...
 

Detailed Description

Class describing a field overlay with several sources.

Generic structure describing any field type (electric or magnetic) with field components in Cartesian coordinates.

The actual behaviour is solely implemented in the underlying object classes. The overlay field is the sum of several magnetic of electric field components.

The resulting field vectors are computed by the vector addition of the individual components.

Author
M.Frank
Version
1.0

Definition at line 138 of file Fields.h.

Member Typedef Documentation

◆ Properties

typedef std::map<std::string, PropertyValues> dd4hep::OverlayedField::Properties

Definition at line 146 of file Fields.h.

◆ PropertyValues

typedef std::map<std::string, std::string> dd4hep::OverlayedField::PropertyValues

Definition at line 145 of file Fields.h.

Member Enumeration Documentation

◆ FieldType

Enumerator
ELECTRIC 
MAGNETIC 
OVERLAY 

Definition at line 140 of file Fields.h.

Constructor & Destructor Documentation

◆ OverlayedField() [1/3]

dd4hep::OverlayedField::OverlayedField ( )
default

Default constructor.

◆ OverlayedField() [2/3]

template<typename Q >
dd4hep::OverlayedField::OverlayedField ( const Handle< Q > &  e)
inline

Constructor to be used when reading the already parsed DOM tree.

Definition at line 174 of file Fields.h.

◆ OverlayedField() [3/3]

OverlayedField::OverlayedField ( const std::string &  name)

Object constructor.

Definition at line 92 of file Fields.cpp.

Member Function Documentation

◆ add()

void OverlayedField::add ( CartesianField  field)

Add a new field component.

Definition at line 110 of file Fields.cpp.

◆ changesEnergy()

bool OverlayedField::changesEnergy ( ) const

Does the field change the energy of charged particles?

Definition at line 104 of file Fields.cpp.

◆ combinedElectric() [1/3]

void dd4hep::OverlayedField::combinedElectric ( const double *  pos,
double *  field 
) const
inline

Returns the 3 electric field components (x, y, z) if many components are present.

Definition at line 201 of file Fields.h.

◆ combinedElectric() [2/3]

Direction dd4hep::OverlayedField::combinedElectric ( const Position pos) const
inline

Returns the 3 electric field components (x, y, z) if many components are present.

Definition at line 194 of file Fields.h.

◆ combinedElectric() [3/3]

void OverlayedField::combinedElectric ( const Position pos,
double *  field 
) const

Returns the 3 electric field components (x, y, z) if many components are present.

Returns the 3 electric field components (x, y, z).

Definition at line 155 of file Fields.cpp.

◆ combinedMagnetic() [1/3]

void dd4hep::OverlayedField::combinedMagnetic ( const double *  pos,
double *  field 
) const
inline

Returns the 3 magnetic field components (x, y, z) if many components are present.

Definition at line 216 of file Fields.h.

◆ combinedMagnetic() [2/3]

Direction dd4hep::OverlayedField::combinedMagnetic ( const Position pos) const
inline

Returns the 3 magnetic field components (x, y, z) at a given position.

Definition at line 209 of file Fields.h.

◆ combinedMagnetic() [3/3]

void OverlayedField::combinedMagnetic ( const Position pos,
double *  field 
) const

Returns the 3 magnetic field components (x, y, z) if many components are present.

Returns the 3 magnetic field components (x, y, z).

Definition at line 161 of file Fields.cpp.

◆ electricField() [1/4]

void dd4hep::OverlayedField::electricField ( const double *  pos,
double *  field 
) const
inline

Returns the 3 electric field components (x, y, z).

Definition at line 238 of file Fields.h.

◆ electricField() [2/4]

Direction dd4hep::OverlayedField::electricField ( const Position pos) const
inline

Returns the 3 electric field components (x, y, z) at a given position.

Definition at line 224 of file Fields.h.

◆ electricField() [3/4]

void dd4hep::OverlayedField::electricField ( const Position pos,
Direction field 
) const
inline

Returns the 3 electric field components (x, y, z).

Definition at line 231 of file Fields.h.

◆ electricField() [4/4]

void dd4hep::OverlayedField::electricField ( const Position pos,
double *  field 
) const

Returns the 3 electric field components (x, y, z).

◆ electromagneticField() [1/2]

void dd4hep::OverlayedField::electromagneticField ( const double *  pos,
double *  val 
) const
inline

Returns the 3 electric (val[0]-val[2]) and magnetic field components (val[3]-val[5]).

Definition at line 270 of file Fields.h.

◆ electromagneticField() [2/2]

void OverlayedField::electromagneticField ( const Position pos,
double *  field 
) const

Returns the 3 electric (val[0]-val[2]) and magnetic field components (val[3]-val[5]).

Definition at line 167 of file Fields.cpp.

◆ fieldType()

int dd4hep::OverlayedField::fieldType ( ) const
inline

Access the field type.

Definition at line 180 of file Fields.h.

◆ magneticField() [1/4]

void dd4hep::OverlayedField::magneticField ( const double *  pos,
Direction field 
) const
inline

Returns the 3 magnetic field components (x, y, z).

Definition at line 253 of file Fields.h.

◆ magneticField() [2/4]

void dd4hep::OverlayedField::magneticField ( const double *  pos,
double *  field 
) const
inline

Returns the 3 magnetic field components (x, y, z).

Definition at line 248 of file Fields.h.

◆ magneticField() [3/4]

Direction dd4hep::OverlayedField::magneticField ( const Position pos) const
inline

Returns the 3 electric field components (x, y, z) at a given position.

Definition at line 260 of file Fields.h.

◆ magneticField() [4/4]

void OverlayedField::magneticField ( const Position pos,
double *  field 
) const

Returns the 3 magnetic field components (x, y, z).

Definition at line 140 of file Fields.cpp.

◆ properties()

OverlayedField::Properties & OverlayedField::properties ( ) const

Access to properties container.

Definition at line 99 of file Fields.cpp.


The documentation for this class was generated from the following files: