#include <ShapeDrawer.h>
|
| ShapeDrawer (int pars) |
| Constructor (takes ownership of LArCellInfo object) More...
|
|
TGraphErrors * | graph (const AbsShape &shape, const char *title="") const |
|
TGraphErrors * | draw (const AbsShape *shape, const char *title="", bool drawAxes=true, const char *gopt="P") const |
|
bool | draw (const char *title, const std::vector< const AbsShape * > &shapes, const AbsShape *reference=0, const AbsShape *refSamples=0) const |
|
bool | draw (const char *title, const AbsShape *shape, const AbsShape *reference=0, const AbsShape *refSamples=0) const |
|
bool | drawAndDelete (const char *title, const std::vector< const AbsShape * > &shapes, const AbsShape *reference=0, const AbsShape *refSamples=0) const |
|
bool | drawAndDelete (const char *title, const AbsShape *shape, const AbsShape *reference=0, const AbsShape *refSamples=0) const |
|
bool | colorize (TGraphErrors *data, unsigned int index) const |
|
bool | yAxisLimits (const std::vector< const AbsShape * > &shapes, double &yMin, double &yMax) const |
|
Definition at line 26 of file ShapeDrawer.h.
◆ ShapeDrawer()
LArSamples::ShapeDrawer::ShapeDrawer |
( |
int |
pars | ) |
|
|
inline |
◆ colorize()
bool ShapeDrawer::colorize |
( |
TGraphErrors * |
data, |
|
|
unsigned int |
index |
|
) |
| const |
Definition at line 202 of file ShapeDrawer.cxx.
204 if (!
data)
return false;
205 const int nColors = 5;
206 int colors[nColors] = { 2,4,6,8,14 };
209 data->SetMarkerStyle(20 + ((
index/nColors) % 50));
210 data->SetMarkerSize(1);
◆ draw() [1/3]
TGraphErrors * ShapeDrawer::draw |
( |
const AbsShape * |
shape, |
|
|
const char * |
title = "" , |
|
|
bool |
drawAxes = true , |
|
|
const char * |
gopt = "P" |
|
) |
| const |
Definition at line 41 of file ShapeDrawer.cxx.
44 g->Draw(TString(drawAxes ?
"A" :
"") + gopt);
◆ draw() [2/3]
Definition at line 172 of file ShapeDrawer.cxx.
174 std::vector<const AbsShape*> shapes;
175 shapes.push_back(shape);
◆ draw() [3/3]
Definition at line 49 of file ShapeDrawer.cxx.
52 if (shapes.empty())
return false;
55 gStyle->SetTitleXOffset(1.0);
56 gStyle->SetPadTopMargin(0.13);
57 gStyle->SetPadBottomMargin(0.12);
58 gStyle->SetPadRightMargin(0.05);
59 gStyle->SetPadLeftMargin(0.12);
64 legend =
new TLegend(0.45, 0.7, 0.8, 0.5,
"",
"NDC");
67 legend =
new TLegend(0.6, 0.85, 0.85, 0.85 - 0.1*shapes.size(),
"",
"NDC");
86 l.DrawLatex(0.12,0.89,
title);
◆ drawAndDelete() [1/2]
◆ drawAndDelete() [2/2]
◆ drawData()
Definition at line 133 of file ShapeDrawer.cxx.
137 double yMin = 0, yMax = 0;
138 if (!
yAxisLimits(shapes, yMin, yMax))
return false;
139 cout <<
"Y limits = " << yMin <<
" " << yMax << endl;
140 for (
unsigned int i = 0;
i < shapes.size();
i++) {
141 if (!shapes[
i])
return false;
143 data->SetMinimum(yMin);
144 data->SetMaximum(yMax);
145 data->SetName(Form(
"data%d",
i));
147 data->GetXaxis()->SetLimits(-10, 800);
148 data->SetMarkerColor(2);
149 data->SetMarkerStyle(20);
150 data->SetMarkerSize(1.3);
154 data->Draw(
"P" + TString((
first &&
i == 0) ?
"A" :
""));
158 ((TLegendEntry*)
legend->GetListOfPrimitives()->Last())->SetTextColor(
data->GetMarkerColor());
163 legend->AddEntry(
data, Form(
"#chi^{2}/n = %.2f/%-2d",
c2, c2c.
nDof()),
"P");
164 ((TLegendEntry*)
legend->GetListOfPrimitives()->Last())->SetTextColor(
data->GetMarkerColor());
◆ drawRef()
Definition at line 98 of file ShapeDrawer.cxx.
104 ref->SetName(
"reference");
105 ref->SetMarkerStyle(21);
106 ref->SetMarkerSize(0.3);
107 ref->SetMarkerColor(4);
108 ref->SetLineColor(4);
109 ref->SetLineWidth(3);
112 TGraphErrors* refBigMarkers =
new TGraphErrors(*
ref);
113 refBigMarkers->SetMarkerSize(1);
114 legend->AddEntry(refBigMarkers,
"Prediction",
"L");
115 ((TLegendEntry*)
legend->GetListOfPrimitives()->Last())->SetTextColor(
ref->GetMarkerColor());
121 ref->SetName(
"reference");
124 TGraphErrors* ref2 =
graph(*refSamples);
125 ref->SetName(
"reference_samples");
126 ref2->SetMarkerSize(1);
◆ graph()
TGraphErrors * ShapeDrawer::graph |
( |
const AbsShape & |
shape, |
|
|
const char * |
title = "" |
|
) |
| const |
Definition at line 27 of file ShapeDrawer.cxx.
30 TGraphErrors*
graph = shape.
graph(samplingTimeUnits);
32 graph->SetMarkerStyle(20);
33 graph->SetMarkerSize(0.4);
34 graph->GetXaxis()->SetTitle(samplingTimeUnits ?
"Sample Index" :
"Time [ns]");
35 graph->GetYaxis()->SetTitle(
"ADC counts");
36 graph->GetYaxis()->SetTitleOffset(1.25);
◆ yAxisLimits()
bool ShapeDrawer::yAxisLimits |
( |
const std::vector< const AbsShape * > & |
shapes, |
|
|
double & |
yMin, |
|
|
double & |
yMax |
|
) |
| const |
Definition at line 215 of file ShapeDrawer.cxx.
219 for (
unsigned int i = 0;
i < shapes.size();
i++) {
220 double sMin = shapes[
i]->minValue(
true);
221 double sMax = shapes[
i]->maxValue(
true);
222 if (sMin < yMin) yMin = sMin;
223 if (sMax > yMax) yMax = sMax;
◆ m_pars
int LArSamples::ShapeDrawer::m_pars |
|
private |
The documentation for this class was generated from the following files: