35 , fParentField(nullptr)
37 , fDistortionFilename(
"")
38 , fBxDistortionFormulaMult(nullptr)
39 , fBxDistortionFormulaAdd(nullptr)
40 , fByDistortionFormulaMult(nullptr)
41 , fByDistortionFormulaAdd(nullptr)
42 , fBzDistortionFormulaMult(nullptr)
43 , fBzDistortionFormulaAdd(nullptr)
52 const char* parentName,
const char* fileTypeParent, Int_t pfTypeOfParent)
54 , fParentField(nullptr)
55 , fTypeOfParent(pfTypeOfParent)
56 , fDistortionFilename(pfDistortionFilename)
57 , fBxDistortionFormulaMult(nullptr)
58 , fBxDistortionFormulaAdd(nullptr)
59 , fByDistortionFormulaMult(nullptr)
60 , fByDistortionFormulaAdd(nullptr)
61 , fBzDistortionFormulaMult(nullptr)
62 , fBzDistortionFormulaAdd(nullptr)
67 switch (pfTypeOfParent) {
78 Double_t zMax, Double_t bX, Double_t bY, Double_t bZ,
const char* mapName,
79 const char* pfDistortionFilename,
const char* parentname)
81 , fParentField(new
CbmFieldConst(parentname, xMin, xMax, yMin, yMax, zMin, zMax, bX, bY, bZ))
83 , fDistortionFilename(pfDistortionFilename)
84 , fBxDistortionFormulaMult(nullptr)
85 , fBxDistortionFormulaAdd(nullptr)
86 , fByDistortionFormulaMult(nullptr)
87 , fByDistortionFormulaAdd(nullptr)
88 , fBzDistortionFormulaMult(nullptr)
89 , fBzDistortionFormulaAdd(nullptr)
99 , fParentField(nullptr)
101 , fDistortionFilename(
"")
102 , fBxDistortionFormulaMult(nullptr)
103 , fBxDistortionFormulaAdd(nullptr)
104 , fByDistortionFormulaMult(nullptr)
105 , fByDistortionFormulaAdd(nullptr)
106 , fBzDistortionFormulaMult(nullptr)
107 , fBzDistortionFormulaAdd(nullptr)
171 Double_t po[3], b[3];
175 GetFieldValue(po, b);
238 TFile* oldFile = gFile;
239 TDirectory* oldDir = gDirectory;
247 cerr <<
"CbmFieldMapDistorted::ReadDistortionInformation Warning: file " << (
fDistortionFilename.Data())
248 <<
" not exists yet !!!" << endl;
268 cerr <<
"CbmFieldMapDistorted::ReadDistortionInformation ERROR: file " << (
fDistortionFilename.Data())
269 <<
" can not be read !!!" << endl;
283 TFile* oldFile = gFile;
284 TDirectory* oldDir = gDirectory;
319 TString co = component_option;
320 TString ao = action_option;
335 const char* action_option)
337 TString co = component_option;
338 TString ao = action_option;
341 if (co.Contains(
"y") && ao.Contains(
"m")) {
345 if (co.Contains(
"y") && ao.Contains(
"a")) {
350 if (co.Contains(
"x") && ao.Contains(
"m")) {
354 if (co.Contains(
"x") && ao.Contains(
"a")) {
359 if (co.Contains(
"z") && ao.Contains(
"m")) {
363 if (co.Contains(
"z") && ao.Contains(
"a")) {
371 const char* action_option)
373 TString co = component_option;
374 TString ao = action_option;
377 if (co.Contains(
"y") && ao.Contains(
"m")) {
381 if (co.Contains(
"y") && ao.Contains(
"a")) {
386 if (co.Contains(
"x") && ao.Contains(
"m")) {
390 if (co.Contains(
"x") && ao.Contains(
"a")) {
395 if (co.Contains(
"z") && ao.Contains(
"m")) {
399 if (co.Contains(
"z") && ao.Contains(
"a")) {
443 cout <<
"=============================================================" << endl;
444 cout <<
"---- " << fTitle <<
" : " << fName << endl;
446 cout <<
"== Parent Field: ==" << endl;
448 cout <<
"==============================" << endl;
450 cout <<
"== Distortion Information File : ==" << endl;
452 cout <<
"==============================" << endl;
454 cout <<
"== Bx Distortion Formula Mult : ==" << endl;
456 cout <<
"== Bx Distortion Formula Add : ==" << endl;
458 cout <<
"==============================" << endl;
460 cout <<
"== By Distortion Formula Mult : ==" << endl;
462 cout <<
"== By Distortion Formula Add : ==" << endl;
464 cout <<
"==============================" << endl;
466 cout <<
"== Bz Distortion Formula Mult : ==" << endl;
468 cout <<
"== Bz Distortion Formula Add : ==" << endl;
470 cout <<
"==============================" << endl;
476 cout <<
"=============================================================" << endl;
505 Double_t dz = (zmax - zmin) / n0;
507 h =
new TH1D(
"hField", fName, n, zmin, zmax);
508 for (Int_t i = 0; i < n0; i++)
509 h->SetBinContent(i + 1,
GetBy(0., 0., zmin + i * dz));
514 hp =
new TH1D(
"hFieldParent",
fParentField->GetName(), n, zmin, zmax);
515 for (Int_t i = 0; i < n0; i++)
516 hp->SetBinContent(i + 1,
fParentField->GetBy(0., 0., zmin + i * dz));
TFormula * fBxDistortionFormulaMult
TFormula * fByDistortionFormulaMult
getter/setter options: ("x","m"), ("x","a")
virtual void SetFromParent(FairField *field)
TFormula * fBxDistortionFormulaAdd
virtual void SetPosition(Double_t x, Double_t y, Double_t z)
virtual TFormula * GetDistortionFormula(const char *component_option="y", const char *action_option="m")
TString fDistortionFilename
void ReadDistortionInformation(const char *filename=0)
TFormula * fByDistortionFormulaAdd
TFormula * fBzDistortionFormulaAdd
virtual ~CbmFieldMapDistorted()
void PlotBy(Int_t n=250, Double_t zmin=-50, Double_t zmax=450)
void WriteDistortionInformation(const char *filename=0)
virtual void SetScale(Double_t factor)
virtual Bool_t SetDistortionFormula(TFormula *parDistortionFormula, const char *component_option="y", const char *action_option="m")
TFormula * fBzDistortionFormulaMult
getter/setter options: ("y","m"), ("y","a")
virtual void Print(Option_t *="") const
Double_t fBxOrigin
Interpolated field (1-dim)
Double_t GetXstep() const
Double_t GetPositionY() const
Double_t GetYstep() const
Double_t GetPositionZ() const
Double_t GetPositionX() const
Double_t fBzOrigin
y-component of the field at the origin
Double_t GetZstep() const
Double_t fByOrigin
x-component of the field at the origin
Double_t GetScale() const
Double_t GetPositionZ() const
Int_t GetTypeOfParent() const
void GetParentName(TString &parentname)
void GetDistortionFilename(TString &filename)
void MapName(TString &name)
Double_t GetPositionY() const
Double_t GetScale() const
Double_t GetPositionX() const
Data class with information on a STS local track.