SND@LHC Software
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
 Get the magneticField [kGauss] at position.
 
- Public Member Functions inherited from genfit::AbsBField
 AbsBField ()
 
virtual ~AbsBField ()
 

Private Attributes

ShipCompFieldgField_
 

Detailed Description

Field for SHiP.

Author
Thomas Ruf CERN

Definition at line 18 of file FairShipFields.h.

Constructor & Destructor Documentation

◆ FairShipFields()

genfit::FairShipFields::FairShipFields ( )

Default constructor

Definition at line 13 of file FairShipFields.cc.

14 : AbsBField()
15 { ; }

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
virtual

Get the magneticField [kGauss] at position.

Override this in your concrete implementation.

Reimplemented from genfit::AbsBField.

Definition at line 25 of file FairShipFields.cc.

25 {
26 Double_t X[3] = {x,y,z};
27 Double_t B[3] = {Bx,By,Bz};
28 if (!gMC && !gField_){
29 cout<<"no Field Manager instantiated"<<endl;
30 return;
31 }
32 if (gMC){
33 gMC->GetMagField()->Field(X,B);
34 } else {
35 gField_->Field(X,B);
36 }
37 Bx = B[0];
38 By = B[1];
39 Bz = B[2];
40}
virtual void Field(const Double_t *position, Double_t *B)
The total magnetic field from all of the composite sources (linear superposition)
ShipCompField * gField_

◆ get() [2/2]

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

return value at position

Implements genfit::AbsBField.

Definition at line 18 of file FairShipFields.cc.

18 {
19 Double_t bx,by,bz;
20 get(pos.X(),pos.Y(),pos.Z(),bx,by,bz);
21 TVector3 field_(bx,by,bz);
22 return field_;
23}
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 25 of file FairShipFields.h.

25{ gField_ = gField; }

Member Data Documentation

◆ gField_

ShipCompField* genfit::FairShipFields::gField_
private

Definition at line 32 of file FairShipFields.h.


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