|
BmnRoot 26.10.0-19-g6979a6c6
Software framework of the BM@N experiment
|
Helper functions for drawing 1D and 2D histograms and graphs. More...
#include "TGraph.h"#include "TGraph2D.h"#include "TH1.h"#include "TH1D.h"#include "TH2.h"#include "TLegend.h"#include "TPad.h"#include <fstream>#include <string>#include <vector>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) |
Definition in file BmnDrawHist.h.
| enum HistScale |
| Enumerator | ||
|---|---|---|
| kLog | 0 | |
| kLinear | 1 |
|
Definition at line 63 of file BmnDrawHist.h.
| 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 288 of file BmnDrawHist.cxx.
References TLegend::AddEntry(), BmnDrawingOptions::Color(), TLegend::Draw(), DrawGraph(), TAxis::GetXmax(), TAxis::GetXmin(), TGraph::GetYaxis(), BmnDrawingOptions::LineStyle(), BmnDrawingOptions::LineWidth(), BmnDrawingOptions::MarkerSize(), BmnDrawingOptions::MarkerStyle(), max(), min(), and TAttFill::SetFillColor().
| 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 249 of file BmnDrawHist.cxx.
References TGraph::Draw(), TGraph::GetXaxis(), TGraph::GetYaxis(), kLog, TAttAxis::SetLabelSize(), TAttLine::SetLineColor(), TAttLine::SetLineStyle(), TAttLine::SetLineWidth(), TAttMarker::SetMarkerColor(), TAttMarker::SetMarkerSize(), TAttMarker::SetMarkerStyle(), TAttAxis::SetNdivisions(), TAttAxis::SetTitleOffset(), TAttAxis::SetTitleSize(), and BmnDrawingOptions::TextSize().
Referenced by DrawGraph().
| void DrawGraph2D | ( | TGraph2D * | graph, |
| HistScale | logx = kLinear, | ||
| HistScale | logy = kLinear, | ||
| HistScale | logz = kLinear, | ||
| const string & | drawOpt = "colz" ) |
Definition at line 323 of file BmnDrawHist.cxx.
References TGraph2D::Draw(), TGraph2D::GetXaxis(), TGraph2D::GetYaxis(), TGraph2D::GetZaxis(), kLog, TAttAxis::SetLabelSize(), TAttAxis::SetNdivisions(), TAttAxis::SetTitleOffset(), TAttAxis::SetTitleSize(), and BmnDrawingOptions::TextSize().
| 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 120 of file BmnDrawHist.cxx.
References TLegend::AddEntry(), BmnDrawingOptions::Color(), TString::Data(), TLegend::Draw(), DrawH1(), f, TString::Format(), TH1::GetBinCenter(), TH1::GetBinContent(), TH1::GetMaximum(), TNamed::GetName(), TH1::GetNbinsX(), i, TH1::Integral(), BmnDrawingOptions::LineStyle(), BmnDrawingOptions::LineWidth(), BmnDrawingOptions::MarkerSize(), BmnDrawingOptions::MarkerStyle(), max(), and TAttFill::SetFillColor().
| 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 44 of file BmnDrawHist.cxx.
References TH1::Draw(), TH1::GetXaxis(), TH1::GetYaxis(), kLog, TAttFill::SetFillColor(), TAttAxis::SetLabelSize(), TAttLine::SetLineColor(), TAttLine::SetLineStyle(), TAttLine::SetLineWidth(), TAttMarker::SetMarkerColor(), TAttMarker::SetMarkerSize(), TAttMarker::SetMarkerStyle(), TAttAxis::SetNdivisions(), TH1::SetStats(), TAttAxis::SetTitleOffset(), TAttAxis::SetTitleSize(), and BmnDrawingOptions::TextSize().
Referenced by BmnClusteringQaReport::DrawEventsInfo(), BmnLambdaQaReport::DrawGeomEfficiencyHistograms(), DrawH1(), BmnLambdaQaReport::DrawNumberOfLambdaDecayMesonsHistograms(), BmnLambdaQaReport::DrawNumberOfLambdaDecayMesonsReconstructedHistograms(), BmnLambdaQaReport::DrawNumberOfLambdaDecayProtonsHistograms(), BmnLambdaQaReport::DrawNumberOfLambdaDecayProtonsReconstructedHistograms(), BmnLambdaQaReport::DrawNumberOfLambdaHistograms(), BmnLambdaQaReport::DrawNumberOfNotReconstructedLambdasHistograms(), BmnLambdaQaReport::DrawNumberOfReconstructableLambdaHistograms(), BmnLambdaQaReport::DrawNumberOfReconstructedLambdaHistograms(), BmnSimulationReport::DrawOneH1(), BmnClusteringQaReport::DrawPullXbyStation(), BmnClusteringQaReport::DrawPullYbyStation(), BmnLambdaQaReport::DrawRecMesonsGeomRecEffHistograms(), BmnLambdaQaReport::DrawRecMesonsReconstructionEfficiencyHistograms(), BmnLambdaQaReport::DrawReconstructedFromMCLambdasHistograms(), BmnLambdaQaReport::DrawReconstructedFromMCWOCutsLambdasHistograms(), BmnLambdaQaReport::DrawReconstructedLambdasHistograms(), BmnLambdaQaReport::DrawReconstructedLambdasWOCutsHistograms(), BmnLambdaQaReport::DrawReconstructionEfficiencyHistograms(), BmnLambdaQaReport::DrawRecProtonsGeomEffHistograms(), BmnLambdaQaReport::DrawRecProtonsReconstructionEfficiencyHistograms(), BmnClusteringQaReport::DrawResXbyStation(), BmnClusteringQaReport::DrawResYbyStation(), BmnSimulationReport::DrawThreeH1(), and BmnSimulationReport::DrawTwoH1().
| void DrawH2 | ( | TH2 * | hist, |
| HistScale | logx = kLinear, | ||
| HistScale | logy = kLinear, | ||
| HistScale | logz = kLinear, | ||
| const string & | drawOpt = "COLZ" ) |
Definition at line 86 of file BmnDrawHist.cxx.
References TH1::Draw(), TH1::GetXaxis(), TH1::GetYaxis(), TH1::GetZaxis(), kLog, TAttAxis::SetLabelSize(), TAttAxis::SetNdivisions(), TH1::SetStats(), TAttAxis::SetTitleOffset(), TAttAxis::SetTitleSize(), and BmnDrawingOptions::TextSize().
Referenced by BmnClusteringQaReport::DrawEventsInfo(), BmnSimulationReport::DrawFourH2(), BmnSimulationReport::DrawNH2(), BmnClusteringQaReport::DrawOccupancyByStation(), BmnSimulationReport::DrawOneH2(), BmnClusteringQaReport::DrawSimXRecXbyStation(), BmnClusteringQaReport::DrawSimYRecYbyStation(), BmnSimulationReport::DrawThreeH2(), BmnLambdaQaReport::DrawTwoDimensinalReconstructedFromMCLambdasHistograms(), BmnLambdaQaReport::DrawTwoDimensinalReconstructedFromMCWOCutsLambdasHistograms(), BmnLambdaQaReport::DrawTwoDimensinalReconstructedLambdasHistograms(), BmnLambdaQaReport::DrawTwoDimensinalReconstructedLambdasWOCutsHistograms(), BmnLambdaQaReport::DrawTwoDimensionalRealRecEfficiencyHistograms(), BmnLambdaQaReport::DrawTwoDimensionalRealRecEfficiencyRecMesonsHistograms(), BmnLambdaQaReport::DrawTwoDimensionalRealRecEfficiencyRecProtonsHistograms(), BmnLambdaQaReport::DrawTwoDimensionalRecGeomEfficiencyHistograms(), BmnLambdaQaReport::DrawTwoDimensionalRecMesonsGeomRecEfficiencyHistograms(), BmnLambdaQaReport::DrawTwoDimensionalRecProtonsRecEfficiencyHistograms(), and BmnSimulationReport::DrawTwoH2().
| void DrawMeanLine | ( | TH1 * | hist | ) |
Definition at line 233 of file BmnDrawHist.cxx.
References TObject::Draw(), TH1::GetBinContent(), TAttLine::GetLineColor(), TH1::GetNbinsX(), TH1::GetXaxis(), TAxis::GetXmax(), TAxis::GetXmin(), i, TH1::Integral(), TAttLine::SetLineColor(), and TAttLine::SetLineWidth().
| void SetDefaultDrawStyle | ( | ) |
Definition at line 28 of file BmnDrawHist.cxx.
Referenced by BmnPidQaReport::Draw(), BmnTrackingQaReport::Draw(), BmnProfQa::Init(), and BmnTrackingQaExp::Init().