CbmRoot
CbmLitFieldApproximationQa.h
Go to the documentation of this file.
1 
8 #ifndef CBMLITFIELDAPPROXIMATIONQA_H_
9 #define CBMLITFIELDAPPROXIMATIONQA_H_
10 
11 #include "FairTask.h"
12 #include <string>
13 #include <vector>
14 
15 class FairField;
16 class CbmLitFieldFitter;
18 class CbmHistManager;
19 
20 using std::string;
21 using std::vector;
22 
34 class CbmLitFieldApproximationQa : public FairTask {
35 public:
40 
45 
49  virtual InitStatus Init();
50 
54  virtual void Exec(Option_t* opt);
55 
59  virtual void Finish();
60 
61  /* Setters */
62  void SetSliceZPosition(const vector<Double_t>& zPos) {
63  fZSlicePosition = zPos;
64  }
65  void SetPolynomDegrees(const vector<UInt_t>& degrees) {
66  fPolynomDegrees = degrees;
67  }
68  void IsFixedBounds(Bool_t fixedBounds) { fFixedBounds = fixedBounds; }
69  void SetAcceptanceAngleX(double xangle) { fAcceptanceAngleX = xangle; }
70  void SetAcceptanceAngleY(double yangle) { fAcceptanceAngleY = yangle; }
71  void SetNofBinsX(int nofBinsX) { fNofBinsX = nofBinsX; }
72  void SetNofBinsY(int nofBinsY) { fNofBinsY = nofBinsY; }
73  void SetUseEllipseAcc(bool useEllipseAcc) { fUseEllipseAcc = useEllipseAcc; }
74  void SetOutputDir(const string& dir) { fOutputDir = dir; }
75  void SetPolynomDegreeIndex(unsigned int degreeIndex) {
76  fPolynomDegreeIndex = degreeIndex;
77  }
78 
79 private:
83  void CreateHistos();
84 
88  void CreateFieldHistos();
89 
93  void CreateFitterHistos();
94 
98  void CreateGridHistos();
99 
103  void FillBHistos();
104 
109 
113  void FillGridCreatorHistos();
114 
115  // Pointer to the magnetic field map
116  FairField* fField;
117 
118  // Number of slices along Z for field approximation
119  Int_t fNofSlices;
120  // Slice is defined as rectangle at a certain Z position
121  // with upper left corner coordinate equals to [-X, -Y]
122  // and lower right corner coordinate equals to [X, Y].
123  // Z, X, Y coordinates for each slice.
124  // [slice number]
125  vector<Double_t> fZSlicePosition; // Z position of the slice
126  vector<Double_t> fXSlicePosition; // X coordinate
127  vector<Double_t> fYSlicePosition; // Y coordinate
128 
129  // Output directory for images
130  string fOutputDir;
131 
132  //
133  // Field approximation variables
134  //
135  // Acceptance angle for X
137  // Acceptance angle for Y
139  // Number of bins for X
140  Int_t fNofBinsX;
141  // Number of bins for Y
142  Int_t fNofBinsY;
143  // If true than only values inside an ellipse will be used for field approximation
145  // Degree of the polynom
147  // Number of polynoms for tests
148  UInt_t fNofPolynoms;
149  // Array with polynom degrees to be analyzed
150  vector<UInt_t> fPolynomDegrees;
151  // Field fitter tool for each polynom degree
152  vector<CbmLitFieldFitter*> fFitter;
153 
154  //
155  // Field grid
156  //
157  // Field grid creator tool
159 
160  CbmHistManager* fHM; // Histogram manager
161 
162  Bool_t fFixedBounds; // Fixed bounds for error histograms
163 
166 
168 };
169 
170 #endif /* CBMLITFIELDAPPROXIMATIONQA_H_ */
CbmLitFieldApproximationQa::fXSlicePosition
vector< Double_t > fXSlicePosition
Definition: CbmLitFieldApproximationQa.h:126
CbmLitFieldApproximationQa::CreateFieldHistos
void CreateFieldHistos()
Create field histograms.
Definition: CbmLitFieldApproximationQa.cxx:137
CbmLitFieldApproximationQa::Init
virtual InitStatus Init()
Inherited from FairTask.
Definition: CbmLitFieldApproximationQa.cxx:73
CbmLitFieldApproximationQa::Finish
virtual void Finish()
Inherited from FairTask.
Definition: CbmLitFieldApproximationQa.cxx:128
CbmLitFieldApproximationQa::fUseEllipseAcc
Bool_t fUseEllipseAcc
Definition: CbmLitFieldApproximationQa.h:144
CbmLitFieldApproximationQa::fPolynomDegrees
vector< UInt_t > fPolynomDegrees
Definition: CbmLitFieldApproximationQa.h:150
CbmLitFieldApproximationQa::FillBHistos
void FillBHistos()
Fill graphs and histos for field map for each field component (Bx, By, Bz, |B|).
Definition: CbmLitFieldApproximationQa.cxx:332
CbmLitFieldApproximationQa::fHM
CbmHistManager * fHM
Definition: CbmLitFieldApproximationQa.h:160
CbmLitFieldApproximationQa::operator=
CbmLitFieldApproximationQa & operator=(const CbmLitFieldApproximationQa &)
CbmLitFieldApproximationQa::SetSliceZPosition
void SetSliceZPosition(const vector< Double_t > &zPos)
Definition: CbmLitFieldApproximationQa.h:62
CbmLitFieldApproximationQa::fYSlicePosition
vector< Double_t > fYSlicePosition
Definition: CbmLitFieldApproximationQa.h:127
CbmLitFieldApproximationQa::SetAcceptanceAngleX
void SetAcceptanceAngleX(double xangle)
Definition: CbmLitFieldApproximationQa.h:69
CbmLitFieldApproximationQa::fNofBinsX
Int_t fNofBinsX
Definition: CbmLitFieldApproximationQa.h:140
CbmLitFieldApproximationQa::fNofSlices
Int_t fNofSlices
Definition: CbmLitFieldApproximationQa.h:119
CbmLitFieldGridCreator
Definition: CbmLitFieldGridCreator.h:17
CbmLitFieldApproximationQa::fNofBinsY
Int_t fNofBinsY
Definition: CbmLitFieldApproximationQa.h:142
CbmLitFieldApproximationQa::fPolynomDegreeIndex
UInt_t fPolynomDegreeIndex
Definition: CbmLitFieldApproximationQa.h:146
CbmLitFieldApproximationQa::FillFieldApproximationHistos
void FillFieldApproximationHistos()
Fill histograms for polynomial field approximation.
Definition: CbmLitFieldApproximationQa.cxx:371
CbmLitFieldApproximationQa::Exec
virtual void Exec(Option_t *opt)
Inherited from FairTask.
Definition: CbmLitFieldApproximationQa.cxx:126
CbmLitFieldApproximationQa::IsFixedBounds
void IsFixedBounds(Bool_t fixedBounds)
Definition: CbmLitFieldApproximationQa.h:68
CbmLitFieldApproximationQa::SetPolynomDegrees
void SetPolynomDegrees(const vector< UInt_t > &degrees)
Definition: CbmLitFieldApproximationQa.h:65
CbmLitFieldApproximationQa::fNofPolynoms
UInt_t fNofPolynoms
Definition: CbmLitFieldApproximationQa.h:148
CbmHistManager
Histogram manager.
Definition: CbmHistManager.h:41
CbmLitFieldApproximationQa::CbmLitFieldApproximationQa
CbmLitFieldApproximationQa()
Constructor.
Definition: CbmLitFieldApproximationQa.cxx:51
CbmLitFieldApproximationQa::SetPolynomDegreeIndex
void SetPolynomDegreeIndex(unsigned int degreeIndex)
Definition: CbmLitFieldApproximationQa.h:75
CbmLitFieldApproximationQa::~CbmLitFieldApproximationQa
virtual ~CbmLitFieldApproximationQa()
Destructor.
Definition: CbmLitFieldApproximationQa.cxx:71
CbmLitFieldApproximationQa::fField
FairField * fField
Definition: CbmLitFieldApproximationQa.h:116
CbmLitFieldApproximationQa::SetAcceptanceAngleY
void SetAcceptanceAngleY(double yangle)
Definition: CbmLitFieldApproximationQa.h:70
CbmLitFieldApproximationQa::fOutputDir
string fOutputDir
Definition: CbmLitFieldApproximationQa.h:130
CbmLitFieldApproximationQa
Field map approximation QA.
Definition: CbmLitFieldApproximationQa.h:34
CbmLitFieldApproximationQa::fGridCreator
CbmLitFieldGridCreator * fGridCreator
Definition: CbmLitFieldApproximationQa.h:158
CbmLitFieldApproximationQa::CreateGridHistos
void CreateGridHistos()
Create histograms for grid creator.
Definition: CbmLitFieldApproximationQa.cxx:247
CbmLitFieldApproximationQa::CbmLitFieldApproximationQa
CbmLitFieldApproximationQa(const CbmLitFieldApproximationQa &)
CbmLitFieldApproximationQa::SetOutputDir
void SetOutputDir(const string &dir)
Definition: CbmLitFieldApproximationQa.h:74
CbmLitFieldApproximationQa::CreateFitterHistos
void CreateFitterHistos()
Create histograms for field approximation.
Definition: CbmLitFieldApproximationQa.cxx:153
CbmLitFieldApproximationQa::fAcceptanceAngleY
Double_t fAcceptanceAngleY
Definition: CbmLitFieldApproximationQa.h:138
CbmLitFieldApproximationQa::fFitter
vector< CbmLitFieldFitter * > fFitter
Definition: CbmLitFieldApproximationQa.h:152
CbmLitFieldApproximationQa::FillGridCreatorHistos
void FillGridCreatorHistos()
fill histograms for grid creator tool.
Definition: CbmLitFieldApproximationQa.cxx:489
CbmLitFieldApproximationQa::SetNofBinsY
void SetNofBinsY(int nofBinsY)
Definition: CbmLitFieldApproximationQa.h:72
CbmLitFieldFitter
Implementation of the polynomial field approximation.
Definition: CbmLitFieldFitter.h:60
CbmLitFieldApproximationQa::ClassDef
ClassDef(CbmLitFieldApproximationQa, 1)
CbmLitFieldApproximationQa::fFixedBounds
Bool_t fFixedBounds
Definition: CbmLitFieldApproximationQa.h:162
CbmLitFieldApproximationQa::SetUseEllipseAcc
void SetUseEllipseAcc(bool useEllipseAcc)
Definition: CbmLitFieldApproximationQa.h:73
CbmLitFieldApproximationQa::fZSlicePosition
vector< Double_t > fZSlicePosition
Definition: CbmLitFieldApproximationQa.h:125
CbmLitFieldApproximationQa::CreateHistos
void CreateHistos()
Create histograms.
Definition: CbmLitFieldApproximationQa.cxx:130
CbmLitFieldApproximationQa::fAcceptanceAngleX
Double_t fAcceptanceAngleX
Definition: CbmLitFieldApproximationQa.h:136
CbmLitFieldApproximationQa::SetNofBinsX
void SetNofBinsX(int nofBinsX)
Definition: CbmLitFieldApproximationQa.h:71