![]() |
SynAPSE
0.6.0
Synergistic Analysis of Phase Space Evolution
|
Stores the default drawing options and methods to produce ROOT plots. More...
#include <Drawer.hh>
Public Member Functions | |
| Drawer () | |
| Default constructor, intializes the default drawing options. More... | |
| Drawer (const Drawer &dra) | |
| Copy constructor. More... | |
| Drawer & | operator= (const Drawer &dra) |
| Equality operator. More... | |
| ~Drawer () | |
| Destructor. More... | |
| void | SetVariableSettings (const std::string &var, const VarSet &varset) |
| Sets custom settings for the specified variable. More... | |
| void | SetVariableLimits (const std::string &var, double llim, double ulim) |
| Sets the limits of the specified variable. More... | |
| TH1F * | New1DHistogram (const std::string &name, const std::string &var) const |
| Returns an appropriate TH1F to draw one of the phase space component. More... | |
| 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. More... | |
| ScatterGraph * | NewAmplitudeScatter (const std::string &name, const std::string &varx, const std::string &vary) const |
| Returns a scatter plot with an amplitude color scale. More... | |
| THStack * | NewStack (std::map< std::string, TH1F * > hists) const |
| Initializes a stack of histograms of different data types. More... | |
| 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. More... | |
| 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. More... | |
| THStack * | DrawStack (std::map< std::string, TH1F * > hists, const std::string &name) const |
| Draws superimposed data types histograms. More... | |
| void | SaveStack (std::map< std::string, TH1F * > hists, const std::string &name, bool ratio=false) const |
| Saves superimposed data types histograms. More... | |
| TMultiGraph * | NewMultiGraph (std::map< std::string, TGraphErrors * > graphs) const |
| Initializes a multigraph of graphs of different data types. More... | |
| TLegend * | NewMultiGraphLegend (std::map< std::string, TGraphErrors * > graphs, const std::string corner="tr") const |
| Intializes a legend for a multigraph of different data types. More... | |
| TGaxis * | NewMultiGraphEmittanceAxis (TF1 *func, const double &miny, const double &maxy, const double &maxx) const |
| Intializes an emittance axis for fractional quantities. More... | |
| TMultiGraph * | DrawMultiGraph (std::map< std::string, TGraphErrors * > graphs, const std::string &name, TF1 *func=NULL) |
| Draws superimposed data types histograms. More... | |
| void | SaveMultiGraph (std::map< std::string, TGraphErrors * > graphs, const std::string &name, TF1 *func=NULL) |
| Saves superimposed data types histograms. More... | |
| TH1F * | ProjectionMeanX (TH2F *hist, bool fit=false) const |
| Produces a TH1F of the mean Y as a function of X from a TH2F. More... | |
| void | SetInfoBox (InfoBox *info) |
| Sets the info box. More... | |
| InfoBox * | GetInfoBox () const |
| Returns a pointer to the info box. More... | |
Private Member Functions | |
| void | Initialize () |
| Initializes the default drawing options. More... | |
| void | SetStyle (TH1 *obj, const std::string &type) const |
| Sets the histogram style according to the predefined options. More... | |
| void | SetStyle (TGraph *obj, const std::string &type) const |
| Sets the graph style according to the predefined options. More... | |
| void | DrawMICEModules (const double &miny, const double &maxy) const |
| Draws the MICE beam line elements onto an evolution graph. More... | |
| std::string | FindBestCorner (std::map< std::string, TGraphErrors * > graphs) const |
| Finds the corner that leasts overlaps the graph. More... | |
| void | SaveGIF (const std::string &name, const std::vector< TCanvas * > &canv) const |
| Saves the canvases, in order, to a single GIF. More... | |
Private Attributes | |
| std::vector< std::string > | _types |
| Data types. More... | |
| std::vector< std::string > | _vars |
| Phase space variables. More... | |
| std::map< std::string, DrawOpt > | _options |
| Drawing options for each data type. More... | |
| std::map< std::string, VarSet > | _varsets |
| Drawing options for each data type. More... | |
| InfoBox * | _info |
| MAUS info box to be drawn. More... | |
Stores the default drawing options and methods to produce ROOT plots.
Defines a list of default colors, fill styles, etc. for the different data types. Contains a list of methods to produce preformatted plots of the of the phase space data.
| Beam::Drawer::Drawer | ( | ) |
Default constructor, intializes the default drawing options.
| Beam::Drawer::Drawer | ( | const Drawer & | dra | ) |
Copy constructor.
| Beam::Drawer::~Drawer | ( | ) |
Destructor.
|
private |
Draws the MICE beam line elements onto an evolution graph.
| miny | Minimum value on the Y axis |
| maxy | Maximum value on the Y axis |
| TMultiGraph * Beam::Drawer::DrawMultiGraph | ( | std::map< std::string, TGraphErrors * > | graphs, |
| const std::string & | name, | ||
| TF1 * | func = NULL |
||
| ) |
Draws superimposed data types histograms.
| graphs | Map of graphs that form the multigraph |
| name | File name |
| func | Proportionality function for emittance estimate |
| THStack * Beam::Drawer::DrawStack | ( | std::map< std::string, TH1F * > | hists, |
| const std::string & | name | ||
| ) | const |
Draws superimposed data types histograms.
| hists | Map of histograms that form the stack |
| name | File name |
|
private |
Finds the corner that leasts overlaps the graph.
| mg | Map of graphs to not overlap |
|
inline |
Returns a pointer to the info box.
|
private |
Initializes the default drawing options.
| TH1F * Beam::Drawer::New1DHistogram | ( | const std::string & | name, |
| const std::string & | var | ||
| ) | const |
Returns an appropriate TH1F to draw one of the phase space component.
| name | Name of the histogram |
| var | Variable to be drawn |
| TH2F * Beam::Drawer::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.
| name | Name of the histogram |
| varx | First variable to be drawn |
| vary | Second variable to be drawn |
| ScatterGraph * Beam::Drawer::NewAmplitudeScatter | ( | const std::string & | name, |
| const std::string & | varx, | ||
| const std::string & | vary | ||
| ) | const |
Returns a scatter plot with an amplitude color scale.
| name | Name of the scatter plot |
| varx | First variable to be drawn |
| vary | Second variable to be drawn |
| TMultiGraph * Beam::Drawer::NewMultiGraph | ( | std::map< std::string, TGraphErrors * > | graphs | ) | const |
Initializes a multigraph of graphs of different data types.
| graphs | Map of graphs that form the multigraph |
| TGaxis * Beam::Drawer::NewMultiGraphEmittanceAxis | ( | TF1 * | func, |
| const double & | miny, | ||
| const double & | maxy, | ||
| const double & | maxx | ||
| ) | const |
Intializes an emittance axis for fractional quantities.
| func | Function of the emittance |
| miny | Minimum value on the Y axis |
| maxy | Maximum value on the Y axis |
| maxx | Maximum value on the X axis |
| TLegend * Beam::Drawer::NewMultiGraphLegend | ( | std::map< std::string, TGraphErrors * > | graphs, |
| const std::string | corner = "tr" |
||
| ) | const |
Intializes a legend for a multigraph of different data types.
| graphs | Map of graphs that form the multigraph |
| corner | Corner in which to draw the legend |
| THStack * Beam::Drawer::NewStack | ( | std::map< std::string, TH1F * > | hists | ) | const |
Initializes a stack of histograms of different data types.
| hists | Map of histograms that form the stack |
| TLegend * Beam::Drawer::NewStackLegend | ( | std::map< std::string, TH1F * > | hists, |
| const double | hoffset = 0 |
||
| ) | const |
Intializes a legend for a stack of histogram of different data types.
| hists | Map of histograms that form the stack |
| hoffset | Height offset due to the presence of a statbox |
| std::map< std::string, TPaveStats * > Beam::Drawer::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.
| hists | Map of histograms that form the stack |
| draw_opt | Drawing options ("E" for entries, "M" for mean, "R" for RMS) |
| hoffset | Height offset due to the presence of a statbox |
| TH1F * Beam::Drawer::ProjectionMeanX | ( | TH2F * | hist, |
| bool | fit = false |
||
| ) | const |
Produces a TH1F of the mean Y as a function of X from a TH2F.
| hist | Input 2D histogram |
| fit | Flag for Gaussian peak fitting |
|
private |
Saves the canvases, in order, to a single GIF.
| name | Name of the object to print |
| canv | Array of canvases to save |
| void Beam::Drawer::SaveMultiGraph | ( | std::map< std::string, TGraphErrors * > | graphs, |
| const std::string & | name, | ||
| TF1 * | func = NULL |
||
| ) |
Saves superimposed data types histograms.
| graphs | Map of graphs that form the multigraph |
| name | File name |
| func | Proportionality function for emittance estimate |
| void Beam::Drawer::SaveStack | ( | std::map< std::string, TH1F * > | hists, |
| const std::string & | name, | ||
| bool | ratio = false |
||
| ) | const |
Saves superimposed data types histograms.
| hists | Map of histograms that form the stack |
| name | File name |
| ratio | Draws the ratio data/simulation |
|
inline |
Sets the info box.
| obj | MAUS info box object |
|
private |
Sets the histogram style according to the predefined options.
| obj | ROOT histogram (may be TH1, TH2 or TH3) |
| type | Data type |
|
private |
Sets the graph style according to the predefined options.
| obj | ROOT graph (may be TGraph or TGraphErrors) |
| type | Data type |
| void Beam::Drawer::SetVariableLimits | ( | const std::string & | var, |
| double | llim, | ||
| double | ulim | ||
| ) |
Sets the limits of the specified variable.
| var | Name of the variable |
| llim | Lower limit |
| ulim | Upper limit |
|
inline |
Sets custom settings for the specified variable.
| var | Name of the variable |
| varset | Variable settings |
|
private |
MAUS info box to be drawn.
|
private |
Drawing options for each data type.
|
private |
Data types.
|
private |
Phase space variables.
|
private |
Drawing options for each data type.
1.8.6