FairShip
Loading...
Searching...
No Matches
SHiP::ActsShipField Class Referencefinal

#include <ActsShipField.hpp>

Inheritance diagram for SHiP::ActsShipField:
[legend]
Collaboration diagram for SHiP::ActsShipField:
[legend]

Public Member Functions

 ActsShipField (TVirtualMagField *field)
 The field is not owned and must outlive this object.
Cache makeCache (const Acts::MagneticFieldContext &mctx) const override
Acts::Result< Acts::Vector3 > getField (const Acts::Vector3 &position, Cache &cache) const override

Private Attributes

TVirtualMagField * m_field

Detailed Description

ACTS view of a FairShip magnetic field.

Wraps the field used in the simulation (e.g. the global field of the ShipFieldMaker), so the fit sees the same field map, placement and orientation as Geant4. Positions and field values are converted between the ACTS reco frame and the SHiP frame (cm, kGauss).

Definition at line 22 of file ActsShipField.hpp.

Constructor & Destructor Documentation

◆ ActsShipField()

SHiP::ActsShipField::ActsShipField ( TVirtualMagField * field)
explicit

The field is not owned and must outlive this object.

Definition at line 20 of file ActsShipField.cpp.

20 : m_field(field) {
21 if (m_field == nullptr) {
22 throw std::invalid_argument("ActsShipField: field is null");
23 }
24}
TVirtualMagField * m_field

Member Function Documentation

◆ getField()

Acts::Result< Acts::Vector3 > SHiP::ActsShipField::getField ( const Acts::Vector3 & position,
Cache & cache ) const
override

Definition at line 31 of file ActsShipField.cpp.

32 {
33 const Acts::Vector3 shipPosition = ActsFrame::positionToShip(position);
34 const double x[3] = {shipPosition.x(), shipPosition.y(), shipPosition.z()};
35 double b[3] = {0., 0., 0.};
36 m_field->Field(x, b);
37 const Acts::Vector3 shipField(b[0], b[1], b[2]);
38 return Acts::Result<Acts::Vector3>::success(ActsFrame::toActsRotation() *
39 shipField * kKiloGauss);
40}
Acts::RotationMatrix3 toActsRotation()
Rotation taking SHiP-frame vectors to the ACTS frame.
Definition ActsFrame.hpp:31
Acts::Vector3 positionToShip(const Acts::Vector3 &position)
Definition ActsFrame.hpp:42

◆ makeCache()

Acts::MagneticFieldProvider::Cache SHiP::ActsShipField::makeCache ( const Acts::MagneticFieldContext & mctx) const
override

Definition at line 26 of file ActsShipField.cpp.

27 {
28 return Cache{};
29}

Member Data Documentation

◆ m_field

TVirtualMagField* SHiP::ActsShipField::m_field
private

Definition at line 32 of file ActsShipField.hpp.


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