BmnRoot
Loading...
Searching...
No Matches
BmnDrawHist.h File Reference

Helper functions for drawing 1D and 2D histograms and graphs. More...

#include "TH1.h"
#include "TH1D.h"
#include "TH2.h"
#include "TPad.h"
#include "TLegend.h"
#include "TGraph.h"
#include "TGraph2D.h"
#include <string>
#include <vector>
#include <fstream>
Include dependency graph for BmnDrawHist.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  BmnDrawingOptions
 Default options for drawing. More...
 

Enumerations

enum  HistScale { kLog = 0 , kLinear = 1 }
 Define linear or logarithmic scale for drawing. More...
 

Functions

void SetDefaultDrawStyle ()
 
void DrawH1 (TH1 *hist, HistScale logx=kLinear, HistScale logy=kLinear, const string &drawOpt="", Int_t color=BmnDrawingOptions::Color(0), Int_t lineWidth=BmnDrawingOptions::LineWidth(), Int_t lineStyle=BmnDrawingOptions::LineStyle(0), Float_t markerSize=BmnDrawingOptions::MarkerSize(), Int_t markerStyle=BmnDrawingOptions::MarkerStyle(0), Int_t fillColor=-1)
 
void DrawH2 (TH2 *hist, HistScale logx=kLinear, HistScale logy=kLinear, HistScale logz=kLinear, const string &drawOpt="COLZ")
 
void DrawH1 (const vector< TH1 * > &histos, const vector< string > &histLabels, HistScale logx=kLinear, HistScale logy=kLinear, Bool_t drawLegend=true, Double_t x1=0.25, Double_t y1=0.99, Double_t x2=0.55, Double_t y2=0.75, const string &drawOpt="", Bool_t outputMeanValue01=kFALSE)
 
void DrawGraph (TGraph *graph, HistScale logx=kLinear, HistScale logy=kLinear, const string &drawOpt="AC", Int_t color=BmnDrawingOptions::Color(0), Int_t lineWidth=BmnDrawingOptions::LineWidth(), Int_t lineStyle=BmnDrawingOptions::LineStyle(0), Int_t markerSize=BmnDrawingOptions::MarkerSize(), Int_t markerStyle=BmnDrawingOptions::MarkerStyle(0))
 
void DrawGraph (const vector< TGraph * > &graphs, const vector< string > &graphLabels, HistScale logx=kLinear, HistScale logy=kLinear, Bool_t drawLegend=true, Double_t x1=0.25, Double_t y1=0.99, Double_t x2=0.55, Double_t y2=0.75)
 
void DrawGraph2D (TGraph2D *graph, HistScale logx=kLinear, HistScale logy=kLinear, HistScale logz=kLinear, const string &drawOpt="colz")
 
void DrawMeanLine (TH1 *hist)
 

Detailed Description

Helper functions for drawing 1D and 2D histograms and graphs.

Author
Andrey Lebedev andre.nosp@m.y.le.nosp@m.bedev.nosp@m.@gsi.nosp@m..de
Date
2008

Definition in file BmnDrawHist.h.

Enumeration Type Documentation

◆ HistScale

enum HistScale

Define linear or logarithmic scale for drawing.

Enumerator
kLog 
kLinear 

‍Linear scale.

Definition at line 69 of file BmnDrawHist.h.

Function Documentation

◆ DrawGraph() [1/2]

void DrawGraph ( const vector< TGraph * > &  graphs,
const vector< string > &  graphLabels,
HistScale  logx = kLinear,
HistScale  logy = kLinear,
Bool_t  drawLegend = true,
Double_t  x1 = 0.25,
Double_t  y1 = 0.99,
Double_t  x2 = 0.55,
Double_t  y2 = 0.75 
)

Definition at line 281 of file BmnDrawHist.cxx.

◆ DrawGraph() [2/2]

void DrawGraph ( TGraph *  graph,
HistScale  logx = kLinear,
HistScale  logy = kLinear,
const string &  drawOpt = "AC",
Int_t  color = BmnDrawingOptions::Color(0),
Int_t  lineWidth = BmnDrawingOptions::LineWidth(),
Int_t  lineStyle = BmnDrawingOptions::LineStyle(0),
Int_t  markerSize = BmnDrawingOptions::MarkerSize(),
Int_t  markerStyle = BmnDrawingOptions::MarkerStyle(0) 
)

Definition at line 242 of file BmnDrawHist.cxx.

Referenced by DrawGraph().

◆ DrawGraph2D()

void DrawGraph2D ( TGraph2D *  graph,
HistScale  logx = kLinear,
HistScale  logy = kLinear,
HistScale  logz = kLinear,
const string &  drawOpt = "colz" 
)

Definition at line 315 of file BmnDrawHist.cxx.

◆ DrawH1() [1/2]

void DrawH1 ( const vector< TH1 * > &  histos,
const vector< string > &  histLabels,
HistScale  logx = kLinear,
HistScale  logy = kLinear,
Bool_t  drawLegend = true,
Double_t  x1 = 0.25,
Double_t  y1 = 0.99,
Double_t  x2 = 0.55,
Double_t  y2 = 0.75,
const string &  drawOpt = "",
Bool_t  outputMeanValue01 = kFALSE 
)

Definition at line 122 of file BmnDrawHist.cxx.

◆ DrawH1() [2/2]

void DrawH1 ( TH1 *  hist,
HistScale  logx = kLinear,
HistScale  logy = kLinear,
const string &  drawOpt = "",
Int_t  color = BmnDrawingOptions::Color(0),
Int_t  lineWidth = BmnDrawingOptions::LineWidth(),
Int_t  lineStyle = BmnDrawingOptions::LineStyle(0),
Float_t  markerSize = BmnDrawingOptions::MarkerSize(),
Int_t  markerStyle = BmnDrawingOptions::MarkerStyle(0),
Int_t  fillColor = -1 
)

Definition at line 43 of file BmnDrawHist.cxx.

Referenced by DrawH1().

◆ DrawH2()

void DrawH2 ( TH2 *  hist,
HistScale  logx = kLinear,
HistScale  logy = kLinear,
HistScale  logz = kLinear,
const string &  drawOpt = "COLZ" 
)

Definition at line 84 of file BmnDrawHist.cxx.

◆ DrawMeanLine()

void DrawMeanLine ( TH1 *  hist)
  • Draw several TH1 histograms. *‍/

Definition at line 228 of file BmnDrawHist.cxx.

◆ SetDefaultDrawStyle()

void SetDefaultDrawStyle ( )

Definition at line 28 of file BmnDrawHist.cxx.