CbmRoot
Loading...
Searching...
No Matches
CbmBsField.h
Go to the documentation of this file.
1/* Copyright (C) 2006-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Elena Litvinenko, Denis Bertini [committer], Florian Uhlig */
4
5// -------------------------------------------------------------------------
6// ----- CbmBsField header file -----
7// ----- Created 12/05/06 by E.I.Litvinenko -----
8// -------------------------------------------------------------------------
9
10
23#ifndef CBMBSF_H
24#define CBMBSF_H
25
26#include "CbmFieldMap.h" // for CbmFieldMap
27
28#include <Rtypes.h> // for THashConsistencyHolder, ClassDef
29#include <RtypesCore.h> // for Double_t, Int_t, Float_t
30#include <TString.h> // for TString
31
32#include <string.h> // for strcpy
33
34class CbmFieldPar;
35class TArrayF;
36
37class CbmBsField : public CbmFieldMap {
38public:
39 CbmBsField(const char* pBsName, Int_t symType = 3);
40 CbmBsField();
41 CbmBsField(CbmFieldPar* fieldPar);
42
43 virtual ~CbmBsField();
44
46 void Init();
47
48 void writeBsRootfile(const char* name); // Write Field Splined to root file
49 void readBsRootfile(const char* name); // Read Field Splined from root file
50 void readFortranAsciifiles(const char* MapFile1, const char* MapFile2,
51 const char* MapFile3); // for the first use only
52
53 void GetFieldValue(const Double_t Point[3], Double_t* Bfield);
54
55 void CalculateMapFromBs(Int_t pNx = 0, Int_t pNy = 0,
56 Int_t pNz = 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 {
69 fBsName = pBsName;
70 this->SetName(pBsName);
71 }
72
73 Double_t GetBx(Double_t x, Double_t y, Double_t z);
74 Double_t GetBy(Double_t x, Double_t y, Double_t z);
75 Double_t GetBz(Double_t x, Double_t y, Double_t z);
76
77
78 // private:
79protected:
80 Int_t NDIM, LL1, LL2, LL3, II1, II2, II3;
81
82 TArrayF* fBsBx; // NDIM coefficients for Bx
83 TArrayF* fBsBy; // NDIM coefficients for By
84 TArrayF* fBsBz; // NDIM coefficients for Bz
85 TArrayF* fX; // LL1 x coordinates of grid points
86 TArrayF* fY; // LL2 y coordinates of grid points
87 TArrayF* fZ; // LL3 z coordinates of grid points
88
89 Float_t* UX1;
90 Float_t* UX2;
91 Float_t* UX3;
92 Float_t* F0;
93 Float_t* G0;
94 Float_t* U0;
95
96 TString fBsName; // basic field name used in Bs root file
97protected:
98 void PALC0(Double_t X, Double_t Y, Double_t Z, Double_t* BX, Double_t* BY,
99 Double_t* BZ); // from Fortran code
100 Float_t SPL0(Double_t T, Double_t X0, Double_t X1, Double_t X2, Double_t X3,
101 Double_t X4); // from Fortran code
102
103private:
106
107 ClassDef(CbmBsField, 2)
108};
109
110#endif
void PALC0(Double_t X, Double_t Y, Double_t Z, Double_t *BX, Double_t *BY, Double_t *BZ)
TArrayF * fX
Definition CbmBsField.h:85
TArrayF * GetBsBz()
Definition CbmBsField.h:61
TArrayF * GetBsBx()
Definition CbmBsField.h:59
TString fBsName
[NDIM]
Definition CbmBsField.h:96
TArrayF * fZ
Definition CbmBsField.h:87
virtual ~CbmBsField()
Int_t II2
Definition CbmBsField.h:80
Float_t * U0
[NDIM]
Definition CbmBsField.h:94
void writeBsRootfile(const char *name)
void GetBsName(char *pBsName)
Definition CbmBsField.h:66
void SetBsName(const char *pBsName)
Definition CbmBsField.h:67
Float_t SPL0(Double_t T, Double_t X0, Double_t X1, Double_t X2, Double_t X3, Double_t X4)
Float_t * UX1
Definition CbmBsField.h:89
Int_t LL1
Definition CbmBsField.h:80
Float_t * UX2
[LL1]
Definition CbmBsField.h:90
Float_t * G0
[NDIM]
Definition CbmBsField.h:93
Int_t NDIM
Definition CbmBsField.h:80
CbmBsField(const CbmBsField &)
CbmBsField & operator=(const CbmBsField &)
TArrayF * GetZ()
Definition CbmBsField.h:64
TArrayF * fY
Definition CbmBsField.h:86
Int_t II3
Definition CbmBsField.h:80
void readBsRootfile(const char *name)
TArrayF * fBsBz
Definition CbmBsField.h:84
TArrayF * GetY()
Definition CbmBsField.h:63
TArrayF * GetBsBy()
Definition CbmBsField.h:60
void CalculateMapFromBs(Int_t pNx=0, Int_t pNy=0, Int_t pNz=0)
void readFortranAsciifiles(const char *MapFile1, const char *MapFile2, const char *MapFile3)
Int_t II1
Definition CbmBsField.h:80
void GetFieldValue(const Double_t Point[3], Double_t *Bfield)
Int_t LL3
Definition CbmBsField.h:80
TArrayF * fBsBx
Definition CbmBsField.h:82
TArrayF * GetX()
Definition CbmBsField.h:62
Int_t LL2
Definition CbmBsField.h:80
Float_t * F0
[LL3]
Definition CbmBsField.h:92
Float_t * UX3
[LL2]
Definition CbmBsField.h:91
TArrayF * fBsBy
Definition CbmBsField.h:83
TArrayF * GetBz() const
TArrayF * GetBx() const
TArrayF * GetBy() const