BCAux.cxx
32 BCLog::OutWarning("BCAux::SetStyle() is deprecated and no longer does anything. Please do not use it.");
75 std::string title = std::string(h->GetTitle()) + ";" + xtitle + ";" + ytitle + ";" + h->GetZaxis()->GetTitle();
114 res.erase(std::remove_if(res.begin(), res.end(), std::not1(std::ptr_fun(BCAux::AllowedCharacter))), res.end());
132 void BCAux::SetKnowledgeUpdateDrawingStyle(BCH1D& prior, BCH1D& posterior, BCAux::BCKnowledgeUpdateDrawingStyle style)
181 void BCAux::SetKnowledgeUpdateDrawingStyle(BCH2D& prior, BCH2D& posterior, BCAux::BCKnowledgeUpdateDrawingStyle style)
236 void BCAux::DrawKnowledgeUpdate(BCHistogramBase& prior, BCHistogramBase& posterior, bool draw_prior_first, BCTrash<TObject>& trash)
261 double minx = std::min<double>(prior.GetHistogram()->GetXaxis()->GetXmin(), posterior.GetHistogram()->GetXaxis()->GetXmin());
262 double maxx = std::max<double>(prior.GetHistogram()->GetXaxis()->GetXmax(), posterior.GetHistogram()->GetXaxis()->GetXmax());
269 maxy = 1.1 * std::max<double>(prior.GetHistogram()->GetMaximum(), posterior.GetHistogram()->GetMaximum());
271 miny = 0.5 * std::min<double>(prior.GetHistogram()->GetMinimum(0), posterior.GetHistogram()->GetMinimum(0));
275 miny = std::min<double>(prior.GetHistogram()->GetYaxis()->GetXmin(), posterior.GetHistogram()->GetYaxis()->GetXmin());
276 maxy = std::max<double>(prior.GetHistogram()->GetYaxis()->GetXmax(), posterior.GetHistogram()->GetYaxis()->GetXmax());
283 h2_axes = new TH2D(Form("h2_axes_knowledge_update_%s_%s", prior.GetHistogram()->GetName(), posterior.GetHistogram()->GetName()),
284 Form(";%s;%s", prior.GetHistogram()->GetXaxis()->GetTitle(), prior.GetHistogram()->GetYaxis()->GetTitle()),
322 prior.GetLegend().SetX2(prior.GetLegend().GetX1() + 45e-2 * (prior.GetLegend().GetX2() - prior.GetLegend().GetX1()));
323 posterior.GetLegend().SetX1(posterior.GetLegend().GetX1() + 55e-2 * (posterior.GetLegend().GetX2() - posterior.GetLegend().GetX1()));
325 prior.GetLegend().SetX2NDC(prior.GetLegend().GetX1NDC() + 45e-2 * (prior.GetLegend().GetX2NDC() - prior.GetLegend().GetX1NDC()));
326 posterior.GetLegend().SetX1NDC(posterior.GetLegend().GetX1NDC() + 55e-2 * (posterior.GetLegend().GetX2NDC() - posterior.GetLegend().GetX1NDC()));
339 unsigned BCAux::PrintPlots(std::vector<BCH1D>& h1, std::vector<BCH2D>& h2, const std::string& filename, unsigned hdiv, unsigned vdiv)
347 BCLog::OutSummary(Form("Printing all marginalized distributions (%lu x 1D + %lu x 2D = %u) into file %s", h1.size(), h2.size(), nplots, filename.c_str()));
Posterior drawn with detailed info, prior drawn as overlaid line.
Definition: BCAux.h:121
void DrawKnowledgeUpdate(BCHistogramBase &prior, BCHistogramBase &posterior, bool draw_prior_first, BCTrash< TObject > &trash)
Draw knowledge update plot into current TPad.
Definition: BCAux.cxx:236
void MakeFinite(double &xmin, double &xmax)
Make an infinite range finite by setting inf values to max.
Definition: BCAux.cxx:102
T * OwnClone(const T *o)
Create a clone of the input but avoid registering the object with ROOT so it cannot be deleted twice...
Definition: BCAux.h:189
A guard object to prevent ROOT from taking over ownership of TNamed objects.
Definition: BCAux.h:171
unsigned PrintPlots(std::vector< BCH1D > &h1, std::vector< BCH2D > &h2, const std::string &filename, unsigned hdiv=1, unsigned vdiv=1)
Print plots.
Definition: BCAux.cxx:339
BCAux::BCRange RangeType(double xmin, double xmax)
Return type of range as a BCAux::BCRange enum.
Definition: BCAux.cxx:85
TH2 * Transpose(const TH2 *const h, const std::string &name="")
Transpose a TH2.
Definition: BCAux.cxx:55
Prior drawn with detailed info, posterior drawn as overlaid line.
Definition: BCAux.h:122
std::string SafeName(const std::string &name)
Convert a name into a safe name for use in ROOT object naming.
Definition: BCAux.cxx:111
void SetNLegendColumns(unsigned n)
Set number of columns in legend.
Definition: BCHistogramBase.h:474
void SetDrawGlobalMode(bool flag=true, bool arrows=true)
Set drawing of global mode.
Definition: BCHistogramBase.h:434
virtual void SetColorScheme(BCHColorScheme scheme)
Sets the color scheme.
Definition: BCHistogramBase.cxx:232
lower < upper, lower limit finite, upper limit infinite
Definition: BCAux.h:91
void SetDrawMedian(bool flag=true, bool central68=true)
Set drawing of median.
Definition: BCH1D.h:182
void SetKnowledgeUpdateDrawingStyle(BCH1D &prior, BCH1D &posterior, BCAux::BCKnowledgeUpdateDrawingStyle style=BCAux::kKnowledgeUpdateDefaultStyle)
Use pre-made drawing options for knowledge update plots.
Definition: BCAux.cxx:132
void SetDrawLocalMode(bool flag=true, bool arrows=true)
Set drawing of global mode.
Definition: BCHistogramBase.h:445
BCKnowledgeUpdateDrawingStyle
An enumerator for the knowledge update drawing style presets.
Definition: BCAux.h:119
void SetNSmooth(unsigned n)
Sets number of times to smooth the histogram using ROOT's smoothing function.
Definition: BCHistogramBase.h:429
virtual double ResizeLegend()
Resize legend and set it for placement at the top of the pad.
Definition: BCHistogramBase.cxx:695
void SetDrawMean(bool flag=true, bool stddev=true)
Set drawing of mean.
Definition: BCHistogramBase.h:458
virtual bool Valid() const
Whether histogram has been set and filled.
Definition: BCHistogramBase.cxx:226
void SetROOToptions(const std::string &options)
Set ROOT drawing options.
Definition: BCHistogramBase.h:497
void SetNBands(unsigned n)
Sets number of credibility interval bands to draw.
Definition: BCHistogramBase.h:424
void DefaultToPDF(std::string &filename)
Force file extension to be .pdf if not already .pdf or .ps.
Definition: BCAux.cxx:36
lower < upper, lower limit infinite, upper limit finite
Definition: BCAux.h:90
void SetMarkerColor(int c)
Set marker color (used for mean, median, and mode).
Definition: BCHistogramBase.h:379