EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FairField.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file FairField.h
1 // -------------------------------------------------------------------------
2 // ----- FairField header file -----
3 // ----- Created 06/01/04 by M. Al-Turany -----
4 // ----- Redesign 13/02/06 by V. Friese -----
5 // ----- Redesign 04/08/06 by M. Al-Turany -----
6 // -------------------------------------------------------------------------
7 
8 
22 #include "FairLogger.h"
23 
24 
25 #ifndef FAIRFIELD_H
26 #define FAIRFIELD_H 1
27 #include "RVersion.h"
28 
29 
30 //#ifndef ROOT_TVirtualMagField
31 //#include "TVirtualMagField.h"
32 //#endif
33 
34 #if ROOT_VERSION_CODE < 333824
35 
36 #ifndef ROOT_TVirtualMagField
37 #define ROOT_TVirtualMagField
38 // copied from ROOT for backward compatibility with ROOT versions before 5.24
39 #include "TNamed.h"
40 
41 class TVirtualMagField : public TNamed
42 {
43  public:
44  TVirtualMagField() : TNamed() {}
45  TVirtualMagField(const char* name) : TNamed(name,"") {}
46  virtual ~TVirtualMagField() {}
47  virtual void Field(const Double_t* x, Double_t* B) = 0;
48  ClassDef(TVirtualMagField, 1) // Abstract base field class
49 };
51 #endif
52 
53 
54 #else
55 
56 #include "TVirtualMagField.h"
57 
58 #endif
59 
60 
61 #include <iostream>
62 
63 class FairField : public TVirtualMagField
64 {
65 
66  public:
67 
69  FairField();
70 
71 
73  FairField(const char* name, const char* title = "FAIR Magnetic Field");
74 
75  FairField& operator=(const FairField&) {return *this;}
76 
78  virtual ~FairField();
79 
80 
84  virtual void Init() { };
85 
87  Bool_t IsConst();
88 
89 
91  Bool_t IsMap();
92 
93 
95  Int_t GetType() const { return fType; }
96 
97 
101  virtual Double_t GetBx(Double_t x, Double_t y, Double_t z) {std::cout << "GetBx Should be implimented" << std::endl; return 0;}
102 
103 
107  virtual Double_t GetBy(Double_t x, Double_t y, Double_t z) {std::cout << "GetBy Should be implimented" << std::endl; return 0;}
108 
109 
113  virtual Double_t GetBz(Double_t x, Double_t y, Double_t z) {std::cout << "GetBz Should be implimented" << std::endl; return 0;}
114 
115 
120  virtual void GetFieldValue(const Double_t point[3], Double_t* bField);
121 
122 
123  void Field(const Double_t point[3], Double_t* B) {GetFieldValue(point,B);}
124 
125 
127  virtual void Print(Option_t* option = "") const {;}
128  virtual void GetBxyz(const Double_t point[3], Double_t* bField) { std::cout << "GetBz Should be implimented" << std::endl;};
129 
130 
131 
134  virtual void FillParContainer() {printf("This should implimented in the exp. part \n");}
135  protected:
136 
138  Int_t fType;
139 
141  FairLogger* fLogger;
142 
143  private:
144  FairField(const FairField&);
145  // FairField& operator=(const FairField&);
146  //TODO: Check why the htrack needs this
147  ClassDef(FairField,3);
148 
149 };
150 
151 
152 
153 
154 #endif