SND@LHC Software
Loading...
Searching...
No Matches
genfit::GoliathField Class Reference

Constant Magnetic field. More...

#include <GoliathField.h>

Inheritance diagram for genfit::GoliathField:
Collaboration diagram for genfit::GoliathField:

Public Member Functions

 GoliathField (double b1, double b2, double b3)
 define the constant field in this ctor
 
 GoliathField (const TVector3 &field)
 
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.
 
void getpos (TString vol, TVector3 &bot, TVector3 &top) const
 
void setup ()
 
- Public Member Functions inherited from genfit::AbsBField
 AbsBField ()
 
virtual ~AbsBField ()
 

Public Attributes

Float_t coords [13][6]
 

Private Attributes

TVector3 field_
 

Detailed Description

Constant Magnetic field.

Author
Christian Höppner (Technische Universität München, original author)
Sebastian Neubert (Technische Universität München, original author)

Definition at line 37 of file GoliathField.h.

Constructor & Destructor Documentation

◆ GoliathField() [1/2]

genfit::GoliathField::GoliathField ( double  b1,
double  b2,
double  b3 
)
inline

define the constant field in this ctor

Definition at line 40 of file GoliathField.h.

41 : field_(b1, b2, b3)
42 { ; }

◆ GoliathField() [2/2]

genfit::GoliathField::GoliathField ( const TVector3 &  field)
inline

Definition at line 44 of file GoliathField.h.

45 : field_(field)
46 { ; }

Member Function Documentation

◆ get() [1/2]

void genfit::GoliathField::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 47 of file GoliathField.cc.

47 {
48 Bx=0.;By=0.;Bz=0.;
49 if ((posX < coords[0][0]) && (posX > coords[0][3]) && (posY < coords[0][1]) && (posY > coords[0][4]) && (posZ < coords[0][2]+5.) && (posZ>coords[0][5]+5.) ) {
50 Bx = field_.X();
51 By = field_.Y();
52 Bz = field_.Z();
53 }
54 else {
55 for (Int_t i=1;i<13;i++){
56 if ((posX < coords[i][0]) && (posX > coords[i][3]) && (posY < coords[i][1]) && (posY > coords[i][4]) && (posZ < coords[i][2]) && (posZ>coords[i][5])) {
57 Bx = 0.;
58 By = -10.;
59 Bz = 0.;
60 break;
61 }
62 }
63 }
64}
Float_t coords[13][6]
int i
Definition ShipAna.py:86

◆ get() [2/2]

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

return value at position

Implements genfit::AbsBField.

Definition at line 43 of file GoliathField.cc.

43 {
44 return field_;
45}

◆ getpos()

void genfit::GoliathField::getpos ( TString  vol,
TVector3 &  bot,
TVector3 &  top 
) const

Definition at line 67 of file GoliathField.cc.

67 {
68 TGeoNavigator* nav = gGeoManager->GetCurrentNavigator();
69 Bool_t rc = nav->cd(volname);
70 if (not rc){
71 cout << "Goliathfield::getpos, TGeoNavigator failed "<<volname<<endl;
72 return;
73 }
74 TGeoNode* W = nav->GetCurrentNode();
75 TGeoBBox* S = dynamic_cast<TGeoBBox*>(W->GetVolume()->GetShape());
76 Double_t top[3] = {S->GetDX(),S->GetDY(),S->GetDZ()};
77 Double_t bot[3] = {-S->GetDX(),-S->GetDY(),-S->GetDZ()};
78 Double_t Gtop[3],Gbot[3];
79 nav->LocalToMaster(top, Gtop);
80 nav->LocalToMaster(bot, Gbot);
81 vtop.SetXYZ(Gtop[0],Gtop[1],Gtop[2]);
82 vbot.SetXYZ(Gbot[0],Gbot[1],Gbot[2]);
83}
dict S
Definition MufiCTR.py:12

◆ setup()

void genfit::GoliathField::setup ( )

Definition at line 85 of file GoliathField.cc.

85 {
86 TVector3 bot,top;
87 std::vector<TString> volume={"/volGoliath_1/VolVacuum_1","/volGoliath_1/volLateralS1_1","/volGoliath_1/volLateralS2_1","/volGoliath_1/volLateralSurface1low_1",
88 "/volGoliath_1/volLateralSurface2low_1","/volGoliath_1/volLateralS1_b_1","/volGoliath_1/volLateralS2_b_1","/volGoliath_1/volLateralSurface1blow_1",
89 "/volGoliath_1/volLateralSurface2blow_1","/volGoliath_1/volLateralS1_d_1","/volGoliath_1/volLateralS2_d_1","/volGoliath_1/volLateralS1_c_1",
90 "/volGoliath_1/volLateralS2_c_1"};
91 for (Int_t i=0;i<13;i++){
92 getpos(volume[i],bot,top);
93 for (Int_t j=0;j<3;j++) {
94 coords[i][j]=top[j];
95 coords[i][j+3]=bot[j];
96 }
97 //std::cout<<volume[i]<<" "<<coords[i][3] << " posX " << posX <<" "<< coords[i][0] << ";" << coords[i][4] << " posY "<< posY <<" "<< coords[i][1] << ";" << coords[i][5] << " posZ " << posZ<<" "<< coords[i][2]<<std::endl;
98 }
99}
void getpos(TString vol, TVector3 &bot, TVector3 &top) const

Member Data Documentation

◆ coords

Float_t genfit::GoliathField::coords[13][6]

Definition at line 47 of file GoliathField.h.

◆ field_

TVector3 genfit::GoliathField::field_
private

Definition at line 57 of file GoliathField.h.


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