FairShip
Loading...
Searching...
No Matches
genfit::FairShipFields Class Reference

Field for SHiP. More...

#include <FairShipFields.h>

Inheritance diagram for genfit::FairShipFields:
Collaboration diagram for genfit::FairShipFields:

Public Member Functions

 FairShipFields ()
 
void setField (ShipCompField *gField)
 set field if not gMC present
 
TVector3 get (const TVector3 &pos) const
 return value at position
 
void get (const double &posX, const double &posY, const double &posZ, double &Bx, double &By, double &Bz) const
 

Private Attributes

ShipCompFieldgField_ {nullptr}
 

Detailed Description

Field for SHiP.

Author
Thomas Ruf CERN

Definition at line 21 of file FairShipFields.h.

Constructor & Destructor Documentation

◆ FairShipFields()

genfit::FairShipFields::FairShipFields ( )

Default constructor

Definition at line 20 of file FairShipFields.cxx.

20: AbsBField() { ; }

Member Function Documentation

◆ get() [1/2]

void genfit::FairShipFields::get ( const double &  posX,
const double &  posY,
const double &  posZ,
double &  Bx,
double &  By,
double &  Bz 
) const

Definition at line 29 of file FairShipFields.cxx.

30 {
31 Double_t X[3] = {x, y, z};
32 Double_t B[3] = {Bx, By, Bz};
33 if (!gMC && !gField_) {
34 cout << "no Field Manager instantiated" << endl;
35 return;
36 }
37 if (gMC) {
38 gMC->GetMagField()->Field(X, B);
39 } else {
40 gField_->Field(X, B);
41 }
42 Bx = B[0];
43 By = B[1];
44 Bz = B[2];
45}
Definition: diagrams_b.h:4
virtual void Field(const Double_t *position, Double_t *B)
ShipCompField * gField_

◆ get() [2/2]

TVector3 genfit::FairShipFields::get ( const TVector3 &  pos) const

return value at position

Definition at line 22 of file FairShipFields.cxx.

22 {
23 Double_t bx, by, bz;
24 get(pos.X(), pos.Y(), pos.Z(), bx, by, bz);
25 TVector3 field_(bx, by, bz);
26 return field_;
27}
TVector3 get(const TVector3 &pos) const
return value at position

◆ setField()

void genfit::FairShipFields::setField ( ShipCompField gField)
inline

set field if not gMC present

Definition at line 27 of file FairShipFields.h.

27{ gField_ = gField; }

Member Data Documentation

◆ gField_

ShipCompField* genfit::FairShipFields::gField_ {nullptr}
private

Definition at line 35 of file FairShipFields.h.


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