FairShip
Loading...
Searching...
No Matches
ShipFieldPar Class Reference

#include <ShipFieldPar.h>

Inheritance diagram for ShipFieldPar:
Collaboration diagram for ShipFieldPar:

Public Member Functions

 ShipFieldPar (const char *name, const char *title, const char *context)
 
 ShipFieldPar ()
 
 ~ShipFieldPar ()
 
virtual void putParams (FairParamList *list)
 
virtual Bool_t getParams (FairParamList *list)
 
void SetParameters (FairField *field)
 
Int_t GetType () const
 
Double_t GetXmin () const
 
Double_t GetXmax () const
 
Double_t GetYmin () const
 
Double_t GetYmax () const
 
Double_t GetZmin () const
 
Double_t GetZmax () const
 
Double_t GetBx () const
 
Double_t GetBy () const
 
Double_t GetBz () const
 
void MapName (TString &name)
 
Double_t GetPositionX () const
 
Double_t GetPositionY () const
 
Double_t GetPositionZ () const
 
Double_t GetScale () const
 
Double_t GetPeak () const
 
Double_t GetMiddle () const
 
Double_t GetBtube () const
 

Private Member Functions

 ShipFieldPar (const ShipFieldPar &)=delete
 
ShipFieldParoperator= (const ShipFieldPar &)=delete
 
 ClassDef (ShipFieldPar, 1)
 

Private Attributes

Int_t fType
 
Double_t fXmin
 
Double_t fXmax
 
Double_t fYmin
 
Double_t fYmax
 
Double_t fZmin
 
Double_t fZmax
 
Double_t fBx
 
Double_t fBy
 
Double_t fBz
 
TString fMapName
 
Double_t fPosX
 
Double_t fPosY
 
Double_t fPosZ
 
Double_t fScale
 
Double_t fPeak
 
Double_t fMiddle
 
Double_t fBtube
 

Detailed Description

Definition at line 15 of file ShipFieldPar.h.

Constructor & Destructor Documentation

◆ ShipFieldPar() [1/3]

ShipFieldPar::ShipFieldPar ( const char *  name,
const char *  title,
const char *  context 
)

Standard constructor

Definition at line 16 of file ShipFieldPar.cxx.

18 : FairParGenericSet(name, title, context),
19 fType(-1),
20 fXmin(0.),
21 fXmax(0.),
22 fYmin(0.),
23 fYmax(0.),
24 fZmin(0.),
25 fZmax(0.),
26 fBx(0.),
27 fBy(0.),
28 fBz(0.),
29 fMapName(""),
30 fPosX(0.),
31 fPosY(0.),
32 fPosZ(0.),
33 fScale(0.),
34 fPeak(0.),
35 fMiddle(0.)
36
37{}
TString fMapName
Definition: ShipFieldPar.h:75
Double_t fYmin
Definition: ShipFieldPar.h:68
Double_t fBy
Definition: ShipFieldPar.h:72
Double_t fZmin
Definition: ShipFieldPar.h:69
Double_t fPosZ
Definition: ShipFieldPar.h:78
Double_t fPeak
Definition: ShipFieldPar.h:84
Double_t fMiddle
Definition: ShipFieldPar.h:85
Double_t fPosX
Definition: ShipFieldPar.h:78
Double_t fYmax
Definition: ShipFieldPar.h:68
Double_t fBz
Definition: ShipFieldPar.h:72
Double_t fZmax
Definition: ShipFieldPar.h:69
Double_t fBx
Definition: ShipFieldPar.h:72
Double_t fXmax
Definition: ShipFieldPar.h:67
Double_t fScale
Definition: ShipFieldPar.h:81
Double_t fXmin
Definition: ShipFieldPar.h:67
Double_t fPosY
Definition: ShipFieldPar.h:78

◆ ShipFieldPar() [2/3]

ShipFieldPar::ShipFieldPar ( )

default constructor

Definition at line 40 of file ShipFieldPar.cxx.

41 : FairParGenericSet(),
42 fType(-1),
43 fXmin(0.),
44 fXmax(0.),
45 fYmin(0.),
46 fYmax(0.),
47 fZmin(0.),
48 fZmax(0.),
49 fBx(0.),
50 fBy(0.),
51 fBz(0.),
52 fMapName(""),
53 fPosX(0.),
54 fPosY(0.),
55 fPosZ(0.),
56 fScale(0.),
57 fPeak(0.),
58 fMiddle(0.)
59
60{}

◆ ~ShipFieldPar()

ShipFieldPar::~ShipFieldPar ( )

Destructor

Definition at line 64 of file ShipFieldPar.cxx.

64{}

◆ ShipFieldPar() [3/3]

ShipFieldPar::ShipFieldPar ( const ShipFieldPar )
privatedelete

Member Function Documentation

◆ ClassDef()

ShipFieldPar::ClassDef ( ShipFieldPar  ,
 
)
private

◆ GetBtube()

Double_t ShipFieldPar::GetBtube ( ) const
inline

Definition at line 53 of file ShipFieldPar.h.

53{ return fBtube; }
Double_t fBtube
Definition: ShipFieldPar.h:86

◆ GetBx()

Double_t ShipFieldPar::GetBx ( ) const
inline

Definition at line 43 of file ShipFieldPar.h.

43{ return fBx; }

◆ GetBy()

Double_t ShipFieldPar::GetBy ( ) const
inline

Definition at line 44 of file ShipFieldPar.h.

44{ return fBy; }

◆ GetBz()

Double_t ShipFieldPar::GetBz ( ) const
inline

Definition at line 45 of file ShipFieldPar.h.

45{ return fBz; }

◆ GetMiddle()

Double_t ShipFieldPar::GetMiddle ( ) const
inline

Definition at line 52 of file ShipFieldPar.h.

52{ return fMiddle; }

◆ getParams()

Bool_t ShipFieldPar::getParams ( FairParamList *  list)
virtual

Get parameters

Definition at line 97 of file ShipFieldPar.cxx.

97 {
98 if (!list) return kFALSE;
99
100 if (!list->fill("Field Type", &fType)) return kFALSE;
101
102 if (fType == 0) { // constant field
103 if (!list->fill("Field min x", &fXmin)) return kFALSE;
104 if (!list->fill("Field max x", &fXmax)) return kFALSE;
105 if (!list->fill("Field min y", &fYmin)) return kFALSE;
106 if (!list->fill("Field max y", &fYmax)) return kFALSE;
107 if (!list->fill("Field min z", &fZmin)) return kFALSE;
108 if (!list->fill("Field max z", &fZmax)) return kFALSE;
109 if (!list->fill("Field Bx", &fBx)) return kFALSE;
110 if (!list->fill("Field By", &fBy)) return kFALSE;
111 if (!list->fill("Field Bz", &fBz)) return kFALSE;
112
113 } else if (fType >= 1 && fType <= kMaxFieldMapType) {
114 if (!list->fill("Field Peak", &fPeak)) return kFALSE;
115 if (!list->fill("Field Middle", &fMiddle)) return kFALSE;
116
117 } else if (fType >= 2 && fType <= kMaxFieldMapType) { // field map
118 Text_t mapName[80];
119 if (!list->fill("Field map name", mapName, 80)) return kFALSE;
120 fMapName = mapName;
121 if (!list->fill("Field x position", &fPosX)) return kFALSE;
122 if (!list->fill("Field y position", &fPosY)) return kFALSE;
123 if (!list->fill("Field z position", &fPosZ)) return kFALSE;
124 if (!list->fill("Field scaling factor", &fScale)) return kFALSE;
125 }
126
127 return kTRUE;
128}
const int kMaxFieldMapType
Definition: ShipFieldPar.h:13

◆ GetPeak()

Double_t ShipFieldPar::GetPeak ( ) const
inline

Definition at line 51 of file ShipFieldPar.h.

51{ return fPeak; }

◆ GetPositionX()

Double_t ShipFieldPar::GetPositionX ( ) const
inline

Definition at line 47 of file ShipFieldPar.h.

47{ return fPosX; }

◆ GetPositionY()

Double_t ShipFieldPar::GetPositionY ( ) const
inline

Definition at line 48 of file ShipFieldPar.h.

48{ return fPosY; }

◆ GetPositionZ()

Double_t ShipFieldPar::GetPositionZ ( ) const
inline

Definition at line 49 of file ShipFieldPar.h.

49{ return fPosZ; }

◆ GetScale()

Double_t ShipFieldPar::GetScale ( ) const
inline

Definition at line 50 of file ShipFieldPar.h.

50{ return fScale; }

◆ GetType()

Int_t ShipFieldPar::GetType ( ) const
inline

Accessors

Definition at line 36 of file ShipFieldPar.h.

36{ return fType; }

◆ GetXmax()

Double_t ShipFieldPar::GetXmax ( ) const
inline

Definition at line 38 of file ShipFieldPar.h.

38{ return fXmax; }

◆ GetXmin()

Double_t ShipFieldPar::GetXmin ( ) const
inline

Definition at line 37 of file ShipFieldPar.h.

37{ return fXmin; }

◆ GetYmax()

Double_t ShipFieldPar::GetYmax ( ) const
inline

Definition at line 40 of file ShipFieldPar.h.

40{ return fYmax; }

◆ GetYmin()

Double_t ShipFieldPar::GetYmin ( ) const
inline

Definition at line 39 of file ShipFieldPar.h.

39{ return fYmin; }

◆ GetZmax()

Double_t ShipFieldPar::GetZmax ( ) const
inline

Definition at line 42 of file ShipFieldPar.h.

42{ return fZmax; }

◆ GetZmin()

Double_t ShipFieldPar::GetZmin ( ) const
inline

Definition at line 41 of file ShipFieldPar.h.

41{ return fZmin; }

◆ MapName()

void ShipFieldPar::MapName ( TString &  name)
inline

Definition at line 46 of file ShipFieldPar.h.

46{ name = fMapName; }

◆ operator=()

ShipFieldPar & ShipFieldPar::operator= ( const ShipFieldPar )
privatedelete

◆ putParams()

void ShipFieldPar::putParams ( FairParamList *  list)
virtual

Put parameters

Definition at line 68 of file ShipFieldPar.cxx.

68 {
69 if (!list) return;
70
71 list->add("Field Type", fType);
72
73 if (fType == 0) { // constant field
74 list->add("Field min x", fXmin);
75 list->add("Field max x", fXmax);
76 list->add("Field min y", fYmin);
77 list->add("Field max y", fYmax);
78 list->add("Field min z", fZmin);
79 list->add("Field max z", fZmax);
80 list->add("Field Bx", fBx);
81 list->add("Field By", fBy);
82 list->add("Field Bz", fBz);
83 } else if (fType >= 1 && fType <= kMaxFieldMapType) { //
84 list->add("Field Peak", fPeak);
85 list->add("Field Middle", fMiddle);
86 } else if (fType >= 2 && fType <= kMaxFieldMapType) { // field map
87 list->add("Field map name", fMapName);
88 list->add("Field x position", fPosX);
89 list->add("Field y position", fPosY);
90 list->add("Field z position", fPosZ);
91 list->add("Field scaling factor", fScale);
92 }
93}

◆ SetParameters()

void ShipFieldPar::SetParameters ( FairField *  field)

Set parameters from CbmField

Definition at line 131 of file ShipFieldPar.cxx.

131 {
132 if (!field) {
133 cerr << "-W- ShipFieldPar::SetParameters: Empty field pointer!" << endl;
134 return;
135 }
136
137 fType = field->GetType();
138
139 if (fType == 0) { // constant field
140 ShipConstField* fieldConst = dynamic_cast<ShipConstField*>(field);
141 fBx = fieldConst->GetBx();
142 fBy = fieldConst->GetBy();
143 fBz = fieldConst->GetBz();
144 fXmin = fieldConst->GetXmin();
145 fXmax = fieldConst->GetXmax();
146 fYmin = fieldConst->GetYmin();
147 fYmax = fieldConst->GetYmax();
148 fZmin = fieldConst->GetZmin();
149 fZmax = fieldConst->GetZmax();
150 fMapName = "";
151 fPosX = fPosY = fPosZ = fScale = 0.;
152 } else {
153 cerr << "-W- ShipFieldPar::SetParameters: Unknown field type " << fType
154 << "!" << endl;
155 fBx = fBy = fBz = 0.;
156 fXmin = fXmax = fYmin = fYmax = fZmin = fZmax = 0.;
157 fMapName = "";
158 fPosX = fPosY = fPosZ = fScale = 0.;
159 }
160
161 return;
162}
Double_t GetXmin() const
virtual Double_t GetBx(Double_t x, Double_t y, Double_t z)
virtual Double_t GetBy(Double_t x, Double_t y, Double_t z)
Double_t GetZmax() const
virtual Double_t GetBz(Double_t x, Double_t y, Double_t z)
Double_t GetYmax() const
Double_t GetYmin() const
Double_t GetZmin() const
Double_t GetXmax() const

Member Data Documentation

◆ fBtube

Double_t ShipFieldPar::fBtube
private

Definition at line 86 of file ShipFieldPar.h.

◆ fBx

Double_t ShipFieldPar::fBx
private

Field values in case of constant field [kG]

Definition at line 72 of file ShipFieldPar.h.

◆ fBy

Double_t ShipFieldPar::fBy
private

Definition at line 72 of file ShipFieldPar.h.

◆ fBz

Double_t ShipFieldPar::fBz
private

Definition at line 72 of file ShipFieldPar.h.

◆ fMapName

TString ShipFieldPar::fMapName
private

Field map name in case of field map

Definition at line 75 of file ShipFieldPar.h.

◆ fMiddle

Double_t ShipFieldPar::fMiddle
private

Definition at line 85 of file ShipFieldPar.h.

◆ fPeak

Double_t ShipFieldPar::fPeak
private

field parameters

Definition at line 84 of file ShipFieldPar.h.

◆ fPosX

Double_t ShipFieldPar::fPosX
private

Field centre position for field map

Definition at line 78 of file ShipFieldPar.h.

◆ fPosY

Double_t ShipFieldPar::fPosY
private

Definition at line 78 of file ShipFieldPar.h.

◆ fPosZ

Double_t ShipFieldPar::fPosZ
private

Definition at line 78 of file ShipFieldPar.h.

◆ fScale

Double_t ShipFieldPar::fScale
private

Scaling factor for field map

Definition at line 81 of file ShipFieldPar.h.

◆ fType

Int_t ShipFieldPar::fType
private

Field type 0 = constant field 1 = field map 2 = field map sym2 (symmetries in x and y) 3 = field map sym3 (symmetries in x, y and z) kTypeDistorted = distorted field map (its parent field can be field map or constant field)

Definition at line 64 of file ShipFieldPar.h.

◆ fXmax

Double_t ShipFieldPar::fXmax
private

Definition at line 67 of file ShipFieldPar.h.

◆ fXmin

Double_t ShipFieldPar::fXmin
private

Field limits in case of constant field

Definition at line 67 of file ShipFieldPar.h.

◆ fYmax

Double_t ShipFieldPar::fYmax
private

Definition at line 68 of file ShipFieldPar.h.

◆ fYmin

Double_t ShipFieldPar::fYmin
private

Definition at line 68 of file ShipFieldPar.h.

◆ fZmax

Double_t ShipFieldPar::fZmax
private

Definition at line 69 of file ShipFieldPar.h.

◆ fZmin

Double_t ShipFieldPar::fZmin
private

Definition at line 69 of file ShipFieldPar.h.


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