SND@LHC Software
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 &)
 
ShipFieldParoperator= (const ShipFieldPar &)
 
 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 11 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 14 of file ShipFieldPar.cxx.

16 : FairParGenericSet(name, title, context),
17 fType(-1),
18 fXmin(0.),
19 fXmax(0.),
20 fYmin(0.),
21 fYmax(0.),
22 fZmin(0.),
23 fZmax(0.),
24 fBx(0.),
25 fBy(0.),
26 fBz(0.),
27 fMapName(""),
28 fPosX(0.),
29 fPosY(0.),
30 fPosZ(0.),
31 fScale(0.),
32 fPeak(0.),
33 fMiddle(0.)
34
35{
36}
TString fMapName
Double_t fYmin
Double_t fBy
Double_t fZmin
Double_t fPosZ
Double_t fPeak
Double_t fMiddle
Double_t fPosX
Double_t fYmax
Double_t fBz
Double_t fZmax
Double_t fBx
Double_t fXmax
Double_t fScale
Double_t fXmin
Double_t fPosY

◆ ShipFieldPar() [2/3]

ShipFieldPar::ShipFieldPar ( )

default constructor

Definition at line 39 of file ShipFieldPar.cxx.

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

◆ ~ShipFieldPar()

ShipFieldPar::~ShipFieldPar ( )

Destructor

Definition at line 64 of file ShipFieldPar.cxx.

64{ }

◆ ShipFieldPar() [3/3]

ShipFieldPar::ShipFieldPar ( const ShipFieldPar )
private

Member Function Documentation

◆ ClassDef()

ShipFieldPar::ClassDef ( ShipFieldPar  ,
 
)
private

◆ GetBtube()

Double_t ShipFieldPar::GetBtube ( ) const
inline

Definition at line 57 of file ShipFieldPar.h.

57{ return fBtube; }
Double_t fBtube

◆ GetBx()

Double_t ShipFieldPar::GetBx ( ) const
inline

Definition at line 47 of file ShipFieldPar.h.

47{ return fBx; }

◆ GetBy()

Double_t ShipFieldPar::GetBy ( ) const
inline

Definition at line 48 of file ShipFieldPar.h.

48{ return fBy; }

◆ GetBz()

Double_t ShipFieldPar::GetBz ( ) const
inline

Definition at line 49 of file ShipFieldPar.h.

49{ return fBz; }

◆ GetMiddle()

Double_t ShipFieldPar::GetMiddle ( ) const
inline

Definition at line 56 of file ShipFieldPar.h.

56{ return fMiddle; }

◆ getParams()

Bool_t ShipFieldPar::getParams ( FairParamList *  list)
virtual

Get parameters

Definition at line 104 of file ShipFieldPar.cxx.

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

◆ GetPeak()

Double_t ShipFieldPar::GetPeak ( ) const
inline

Definition at line 55 of file ShipFieldPar.h.

55{ return fPeak; }

◆ GetPositionX()

Double_t ShipFieldPar::GetPositionX ( ) const
inline

Definition at line 51 of file ShipFieldPar.h.

51{ return fPosX; }

◆ GetPositionY()

Double_t ShipFieldPar::GetPositionY ( ) const
inline

Definition at line 52 of file ShipFieldPar.h.

52{ return fPosY; }

◆ GetPositionZ()

Double_t ShipFieldPar::GetPositionZ ( ) const
inline

Definition at line 53 of file ShipFieldPar.h.

53{ return fPosZ; }

◆ GetScale()

Double_t ShipFieldPar::GetScale ( ) const
inline

Definition at line 54 of file ShipFieldPar.h.

54{ return fScale; }

◆ GetType()

Int_t ShipFieldPar::GetType ( ) const
inline

Accessors

Definition at line 40 of file ShipFieldPar.h.

40{ return fType; }

◆ GetXmax()

Double_t ShipFieldPar::GetXmax ( ) const
inline

Definition at line 42 of file ShipFieldPar.h.

42{ return fXmax; }

◆ GetXmin()

Double_t ShipFieldPar::GetXmin ( ) const
inline

Definition at line 41 of file ShipFieldPar.h.

41{ return fXmin; }

◆ GetYmax()

Double_t ShipFieldPar::GetYmax ( ) const
inline

Definition at line 44 of file ShipFieldPar.h.

44{ return fYmax; }

◆ GetYmin()

Double_t ShipFieldPar::GetYmin ( ) const
inline

Definition at line 43 of file ShipFieldPar.h.

43{ return fYmin; }

◆ GetZmax()

Double_t ShipFieldPar::GetZmax ( ) const
inline

Definition at line 46 of file ShipFieldPar.h.

46{ return fZmax; }

◆ GetZmin()

Double_t ShipFieldPar::GetZmin ( ) const
inline

Definition at line 45 of file ShipFieldPar.h.

45{ return fZmin; }

◆ MapName()

void ShipFieldPar::MapName ( TString &  name)
inline

Definition at line 50 of file ShipFieldPar.h.

◆ operator=()

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

◆ putParams()

void ShipFieldPar::putParams ( FairParamList *  list)
virtual

Put parameters

Definition at line 70 of file ShipFieldPar.cxx.

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

◆ SetParameters()

void ShipFieldPar::SetParameters ( FairField *  field)

Set parameters from CbmField

Definition at line 144 of file ShipFieldPar.cxx.

144 {
145
146 if ( ! field ) {
147 cerr << "-W- ShipFieldPar::SetParameters: Empty field pointer!" << endl;
148 return;
149 }
150
151 fType = field->GetType();
152
153 if ( fType == 0 ) { // constant field
154 ShipConstField* fieldConst = (ShipConstField*) field;
155 fBx = fieldConst->GetBx();
156 fBy = fieldConst->GetBy();
157 fBz = fieldConst->GetBz();
158 fXmin = fieldConst->GetXmin();
159 fXmax = fieldConst->GetXmax();
160 fYmin = fieldConst->GetYmin();
161 fYmax = fieldConst->GetYmax();
162 fZmin = fieldConst->GetZmin();
163 fZmax = fieldConst->GetZmax();
164 fMapName = "";
165 fPosX = fPosY = fPosZ = fScale = 0.;
166 } else {
167 cerr << "-W- ShipFieldPar::SetParameters: Unknown field type "
168 << fType << "!" << endl;
169 fBx = fBy = fBz = 0.;
170 fXmin = fXmax = fYmin = fYmax = fZmin = fZmax = 0.;
171 fMapName = "";
172 fPosX = fPosY = fPosZ = fScale = 0.;
173 }
174
175 return;
176
177}
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 96 of file ShipFieldPar.h.

◆ fBx

Double_t ShipFieldPar::fBx
private

Field values in case of constant field [kG]

Definition at line 79 of file ShipFieldPar.h.

◆ fBy

Double_t ShipFieldPar::fBy
private

Definition at line 79 of file ShipFieldPar.h.

◆ fBz

Double_t ShipFieldPar::fBz
private

Definition at line 79 of file ShipFieldPar.h.

◆ fMapName

TString ShipFieldPar::fMapName
private

Field map name in case of field map

Definition at line 83 of file ShipFieldPar.h.

◆ fMiddle

Double_t ShipFieldPar::fMiddle
private

Definition at line 95 of file ShipFieldPar.h.

◆ fPeak

Double_t ShipFieldPar::fPeak
private

field parameters

Definition at line 94 of file ShipFieldPar.h.

◆ fPosX

Double_t ShipFieldPar::fPosX
private

Field centre position for field map

Definition at line 87 of file ShipFieldPar.h.

◆ fPosY

Double_t ShipFieldPar::fPosY
private

Definition at line 87 of file ShipFieldPar.h.

◆ fPosZ

Double_t ShipFieldPar::fPosZ
private

Definition at line 87 of file ShipFieldPar.h.

◆ fScale

Double_t ShipFieldPar::fScale
private

Scaling factor for field map

Definition at line 91 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 69 of file ShipFieldPar.h.

◆ fXmax

Double_t ShipFieldPar::fXmax
private

Definition at line 73 of file ShipFieldPar.h.

◆ fXmin

Double_t ShipFieldPar::fXmin
private

Field limits in case of constant field

Definition at line 73 of file ShipFieldPar.h.

◆ fYmax

Double_t ShipFieldPar::fYmax
private

Definition at line 74 of file ShipFieldPar.h.

◆ fYmin

Double_t ShipFieldPar::fYmin
private

Definition at line 74 of file ShipFieldPar.h.

◆ fZmax

Double_t ShipFieldPar::fZmax
private

Definition at line 75 of file ShipFieldPar.h.

◆ fZmin

Double_t ShipFieldPar::fZmin
private

Definition at line 75 of file ShipFieldPar.h.


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