CbmRoot
CbmBsField.h
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- CbmBsField header file -----
3 // ----- Created 12/05/06 by E.I.Litvinenko -----
4 // -------------------------------------------------------------------------
5 
6 
19 #ifndef CBMBSF_H
20 #define CBMBSF_H
21 
22 #include <Rtypes.h> // for THashConsistencyHolder, ClassDef
23 #include <RtypesCore.h> // for Double_t, Int_t, Float_t
24 #include <TString.h> // for TString
25 
26 #include <string.h> // for strcpy
27 
28 #include "CbmFieldMap.h" // for CbmFieldMap
29 
30 class CbmFieldPar;
31 class TArrayF;
32 
33 class CbmBsField : public CbmFieldMap {
34 public:
35  CbmBsField(const char* pBsName, Int_t symType = 3);
36  CbmBsField();
37  CbmBsField(CbmFieldPar* fieldPar);
38 
39  virtual ~CbmBsField();
40 
42  void Init();
43 
44  void writeBsRootfile(const char* name); // Write Field Splined to root file
45  void readBsRootfile(const char* name); // Read Field Splined from root file
46  void readFortranAsciifiles(const char* MapFile1,
47  const char* MapFile2,
48  const char* MapFile3); // for the first use only
49 
50  void GetFieldValue(const Double_t Point[3], Double_t* Bfield);
51 
52  void CalculateMapFromBs(
53  Int_t pNx = 0,
54  Int_t pNy = 0,
55  Int_t pNz =
56  0); // calculate map pNx,pNy,Pnz dim (default - LL1-3,LL2-3,LL3-3)
57 
58 
59  TArrayF* GetBsBx() { return fBsBx; }
60  TArrayF* GetBsBy() { return fBsBy; }
61  TArrayF* GetBsBz() { return fBsBz; }
62  TArrayF* GetX() { return fX; }
63  TArrayF* GetY() { return fY; }
64  TArrayF* GetZ() { return fZ; }
65 
66  void GetBsName(char* pBsName) { strcpy(pBsName, fBsName.Data()); }
67  void SetBsName(const char* pBsName) {
68  fBsName = pBsName;
69  this->SetName(pBsName);
70  }
71 
72  Double_t GetBx(Double_t x, Double_t y, Double_t z);
73  Double_t GetBy(Double_t x, Double_t y, Double_t z);
74  Double_t GetBz(Double_t x, Double_t y, Double_t z);
75 
76 
77  // private:
78 protected:
79  Int_t NDIM, LL1, LL2, LL3, II1, II2, II3;
80 
81  TArrayF* fBsBx; // NDIM coefficients for Bx
82  TArrayF* fBsBy; // NDIM coefficients for By
83  TArrayF* fBsBz; // NDIM coefficients for Bz
84  TArrayF* fX; // LL1 x coordinates of grid points
85  TArrayF* fY; // LL2 y coordinates of grid points
86  TArrayF* fZ; // LL3 z coordinates of grid points
87 
88  Float_t* UX1;
89  Float_t* UX2;
90  Float_t* UX3;
91  Float_t* F0;
92  Float_t* G0;
93  Float_t* U0;
94 
95  TString fBsName; // basic field name used in Bs root file
96 protected:
97  void PALC0(Double_t X,
98  Double_t Y,
99  Double_t Z,
100  Double_t* BX,
101  Double_t* BY,
102  Double_t* BZ); // from Fortran code
103  Float_t SPL0(Double_t T,
104  Double_t X0,
105  Double_t X1,
106  Double_t X2,
107  Double_t X3,
108  Double_t X4); // from Fortran code
109 
110 private:
113 
114  ClassDef(CbmBsField, 2)
115 };
116 
117 #endif
CbmBsField::CbmBsField
CbmBsField()
Definition: CbmBsField.cxx:57
CbmBsField::UX3
Float_t * UX3
[LL2]
Definition: CbmBsField.h:90
CbmBsField::operator=
CbmBsField & operator=(const CbmBsField &)
CbmBsField::readFortranAsciifiles
void readFortranAsciifiles(const char *MapFile1, const char *MapFile2, const char *MapFile3)
Definition: CbmBsField.cxx:316
CbmBsField
Definition: CbmBsField.h:33
CbmBsField::SetBsName
void SetBsName(const char *pBsName)
Definition: CbmBsField.h:67
CbmFieldMap::GetBy
TArrayF * GetBy() const
Definition: CbmFieldMap.h:159
CbmBsField::fBsBy
TArrayF * fBsBy
Definition: CbmBsField.h:82
CbmBsField::fBsName
TString fBsName
[NDIM]
Definition: CbmBsField.h:95
CbmBsField::fY
TArrayF * fY
Definition: CbmBsField.h:85
CbmBsField::G0
Float_t * G0
[NDIM]
Definition: CbmBsField.h:92
CbmBsField::GetX
TArrayF * GetX()
Definition: CbmBsField.h:62
CbmBsField::PALC0
void PALC0(Double_t X, Double_t Y, Double_t Z, Double_t *BX, Double_t *BY, Double_t *BZ)
Definition: CbmBsField.cxx:389
CbmBsField::II1
Int_t II1
Definition: CbmBsField.h:79
CbmBsField::GetBsBz
TArrayF * GetBsBz()
Definition: CbmBsField.h:61
CbmBsField::SPL0
Float_t SPL0(Double_t T, Double_t X0, Double_t X1, Double_t X2, Double_t X3, Double_t X4)
Definition: CbmBsField.cxx:530
CbmBsField::F0
Float_t * F0
[LL3]
Definition: CbmBsField.h:91
CbmBsField::GetZ
TArrayF * GetZ()
Definition: CbmBsField.h:64
CbmBsField::II2
Int_t II2
Definition: CbmBsField.h:79
CbmFieldMap::GetBz
TArrayF * GetBz() const
Definition: CbmFieldMap.h:160
CbmFieldMap
Definition: CbmFieldMap.h:34
CbmBsField::fZ
TArrayF * fZ
Definition: CbmBsField.h:86
CbmBsField::CbmBsField
CbmBsField(const CbmBsField &)
CbmBsField::fX
TArrayF * fX
Definition: CbmBsField.h:84
Point
Definition: CbmGlobalTrackingTof.cxx:90
CbmBsField::UX2
Float_t * UX2
[LL1]
Definition: CbmBsField.h:89
CbmBsField::NDIM
Int_t NDIM
Definition: CbmBsField.h:79
CbmBsField::U0
Float_t * U0
[NDIM]
Definition: CbmBsField.h:93
CbmBsField::Init
void Init()
Definition: CbmBsField.cxx:118
CbmBsField::GetBsName
void GetBsName(char *pBsName)
Definition: CbmBsField.h:66
CbmBsField::LL2
Int_t LL2
Definition: CbmBsField.h:79
CbmBsField::GetBsBx
TArrayF * GetBsBx()
Definition: CbmBsField.h:59
CbmBsField::readBsRootfile
void readBsRootfile(const char *name)
Definition: CbmBsField.cxx:192
x
Double_t x
Definition: CbmMvdSensorDigiToHitTask.cxx:68
CbmBsField::GetBsBy
TArrayF * GetBsBy()
Definition: CbmBsField.h:60
CbmBsField::GetY
TArrayF * GetY()
Definition: CbmBsField.h:63
y
Double_t y
Definition: CbmMvdSensorDigiToHitTask.cxx:68
CbmFieldMap.h
CbmBsField::LL1
Int_t LL1
Definition: CbmBsField.h:79
CbmBsField::CalculateMapFromBs
void CalculateMapFromBs(Int_t pNx=0, Int_t pNy=0, Int_t pNz=0)
Definition: CbmBsField.cxx:126
CbmBsField::II3
Int_t II3
Definition: CbmBsField.h:79
CbmFieldPar
Definition: CbmFieldPar.h:31
CbmBsField::~CbmBsField
virtual ~CbmBsField()
Definition: CbmBsField.cxx:108
CbmBsField::UX1
Float_t * UX1
Definition: CbmBsField.h:88
CbmBsField::LL3
Int_t LL3
Definition: CbmBsField.h:79
CbmBsField::fBsBz
TArrayF * fBsBz
Definition: CbmBsField.h:83
CbmBsField::writeBsRootfile
void writeBsRootfile(const char *name)
Definition: CbmBsField.cxx:183
CbmBsField::fBsBx
TArrayF * fBsBx
Definition: CbmBsField.h:81
CbmBsField::GetFieldValue
void GetFieldValue(const Double_t Point[3], Double_t *Bfield)
Definition: CbmBsField.cxx:240
CbmFieldMap::GetBx
TArrayF * GetBx() const
Definition: CbmFieldMap.h:158