SND@LHC Software
Loading...
Searching...
No Matches
FairShipFields.cc
Go to the documentation of this file.
1
/*
2
generic interface to B fields of FairShip
3
assumes that magnetic fields for tracking are global fields, not matched to a volume.
4
*/
5
#include "
FairShipFields.h
"
6
#include "TVirtualMC.h"
7
#include <iostream>
8
using
std::cout;
9
using
std::endl;
10
11
namespace
genfit
{
12
13
FairShipFields::FairShipFields
()
14
:
AbsBField
()
15
{ ; }
16
17
18
TVector3
FairShipFields::get
(
const
TVector3& pos)
const
{
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
}
24
25
void
FairShipFields::get
(
const
double
& x,
const
double
& y,
const
double
& z,
double
& Bx,
double
& By,
double
& Bz)
const
{
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
}
41
42
}
/* End of namespace genfit */
FairShipFields.h
ShipCompField::Field
virtual void Field(const Double_t *position, Double_t *B)
The total magnetic field from all of the composite sources (linear superposition)
Definition
ShipCompField.cxx:41
genfit::AbsBField
Abstract Interface to magnetic fields in GENFIT.
Definition
AbsBField.h:36
genfit::FairShipFields::FairShipFields
FairShipFields()
Definition
FairShipFields.cc:13
genfit::FairShipFields::get
TVector3 get(const TVector3 &pos) const
return value at position
Definition
FairShipFields.cc:18
genfit::FairShipFields::gField_
ShipCompField * gField_
Definition
FairShipFields.h:32
genfit
Matrix inversion tools.
Definition
AbsBField.h:29
genfit
fields
src
FairShipFields.cc
Generated by
1.9.8