14 #include "TGraphErrors.h"
15 #include "TMultiGraph.h"
20 #include "TPaveStats.h"
27 #include "ProgressBar.hh"
29 #include "ScatterGraph.hh"
107 const std::string& var)
const;
118 const std::string& varx,
119 const std::string& vary)
const;
130 const std::string& varx,
131 const std::string& vary)
const;
139 THStack*
NewStack(std::map<std::string, TH1F*> hists)
const;
149 std::map<std::string, TPaveStats*>
NewStackStats(std::map<std::string, TH1F*> hists,
150 const std::string draw_opt=
"EMR",
151 double* hoffset=NULL)
const;
161 const double hoffset = 0)
const;
170 THStack*
DrawStack(std::map<std::string, TH1F*> hists,
171 const std::string& name)
const;
179 void SaveStack(std::map<std::string, TH1F*> hists,
180 const std::string& name,
181 bool ratio=
false)
const;
189 TMultiGraph*
NewMultiGraph(std::map<std::string, TGraphErrors*> graphs)
const;
199 const std::string corner=
"tr")
const;
213 const double& maxx)
const;
223 TMultiGraph*
DrawMultiGraph(std::map<std::string, TGraphErrors*> graphs,
224 const std::string& name,
234 const std::string& name,
245 bool fit =
false)
const;
267 const std::string& type)
const;
275 const std::string& type)
const;
283 const double& maxy)
const;
291 std::string
FindBestCorner(std::map<std::string, TGraphErrors*> graphs)
const;
298 void SaveGIF(
const std::string& name,
299 const std::vector<TCanvas*>& canv)
const;
int marker_size
Marker size.
Definition: Drawer.hh:45
void SaveStack(std::map< std::string, TH1F * > hists, const std::string &name, bool ratio=false) const
Saves superimposed data types histograms.
Definition: Drawer.cc:188
TMultiGraph * NewMultiGraph(std::map< std::string, TGraphErrors * > graphs) const
Initializes a multigraph of graphs of different data types.
Definition: Drawer.cc:254
~Drawer()
Destructor.
Definition: Drawer.cc:36
std::map< std::string, TPaveStats * > NewStackStats(std::map< std::string, TH1F * > hists, const std::string draw_opt="EMR", double *hoffset=NULL) const
Intializes stat boxes for a stack of histogram of different data types.
Definition: Drawer.cc:130
void SaveGIF(const std::string &name, const std::vector< TCanvas * > &canv) const
Saves the canvases, in order, to a single GIF.
Definition: Drawer.cc:536
TLegend * NewStackLegend(std::map< std::string, TH1F * > hists, const double hoffset=0) const
Intializes a legend for a stack of histogram of different data types.
Definition: Drawer.cc:116
int fill_style
Fill pattern (TAttFill code)
Definition: Drawer.hh:40
double ulim
Upper limit of the corresponding axis.
Definition: Drawer.hh:57
THStack * DrawStack(std::map< std::string, TH1F * > hists, const std::string &name) const
Draws superimposed data types histograms.
Definition: Drawer.cc:165
ScatterGraph * NewAmplitudeScatter(const std::string &name, const std::string &varx, const std::string &vary) const
Returns a scatter plot with an amplitude color scale.
Definition: Drawer.cc:80
void SetInfoBox(InfoBox *info)
Sets the info box.
Definition: Drawer.hh:251
void SetVariableSettings(const std::string &var, const VarSet &varset)
Sets custom settings for the specified variable.
Definition: Drawer.hh:86
Structure that stores the drawing options of each data type.
Definition: Drawer.hh:35
TLegend * NewMultiGraphLegend(std::map< std::string, TGraphErrors * > graphs, const std::string corner="tr") const
Intializes a legend for a multigraph of different data types.
Definition: Drawer.cc:273
void SetVariableLimits(const std::string &var, double llim, double ulim)
Sets the limits of the specified variable.
Definition: Drawer.cc:42
int fill_color
Fill color (TColor code)
Definition: Drawer.hh:41
void DrawMICEModules(const double &miny, const double &maxy) const
Draws the MICE beam line elements onto an evolution graph.
Definition: Drawer.cc:481
std::map< std::string, DrawOpt > _options
Drawing options for each data type.
Definition: Drawer.hh:303
double llim
Lower limit of the corresponding axis.
Definition: Drawer.hh:56
const char * title
Long name of the data type.
Definition: Drawer.hh:36
std::string FindBestCorner(std::map< std::string, TGraphErrors * > graphs) const
Finds the corner that leasts overlaps the graph.
Definition: Drawer.cc:503
Drawer()
Default constructor, intializes the default drawing options.
Definition: Drawer.cc:5
TH2F * New2DHistogram(const std::string &name, const std::string &varx, const std::string &vary) const
Defines an appropriate TH1F to draw two of the phase space component.
Definition: Drawer.cc:66
void SetStyle(TH1 *obj, const std::string &type) const
Sets the histogram style according to the predefined options.
Definition: Drawer.cc:445
std::string label
Label of the variable to be drawn.
Definition: Drawer.hh:54
Drawer & operator=(const Drawer &dra)
Equality operator.
Definition: Drawer.cc:21
size_t nbins
Number of bins.
Definition: Drawer.hh:58
int marker_color
Marker color (TColor code)
Definition: Drawer.hh:44
int line_color
Line color (TColor code)
Definition: Drawer.hh:38
int marker_style
Marker shape (TAttMarker code)
Definition: Drawer.hh:43
THStack * NewStack(std::map< std::string, TH1F * > hists) const
Initializes a stack of histograms of different data types.
Definition: Drawer.cc:97
int fill_alpha
Fill opacity (From 0=transparent to 1=opaque)
Definition: Drawer.hh:42
void SaveMultiGraph(std::map< std::string, TGraphErrors * > graphs, const std::string &name, TF1 *func=NULL)
Saves superimposed data types histograms.
Definition: Drawer.cc:337
TH1F * ProjectionMeanX(TH2F *hist, bool fit=false) const
Produces a TH1F of the mean Y as a function of X from a TH2F.
Definition: Drawer.cc:353
std::map< std::string, VarSet > _varsets
Drawing options for each data type.
Definition: Drawer.hh:304
int line_style
Line style (plain, dashed, dotted, etc.)
Definition: Drawer.hh:37
const char * hist_opt
ROOT histogram drawing option.
Definition: Drawer.hh:46
Stores the default drawing options and methods to produce ROOT plots.
Definition: Drawer.hh:67
std::string unit
Unit in which the variable is expressed.
Definition: Drawer.hh:55
const char * graph_opt
ROOT graph drawing option.
Definition: Drawer.hh:47
const char * hist_leg
ROOT histogram legend drawing option.
Definition: Drawer.hh:48
Defines functions that allow to plot a ROOT scatter graph with a color scale.
Definition: ScatterGraph.hh:31
int line_width
Line width.
Definition: Drawer.hh:39
TGaxis * NewMultiGraphEmittanceAxis(TF1 *func, const double &miny, const double &maxy, const double &maxx) const
Intializes an emittance axis for fractional quantities.
Definition: Drawer.cc:289
TMultiGraph * DrawMultiGraph(std::map< std::string, TGraphErrors * > graphs, const std::string &name, TF1 *func=NULL)
Draws superimposed data types histograms.
Definition: Drawer.cc:303
InfoBox * _info
MAUS info box to be drawn.
Definition: Drawer.hh:305
std::vector< std::string > _vars
Phase space variables.
Definition: Drawer.hh:302
Structure that stores the drawing options for each variable.
Definition: Drawer.hh:53
TH1F * New1DHistogram(const std::string &name, const std::string &var) const
Returns an appropriate TH1F to draw one of the phase space component.
Definition: Drawer.cc:56
Stores the MICE run information to be printed as TPaveText.
Definition: InfoBox.hh:18
std::vector< std::string > _types
Data types.
Definition: Drawer.hh:301
void Initialize()
Initializes the default drawing options.
Definition: Drawer.cc:393
InfoBox * GetInfoBox() const
Returns a pointer to the info box.
Definition: Drawer.hh:254
const char * graph_leg
ROOT graph legend drawing option.
Definition: Drawer.hh:49