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 913 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 1160 of file computils.h.
1166 double ymax = at(
i).htest()->GetMaximum();
1167 double ymin = at(
i).htest()->GetMinimum();
1168 at(
i).htest()->GetYaxis()->SetMoreLogLabels(
true);
1169 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 1019 of file computils.h.
1024 std::vector<double>
v(2,0);
1026 TH1F* hf = at(0).htest();
1031 if ( hf->GetBinLowEdge(1)<vlo ) vlo = hf->GetBinLowEdge(1);
1032 if ( hf->GetBinLowEdge(hf->GetNbinsX()+1)>vhi ) vhi = hf->GetBinLowEdge( hf->GetNbinsX()+1 );
1038 for (
unsigned i=1 ;
i<
size() ;
i++ ) {
1042 if ( ::
empty( hf ) )
continue;
1044 if ( hf->GetBinLowEdge(1)<vlo ) vlo = hf->GetBinLowEdge(1);
1045 if ( hf->GetBinLowEdge(hf->GetNbinsX()+1)>vhi ) vhi = hf->GetBinLowEdge( hf->GetNbinsX()+1 );
1057 if (
v[0]>
lo )
v[0] =
lo;
1058 if (
v[1]<
hi )
v[1] =
hi;
1064 double upper = (
v[1]-
v[0] )*1.1 +
v[0];
1065 double lower =
v[0] - (
v[1]-
v[0] )*0.1;
1068 double dx = std::log10(
v[1])-std::log10(
v[0]);
1073 if ( lower<vlo ) lower = vlo;
◆ GetXaxisTitle()
std::string Plots::GetXaxisTitle |
( |
| ) |
|
|
inline |
Definition at line 1192 of file computils.h.
1193 if (
size()>0 )
return at(0).htest()->GetXaxis()->GetTitle();
◆ GetYaxisTitle()
std::string Plots::GetYaxisTitle |
( |
| ) |
|
|
inline |
Definition at line 1197 of file computils.h.
1198 if (
size()>0 )
return at(0).htest()->GetYaxis()->GetTitle();
◆ hi()
double Plots::hi |
( |
| ) |
const |
|
inline |
◆ limits()
Definition at line 1141 of file computils.h.
1145 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 1011 of file computils.h.
1013 for (
unsigned i=0 ;
i<
size() ;
i++ ) {
1014 if ( at(
i).href() ) at(
i).href()->SetMaximum(
scale);
1015 at(
i).htest()->SetMaximum(
scale);
◆ MaxScale()
void Plots::MaxScale |
( |
double |
scale = 1.1 , |
|
|
double |
lo = 0 , |
|
|
double |
hi = 0 |
|
) |
| |
|
inline |
Definition at line 952 of file computils.h.
954 if (
size()<1 )
return;
963 for (
unsigned i=0 ;
i<
size() ;
i++ ) {
964 if ( at(
i).href() ) at(
i).href()->SetMaximum(
scale*tmax);
965 at(
i).htest()->SetMaximum(
scale*tmax);
◆ Min()
void Plots::Min |
( |
double |
scale | ) |
|
|
inline |
Definition at line 998 of file computils.h.
1000 for (
unsigned i=0 ;
i<
size() ;
i++ ) {
1001 if ( at(
i).href() ) at(
i).href()->SetMinimum(
scale);
1002 at(
i).htest()->SetMinimum(
scale);
1004 if ( at(
i).href() )
if ( at(
i).href()->GetMinimum()<=0 ) at(
i).href()->GetMinimum(1
e-4);
1005 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 971 of file computils.h.
973 if (
size()<1 )
return;
976 for (
unsigned i=0 ;
i<
size() ;
i++ ) {
977 if ( at(
i).href() ) at(
i).href()->SetMinimum(0);
978 at(
i).htest()->SetMinimum(0);
991 for (
unsigned i=0 ;
i<
size() ;
i++ ) {
992 if ( at(
i).href() ) at(
i).href()->SetMinimum(
scale*tmin);
993 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 1213 of file computils.h.
1214 std::vector<Plotter>::push_back(
val );
◆ realmax()
double Plots::realmax |
( |
double |
lo = 0 , |
|
|
double |
hi = 0 |
|
) |
| |
|
inline |
Definition at line 938 of file computils.h.
941 for (
unsigned i=0 ;
i<
size() ;
i++ ) {
944 if ( rmtest!=0 && (
first ||
max<rmtest ) )
max = rmtest;
945 if ( rmtest!=0 )
first =
false;
◆ realmin()
double Plots::realmin |
( |
double |
lo = 0 , |
|
|
double |
hi = 0 |
|
) |
| |
|
inline |
Definition at line 927 of file computils.h.
930 for (
unsigned i=0 ;
i<
size() ;
i++ ) {
932 if ( rmtest!=0 && (
first ||
min>rmtest ) )
min = rmtest;
933 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 1130 of file computils.h.
1134 for (
unsigned i=0 ;
i<
size() ;
i++ ) {
1135 if ( at(
i).href() ) at(
i).href()->GetXaxis()->SetRangeUser(
m_lo,
m_hi );
1136 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 1202 of file computils.h.
1203 if (
size()>0 ) at(0).htest()->GetXaxis()->SetTitle(
s.c_str());
◆ SetYaxisTitle()
void Plots::SetYaxisTitle |
( |
const std::string & |
s | ) |
|
|
inline |
Definition at line 1206 of file computils.h.
1207 if (
size()>0 ) at(0).htest()->GetYaxis()->SetTitle(
s.c_str());
◆ sortx()
Definition at line 1084 of file computils.h.
1102 else if (
size() == 0)
1104 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 1122 of file computils.h.
1124 for (
unsigned i=0 ;
i<
size() ;
i++ ) {
1125 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: