set of generic plots
More...
#include <computils.h>
|
| Plots (const std::string &s="", bool errors=false) |
|
double | realmin (double lo=0, double hi=0) |
|
double | realmax (double lo=0, double hi=0) |
|
void | MaxScale (double scale=1.1, double lo=0, double hi=0) |
|
void | MinScale (double scale, double lo=0, double hi=0) |
|
void | Min (double scale) |
|
void | Max (double scale) |
|
std::vector< double > | findxrange (bool symmetric=false) |
|
void | sortx (const AxisInfo &xinfo) |
|
double | lo () const |
|
double | hi () const |
|
void | xrange (bool symmetric=false) |
|
void | SetRangeUser (double lo, double hi) |
|
void | limits () |
|
void | Draw (Legend &leg, bool means=false) |
|
void | Draw_i (Legend &leg, bool means=false) |
|
void | SetLogx (bool b=true) |
|
void | SetLogy (bool b=true) |
|
std::string | GetXaxisTitle () |
|
std::string | GetYaxisTitle () |
|
void | SetXaxisTitle (const std::string &s) |
|
void | SetYaxisTitle (const std::string &s) |
|
void | push_back (const Plotter &val) |
| this is so that we can update the stats as we go along, but no updating isn't done at the moment
More...
|
|
set of generic plots
Definition at line 915 of file computils.h.
◆ Plots()
Plots::Plots |
( |
const std::string & |
s = "" , |
|
|
bool |
errors = false |
|
) |
| |
|
inline |
◆ Draw()
void Plots::Draw |
( |
Legend & |
leg, |
|
|
bool |
means = false |
|
) |
| |
|
inline |
◆ Draw_i()
void Plots::Draw_i |
( |
Legend & |
leg, |
|
|
bool |
means = false |
|
) |
| |
|
inline |
increase the number of log labels if only a few decades
still can't get this working correctly - for the time being leave these alternative loop orders in place but commented out until we can find a better solution ...
Definition at line 1162 of file computils.h.
1168 double ymax = at(
i).htest()->GetMaximum();
1169 double ymin = at(
i).htest()->GetMinimum();
1170 at(
i).htest()->GetYaxis()->SetMoreLogLabels(
true);
1171 if (
ymax/
ymin>1e6 ) at(
i).htest()->GetYaxis()->SetMoreLogLabels(
false);
◆ findxrange()
std::vector<double> Plots::findxrange |
( |
bool |
symmetric = false | ) |
|
|
inline |
don't use empty histograms to find the bin limits unless they are all empty
Definition at line 1021 of file computils.h.
1026 std::vector<double>
v(2,0);
1028 TH1F* hf = at(0).htest();
1033 if ( hf->GetBinLowEdge(1)<vlo ) vlo = hf->GetBinLowEdge(1);
1034 if ( hf->GetBinLowEdge(hf->GetNbinsX()+1)>vhi ) vhi = hf->GetBinLowEdge( hf->GetNbinsX()+1 );
1040 for (
unsigned i=1 ;
i<
size() ;
i++ ) {
1044 if ( ::
empty( hf ) )
continue;
1046 if ( hf->GetBinLowEdge(1)<vlo ) vlo = hf->GetBinLowEdge(1);
1047 if ( hf->GetBinLowEdge(hf->GetNbinsX()+1)>vhi ) vhi = hf->GetBinLowEdge( hf->GetNbinsX()+1 );
1059 if (
v[0]>
lo )
v[0] =
lo;
1060 if (
v[1]<
hi )
v[1] =
hi;
1066 double upper = (
v[1]-
v[0] )*1.1 +
v[0];
1067 double lower =
v[0] - (
v[1]-
v[0] )*0.1;
1070 double dx = std::log10(
v[1])-std::log10(
v[0]);
1075 if ( lower<vlo ) lower = vlo;
◆ GetXaxisTitle()
std::string Plots::GetXaxisTitle |
( |
| ) |
|
|
inline |
Definition at line 1194 of file computils.h.
1195 if (
size()>0 )
return at(0).htest()->GetXaxis()->GetTitle();
◆ GetYaxisTitle()
std::string Plots::GetYaxisTitle |
( |
| ) |
|
|
inline |
Definition at line 1199 of file computils.h.
1200 if (
size()>0 )
return at(0).htest()->GetYaxis()->GetTitle();
◆ hi()
double Plots::hi |
( |
| ) |
const |
|
inline |
◆ limits()
Definition at line 1143 of file computils.h.
1147 std::cout <<
"\tlimits \t" <<
m_name <<
"\tmin " << rmin <<
"\tmax " << rmax << std::endl;
◆ lo()
double Plots::lo |
( |
| ) |
const |
|
inline |
◆ Max()
void Plots::Max |
( |
double |
scale | ) |
|
|
inline |
Definition at line 1013 of file computils.h.
1015 for (
unsigned i=0 ;
i<
size() ;
i++ ) {
1016 if ( at(
i).href() ) at(
i).href()->SetMaximum(
scale);
1017 at(
i).htest()->SetMaximum(
scale);
◆ MaxScale()
void Plots::MaxScale |
( |
double |
scale = 1.1 , |
|
|
double |
lo = 0 , |
|
|
double |
hi = 0 |
|
) |
| |
|
inline |
Definition at line 954 of file computils.h.
956 if (
size()<1 )
return;
965 for (
unsigned i=0 ;
i<
size() ;
i++ ) {
966 if ( at(
i).href() ) at(
i).href()->SetMaximum(
scale*tmax);
967 at(
i).htest()->SetMaximum(
scale*tmax);
◆ Min()
void Plots::Min |
( |
double |
scale | ) |
|
|
inline |
Definition at line 1000 of file computils.h.
1002 for (
unsigned i=0 ;
i<
size() ;
i++ ) {
1003 if ( at(
i).href() ) at(
i).href()->SetMinimum(
scale);
1004 at(
i).htest()->SetMinimum(
scale);
1006 if ( at(
i).
href() )
if ( at(
i).
href()->GetMinimum()<=0 ) at(
i).href()->GetMinimum(1
e-4);
1007 if ( at(
i).
htest()->GetMinimum()<=0 ) at(
i).htest()->GetMinimum(1
e-4);
◆ MinScale()
void Plots::MinScale |
( |
double |
scale, |
|
|
double |
lo = 0 , |
|
|
double |
hi = 0 |
|
) |
| |
|
inline |
Definition at line 973 of file computils.h.
975 if (
size()<1 )
return;
978 for (
unsigned i=0 ;
i<
size() ;
i++ ) {
979 if ( at(
i).href() ) at(
i).href()->SetMinimum(0);
980 at(
i).htest()->SetMinimum(0);
993 for (
unsigned i=0 ;
i<
size() ;
i++ ) {
994 if ( at(
i).href() ) at(
i).href()->SetMinimum(
scale*tmin);
995 at(
i).htest()->SetMinimum(
scale*tmin);
◆ push_back()
this is so that we can update the stats as we go along, but no updating isn't done at the moment
Definition at line 1215 of file computils.h.
1216 std::vector<Plotter>::push_back(
val );
◆ realmax()
double Plots::realmax |
( |
double |
lo = 0 , |
|
|
double |
hi = 0 |
|
) |
| |
|
inline |
Definition at line 940 of file computils.h.
943 for (
unsigned i=0 ;
i<
size() ;
i++ ) {
946 if ( rmtest!=0 && (
first ||
max<rmtest ) )
max = rmtest;
947 if ( rmtest!=0 )
first =
false;
◆ realmin()
double Plots::realmin |
( |
double |
lo = 0 , |
|
|
double |
hi = 0 |
|
) |
| |
|
inline |
Definition at line 929 of file computils.h.
932 for (
unsigned i=0 ;
i<
size() ;
i++ ) {
934 if ( rmtest!=0 && (
first ||
min>rmtest ) )
min = rmtest;
935 if ( rmtest!=0 )
first =
false;
◆ SetLogx()
void Plots::SetLogx |
( |
bool |
b = true | ) |
|
|
inline |
◆ SetLogy()
void Plots::SetLogy |
( |
bool |
b = true | ) |
|
|
inline |
◆ SetRangeUser()
void Plots::SetRangeUser |
( |
double |
lo, |
|
|
double |
hi |
|
) |
| |
|
inline |
Definition at line 1132 of file computils.h.
1136 for (
unsigned i=0 ;
i<
size() ;
i++ ) {
1137 if ( at(
i).href() ) at(
i).href()->GetXaxis()->SetRangeUser(
m_lo,
m_hi );
1138 at(
i).htest()->GetXaxis()->SetRangeUser(
m_lo,
m_hi );
◆ setwatermark()
static void Plots::setwatermark |
( |
bool |
b | ) |
|
|
inlinestatic |
◆ SetXaxisTitle()
void Plots::SetXaxisTitle |
( |
const std::string & |
s | ) |
|
|
inline |
Definition at line 1204 of file computils.h.
1205 if (
size()>0 ) at(0).htest()->GetXaxis()->SetTitle(
s.c_str());
◆ SetYaxisTitle()
void Plots::SetYaxisTitle |
( |
const std::string & |
s | ) |
|
|
inline |
Definition at line 1208 of file computils.h.
1209 if (
size()>0 ) at(0).htest()->GetYaxis()->SetTitle(
s.c_str());
◆ sortx()
Definition at line 1086 of file computils.h.
1104 else if (
size() == 0)
1106 std::cout<<
"Warning in computils.h::sortx() size=0. Setting m_lo/m_hi to 0/1. You will probably have empty figures."<<std::endl;
◆ xrange()
void Plots::xrange |
( |
bool |
symmetric = false | ) |
|
|
inline |
Definition at line 1124 of file computils.h.
1126 for (
unsigned i=0 ;
i<
size() ;
i++ ) {
1127 if ( at(
i).href() ) ::
xrange( at(
i).href(), symmetric );
◆ elements
T std::vector< T >::elements |
|
inherited |
◆ m_hi
◆ m_lo
◆ m_logx
◆ m_logy
◆ m_max
◆ m_maxset
◆ m_min
◆ m_minset
◆ m_name
std::string Plots::m_name |
|
private |
◆ m_rangeset
◆ m_trim_errors
bool Plots::m_trim_errors |
|
private |
◆ s_watermark
bool Plots::s_watermark = true |
|
staticprivate |
The documentation for this class was generated from the following files: