CbmRoot
CbmDrawHist.h File Reference

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

#include <Rtypes.h>
#include <RtypesCore.h>
#include <TAttMarker.h>
#include <string>
#include <vector>
Include dependency graph for CbmDrawHist.h:

Go to the source code of this file.

Classes

class  CbmDrawingOptions
 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 std::string &drawOpt="", Int_t color=CbmDrawingOptions::Color(0), Int_t lineWidth=CbmDrawingOptions::LineWidth(), Int_t lineStyle=CbmDrawingOptions::LineStyle(0), Int_t markerSize=CbmDrawingOptions::MarkerSize(), Int_t markerStyle=CbmDrawingOptions::MarkerStyle(0))
 
void DrawH2 (TH2 *hist, HistScale logx=kLinear, HistScale logy=kLinear, HistScale logz=kLinear, const std::string &drawOpt="COLZ")
 
void DrawH1 (const std::vector< TH1 * > &histos, const std::vector< std::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 std::string &drawOpt="")
 
void DrawGraph (TGraph *graph, HistScale logx=kLinear, HistScale logy=kLinear, const std::string &drawOpt="AC", Int_t color=CbmDrawingOptions::Color(0), Int_t lineWidth=CbmDrawingOptions::LineWidth(), Int_t lineStyle=CbmDrawingOptions::LineStyle(0), Int_t markerSize=CbmDrawingOptions::MarkerSize(), Int_t markerStyle=CbmDrawingOptions::MarkerStyle(0))
 
void DrawGraph (const std::vector< TGraph * > &graphs, const std::vector< std::string > &graphLabels, HistScale logx=kLinear, HistScale logy=kLinear, Bool_t drawLegend=true, Double_t x1=0.50, Double_t y1=0.78, Double_t x2=0.99, Double_t y2=0.99)
 
void DrawGraph2D (TGraph2D *graph, HistScale logx=kLinear, HistScale logy=kLinear, HistScale logz=kLinear, const std::string &drawOpt="colz")
 
void DrawTextOnPad (const std::string &text, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
 
void DrawH1andFitGauss (TH1 *hist, Bool_t drawResults=true, Bool_t doScale=true, Double_t userRangeMin=0., Double_t userRangeMax=0.)
 
void DrawH2WithProfile (TH2 *hist, Bool_t doGaussFit=false, Bool_t drawOnlyMean=false, const std::string &drawOpt="COLZ", Int_t profileColor=kBlack, Int_t profileLineWidth=4)
 
TH2D * DrawH3Profile (TH3 *h, Bool_t drawMean=true, Bool_t doGaussFit=false, Double_t zUserRangeMin=0., Double_t zUserRangeMax=0.)
 

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 CbmDrawHist.h.

Enumeration Type Documentation

◆ HistScale

enum HistScale

Define linear or logarithmic scale for drawing.

Enumerator
kLog 
kLinear 

Linear scale.

Definition at line 77 of file CbmDrawHist.h.

Function Documentation

◆ DrawGraph() [1/2]

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

◆ DrawGraph() [2/2]

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

◆ DrawGraph2D()

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

◆ DrawH1() [1/2]

void DrawH1 ( const std::vector< TH1 * > &  histos,
const std::vector< std::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 std::string &  drawOpt = "" 
)

◆ DrawH1() [2/2]

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

◆ DrawH1andFitGauss()

void DrawH1andFitGauss ( TH1 *  hist,
Bool_t  drawResults = true,
Bool_t  doScale = true,
Double_t  userRangeMin = 0.,
Double_t  userRangeMax = 0. 
)

◆ DrawH2()

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

◆ DrawH2WithProfile()

void DrawH2WithProfile ( TH2 *  hist,
Bool_t  doGaussFit = false,
Bool_t  drawOnlyMean = false,
const std::string &  drawOpt = "COLZ",
Int_t  profileColor = kBlack,
Int_t  profileLineWidth = 4 
)

◆ DrawH3Profile()

TH2D* DrawH3Profile ( TH3 *  h,
Bool_t  drawMean = true,
Bool_t  doGaussFit = false,
Double_t  zUserRangeMin = 0.,
Double_t  zUserRangeMax = 0. 
)

◆ DrawTextOnPad()

void DrawTextOnPad ( const std::string &  text,
Double_t  x1,
Double_t  y1,
Double_t  x2,
Double_t  y2 
)

◆ SetDefaultDrawStyle()