EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FairField.cxx
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file FairField.cxx
1 // -------------------------------------------------------------------------
2 // ----- FairField source file -----
3 // ----- Created 06/01/04 by M. Al/Turany -----
4 // ----- Redesign 13/02/06 by V. Friese -----
5 // -------------------------------------------------------------------------
6 
7 #include"FairField.h"
8 
9 
10 
11 // ----- Default constructor -------------------------------------------
12 FairField::FairField()
13  : TVirtualMagField("FAIR Magnetic Field"), fType(0), fLogger(FairLogger::GetLogger())
14 {
15 }
16 // -------------------------------------------------------------------------
17 
18 
19 
20 // ----- Constructor with name and title -------------------------------
21 FairField::FairField(const char* name, const char* title)
22  :TVirtualMagField(name), fType(0) , fLogger(FairLogger::GetLogger())
23 {
24 
25 }
26 // -------------------------------------------------------------------------
27 
28 
29 
30 // ----- Destructor ----------------------------------------------------
31 FairField::~FairField() { }
32 // -------------------------------------------------------------------------
33 
34 
35 
36 // ----- Test field type Constant --------------------------------------
37 Bool_t FairField::IsConst()
38 {
39  if ( fType == 1 ) { return kTRUE; }
40  return kFALSE;
41 }
42 // -------------------------------------------------------------------------
43 
44 
45 
46 // ----- Test field type Map -------------------------------------------
47 Bool_t FairField::IsMap()
48 {
49  if ( fType == 2 ) { return kTRUE; }
50  return kFALSE;
51 }
52 // -------------------------------------------------------------------------
53 void FairField::GetFieldValue(const Double_t point[3], Double_t* bField)
54 {
55  bField[0] = GetBx(point[0], point[1], point[2]);
56  bField[1] = GetBy(point[0], point[1], point[2]);
57  bField[2] = GetBz(point[0], point[1], point[2]);
58 }
59 
60 
61 ClassImp(FairField)