Go to the documentation of this file.
17 #include <boost/assign/list_inserter.hpp>
18 #include <boost/assign/list_of.hpp>
20 using boost::assign::list_of;
21 using boost::assign::push_back;
36 Out() <<
R()->
Title(0,
"Magnetic field QA") << std::endl;
116 vector<TGraph2D*> graphs2D =
HM()->
G2Vector(
"hfa_" + b +
"_Graph2D_.*");
117 for (Int_t
i = 0;
i < graphs2D.size();
i++) {
118 string name = graphs2D[
i]->GetName();
119 string canvasName =
GetReportName() +
"_slice_" + b +
"_" +
m +
"_at_z_"
120 +
Split(name,
'_')[3];
122 CreateCanvas(canvasName.c_str(), canvasName.c_str(), 1000, 1000);
123 canvas->Divide(3, 2);
127 name,
"_" + b +
"_Graph2D_",
"_" + b +
"Err" +
m +
"_H1_"));
129 name,
"_" + b +
"_Graph2D_",
"_" + b +
"Err" +
m +
"_H2_"));
131 name,
"_" + b +
"_Graph2D_",
"_" + b +
"RelErr" +
m +
"_H1_"));
133 name,
"_" + b +
"_Graph2D_",
"_" + b +
"RelErr" +
m +
"_H2_"));
150 vector<TGraph2D*> graphs2D =
HM()->
G2Vector(
"hfa_Bx_Graph2D_.*");
151 for (Int_t
i = 0;
i < graphs2D.size();
i++) {
152 string z =
Split(graphs2D[
i]->GetName(),
'_')[3];
153 string canvasName =
GetReportName() +
"_" + err +
"_degree_z_" + z;
155 CreateCanvas(canvasName.c_str(), canvasName.c_str(), 1000, 1000);
156 canvas->Divide(3, 2);
158 TLegend* l1 =
new TLegend(0.1, 0.1, 0.9, 0.9);
159 l1->SetFillColor(kWhite);
160 l1->SetTextSize(0.1);
162 l1->SetHeader(
"Polynomial degree");
168 vector<TH1*> errBx =
HM()->
H1Vector(
"hfa_Bx" + err +
"Apr_H1_" + z +
"_.*");
169 if (errBx.empty())
return;
170 vector<TH1*> errBy(errBx.size());
171 vector<TH1*> errBz(errBx.size());
172 vector<TH1*> errMod(errBx.size());
173 for (Int_t iP = 0; iP < errBx.size(); iP++) {
174 string name = errBx[iP]->GetName();
179 string draw_opt = (iP == 0) ?
"" :
"SAME";
221 string degree =
Split(name,
'_')[4];
222 l1->AddEntry(errBx[iP], degree.c_str(),
"lp");
224 maxBx =
std::max(maxBx, errBx[iP]->GetMaximum());
225 maxBy =
std::max(maxBy, errBy[iP]->GetMaximum());
226 maxBz =
std::max(maxBz, errBz[iP]->GetMaximum());
227 maxMod =
std::max(maxMod, errMod[iP]->GetMaximum());
229 errBx[0]->SetMaximum(1.1 * maxBx);
230 errBy[0]->SetMaximum(1.1 * maxBy);
231 errBz[0]->SetMaximum(1.1 * maxBz);
232 errMod[0]->SetMaximum(1.1 * maxMod);
TCanvas * CreateCanvas(const char *name, const char *title, Int_t ww, Int_t wh)
Create canvas and put it to vector of TCanvases. Canvases created with this function will be automati...
virtual std::string DocumentBegin() const =0
Return string with open tags for document.
void DrawSlices(const std::string &component, const std::string &opt)
Draw canvas with histograms for each approximated slice.
virtual void Draw()
Inherited from CbmSimulationReport.
string FindAndReplace(const string &name, const string &oldSubstr, const string &newSubstr)
virtual std::string DocumentEnd() const =0
Return string with close tags of the document.
void DrawGraph2D(TGraph2D *graph, HistScale logx, HistScale logy, HistScale logz, const string &drawOpt)
TH2 * H2(const std::string &name) const
Return pointer to TH2 histogram.
const std::string & GetReportName() const
const CbmReportElement * R() const
Accessor to CbmReportElement object. User has to write the report using available tags from CbmReport...
Helper functions for drawing 1D and 2D histograms and graphs.
Abstract class for basic report elements (headers, tables, images etc.).
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
void SetReportName(const std::string &name)
std::vector< TGraph2D * > G2Vector(const std::string &pattern) const
Return vector of pointers to TGraph2D.
void DrawH1(TH1 *hist, HistScale logx, HistScale logy, const string &drawOpt, Int_t color, Int_t lineWidth, Int_t lineStyle, Int_t markerSize, Int_t markerStyle)
void PrintCanvases() const
Print images created from canvases in the report.
static Int_t MarkerSize()
CbmLitFieldApproximationQaReport()
Constructor.
std::string PrintSummaryTable()
Return string with summary table for field QA.
TGraph2D * G2(const std::string &name) const
Return pointer to TGraph2D.
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
TH1 * H1(const std::string &name) const
Return pointer to TH1 histogram.
virtual void Create()
Inherited from CbmSimulationReport.
void DrawApr(const std::string &err)
Draw comparison for different polynomial orders for each slice.
std::vector< TH1 * > H1Vector(const std::string &pattern) const
Return vector of pointers to TH1 histogram.
CbmHistManager * HM() const
Return pointer to Histogram manager.
std::ostream & Out() const
All text output goes to this stream.
void DrawH2(TH2 *hist, HistScale logx, HistScale logy, HistScale logz, const string &drawOpt)
void SetDefaultDrawStyle()
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
virtual std::string Title(int size, const std::string &title) const =0
Return string with title.
virtual ~CbmLitFieldApproximationQaReport()
Destructor.
std::string ToString(const T &value)
vector< string > Split(const string &name, char delimiter)