![]() |
MaCh3 2.2.1
Reference Guide
|
Functions | |
TH1D | MaCh3Plotting::TGraphToTH1D (TGraph graph, std::string newName="", std::string newTitle="") |
This handy little function lets you interpret a TGraph as a TH1D. | |
std::vector< std::vector< double > > | MaCh3Plotting::TGraphToVector (TGraph graph) |
This handy little function lets you interpret a TGraph as a vector containing the same data. | |
std::vector< std::vector< double > > | MaCh3Plotting::TGraphToVector (TGraph2D graph) |
This handy little function lets you interpret a 2d TGraph as a vector containing the same data. | |
TH1D MaCh3Plotting::TGraphToTH1D | ( | TGraph | graph, |
std::string | newName, | ||
std::string | newTitle | ||
) |
This handy little function lets you interpret a TGraph as a TH1D.
It will go through your provided graph and make a histogram binning by taking the midpoints of all the graph points x values, then fill the histogram with the graphs y values. For the first and last points it will extend the binning out of the graph bounds using the width between the outermost and second outermost points. This can be useful if e.g. you want to draw cumulative stacks of LLH scans.
graph | The graph you want to convert. |
newName | The new name you want to give to the histogram. If not specified, will just use the name of the graph. |
newTitle | The new title you want to give to the histogram. If not specified, will just use the title of the graph. |
Definition at line 10 of file plottingUtils.cpp.
std::vector< std::vector< double > > MaCh3Plotting::TGraphToVector | ( | TGraph | graph | ) |
This handy little function lets you interpret a TGraph as a vector containing the same data.
graph | The graph you want to convert. |
Definition at line 64 of file plottingUtils.cpp.
std::vector< std::vector< double > > MaCh3Plotting::TGraphToVector | ( | TGraph2D | graph | ) |
This handy little function lets you interpret a 2d TGraph as a vector containing the same data.
graph | The graph you want to convert. |
Definition at line 88 of file plottingUtils.cpp.