Class that defines a magnetic field composed from many fields.
More...
#include <ShipCompField.h>
|
| | ShipCompField (const std::string &label, TVirtualMagField *firstField) |
| | Main constructor.
|
| | ShipCompField (const std::string &label, TVirtualMagField *firstField, TVirtualMagField *secondField) |
| | Secondary constructor.
|
| | ShipCompField (const std::string &label, const std::vector< TVirtualMagField * > &theFields) |
| | More general constructor.
|
| | ~ShipCompField () override |
| | Destructor.
|
| void | Field (const Double_t *position, Double_t *B) override |
| size_t | nComposite () const |
| | Get the number of fields in the composite.
|
| std::span< TVirtualMagField *const > | getCompFields () const |
| | Get the vector of fields.
|
| | ClassDefOverride (ShipCompField, 1) |
| | ClassDef for ROOT.
|
|
| std::vector< TVirtualMagField * > | theFields_ |
| | The vector of the various magnetic field pointers comprising the composite.
|
Class that defines a magnetic field composed from many fields.
- Author
- John Back J.J.B.nosp@m.ack@.nosp@m.warwi.nosp@m.ck.a.nosp@m.c.uk
Definition at line 19 of file ShipCompField.h.
◆ ShipCompField() [1/4]
| ShipCompField::ShipCompField |
( |
const std::string & | label, |
|
|
TVirtualMagField * | firstField ) |
Main constructor.
- Parameters
-
| [in] | label | A descriptive name/title/label for the composite field |
| [in] | firstField | The first magnetic field for the composite |
Definition at line 14 of file ShipCompField.cxx.
18}
std::vector< TVirtualMagField * > theFields_
The vector of the various magnetic field pointers comprising the composite.
◆ ShipCompField() [2/4]
| ShipCompField::ShipCompField |
( |
const std::string & | label, |
|
|
TVirtualMagField * | firstField, |
|
|
TVirtualMagField * | secondField ) |
Secondary constructor.
- Parameters
-
| [in] | label | A descriptive name/title/label for the composite field |
| [in] | firstField | The first magnetic field pointer for the composite |
| [in] | secondField | The second magnetic field pointer for the composite |
Definition at line 20 of file ShipCompField.cxx.
◆ ShipCompField() [3/4]
| ShipCompField::ShipCompField |
( |
const std::string & | label, |
|
|
const std::vector< TVirtualMagField * > & | theFields ) |
More general constructor.
- Parameters
-
| [in] | label | A descriptive name/title/label for the composite field |
| [in] | theFields | A vector of magnetic field pointers for the composite |
Definition at line 28 of file ShipCompField.cxx.
◆ ~ShipCompField()
| ShipCompField::~ShipCompField |
( |
| ) |
|
|
overridedefault |
◆ ShipCompField() [4/4]
Deleted copy and assignment operators.
◆ ClassDefOverride()
◆ Field()
| void ShipCompField::Field |
( |
const Double_t * | position, |
|
|
Double_t * | B ) |
|
override |
The total magnetic field from all of the composite sources (linear superposition)
- Parameters
-
| [in] | position | The x,y,z global coordinates of the point |
| [out] | B | The x,y,z components of the magnetic field |
Definition at line 36 of file ShipCompField.cxx.
36 {
37
38
39
40 B[0] = 0.0, B[1] = 0.0, B[2] = 0.0;
41
43 if (theField) {
44
45
46
47 Double_t BVect[3] = {0.0, 0.0, 0.0};
48 theField->Field(position, BVect);
49
50
51 B[0] += BVect[0];
52 B[1] += BVect[1];
53 B[2] += BVect[2];
54
55
56
57 }
58 }
59}
◆ getCompFields()
| std::span< TVirtualMagField *const > ShipCompField::getCompFields |
( |
| ) |
const |
|
inline |
Get the vector of fields.
- Returns
- a non-owning view of the fields
Definition at line 66 of file ShipCompField.h.
◆ nComposite()
| size_t ShipCompField::nComposite |
( |
| ) |
const |
|
inline |
Get the number of fields in the composite.
- Returns
- the number of fields used in the composite
Definition at line 60 of file ShipCompField.h.
◆ operator=()
◆ theFields_
| std::vector<TVirtualMagField*> ShipCompField::theFields_ |
|
private |
The vector of the various magnetic field pointers comprising the composite.
Definition at line 80 of file ShipCompField.h.
The documentation for this class was generated from the following files: