ROOT logo
#ifndef RICHDRAWHIST_H_
#define RICHDRAWHIST_H_

#include "TH1.h"
#include "TH1D.h"
#include "TH2.h"
#include "TH3.h"
#include "TPad.h"
#include "TLegend.h"
#include "TGraph.h"
#include "TGraph2D.h"

#include <string>
#include <vector>
using std::string;
using std::vector;

class RichDrawingOptions
{
public:

    static Int_t Color(Int_t colorIndex) {
	static const Int_t nofColors = 6;
	static Int_t colors[nofColors] = {kRed, kBlue + 1, kGreen + 3, kMagenta + 4, kYellow + 2, kViolet};
	return (colorIndex < nofColors) ? colors[colorIndex] : colorIndex;
    }

    static Int_t LineWidth() {
	return 2;
    }

    static Int_t LineStyle(Int_t lineStyleIndex) {
	return lineStyleIndex + 1;
    }

    static Int_t MarkerSize() {
	return 1;
    }

    static Int_t MarkerStyle(Int_t markerIndex) {
	static const Int_t nofMarkers = 8;
	static Int_t markers[nofMarkers] = {kOpenCircle, kOpenSquare, kOpenTriangleUp, kOpenDiamond,
	kFullCircle, kFullSquare, kFullTriangleUp};
	return (markerIndex < nofMarkers) ? markers[markerIndex] : markerIndex;
    }

    static Double_t TextSize() {
	return 0.06;
    }
};

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


class HRichDrawHist : public TObject
{

public:
    static void SetDefaultDrawStyle();

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

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


    static void DrawH1(
		       const vector<TH1*>& histos,
		       const vector<string>& histLabels,
		       HistScale logx = kLinear,
		       HistScale logy = kLinear,
		       Bool_t drawLegend = kTRUE,
		       Double_t x1 = 0.6,
		       Double_t y1 = 0.99,
		       Double_t x2 = 0.99,
		       Double_t y2 = 0.83,
		       const string& drawOpt = "");

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

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

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

    static void DrawTextOnPad(
			      const string& text,
			      Double_t x1,
			      Double_t y1,
			      Double_t x2,
			      Double_t y2);

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

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

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


    ClassDef(HRichDrawHist,0)

};
#endif
 hrich700drawhist.h:1
 hrich700drawhist.h:2
 hrich700drawhist.h:3
 hrich700drawhist.h:4
 hrich700drawhist.h:5
 hrich700drawhist.h:6
 hrich700drawhist.h:7
 hrich700drawhist.h:8
 hrich700drawhist.h:9
 hrich700drawhist.h:10
 hrich700drawhist.h:11
 hrich700drawhist.h:12
 hrich700drawhist.h:13
 hrich700drawhist.h:14
 hrich700drawhist.h:15
 hrich700drawhist.h:16
 hrich700drawhist.h:17
 hrich700drawhist.h:18
 hrich700drawhist.h:19
 hrich700drawhist.h:20
 hrich700drawhist.h:21
 hrich700drawhist.h:22
 hrich700drawhist.h:23
 hrich700drawhist.h:24
 hrich700drawhist.h:25
 hrich700drawhist.h:26
 hrich700drawhist.h:27
 hrich700drawhist.h:28
 hrich700drawhist.h:29
 hrich700drawhist.h:30
 hrich700drawhist.h:31
 hrich700drawhist.h:32
 hrich700drawhist.h:33
 hrich700drawhist.h:34
 hrich700drawhist.h:35
 hrich700drawhist.h:36
 hrich700drawhist.h:37
 hrich700drawhist.h:38
 hrich700drawhist.h:39
 hrich700drawhist.h:40
 hrich700drawhist.h:41
 hrich700drawhist.h:42
 hrich700drawhist.h:43
 hrich700drawhist.h:44
 hrich700drawhist.h:45
 hrich700drawhist.h:46
 hrich700drawhist.h:47
 hrich700drawhist.h:48
 hrich700drawhist.h:49
 hrich700drawhist.h:50
 hrich700drawhist.h:51
 hrich700drawhist.h:52
 hrich700drawhist.h:53
 hrich700drawhist.h:54
 hrich700drawhist.h:55
 hrich700drawhist.h:56
 hrich700drawhist.h:57
 hrich700drawhist.h:58
 hrich700drawhist.h:59
 hrich700drawhist.h:60
 hrich700drawhist.h:61
 hrich700drawhist.h:62
 hrich700drawhist.h:63
 hrich700drawhist.h:64
 hrich700drawhist.h:65
 hrich700drawhist.h:66
 hrich700drawhist.h:67
 hrich700drawhist.h:68
 hrich700drawhist.h:69
 hrich700drawhist.h:70
 hrich700drawhist.h:71
 hrich700drawhist.h:72
 hrich700drawhist.h:73
 hrich700drawhist.h:74
 hrich700drawhist.h:75
 hrich700drawhist.h:76
 hrich700drawhist.h:77
 hrich700drawhist.h:78
 hrich700drawhist.h:79
 hrich700drawhist.h:80
 hrich700drawhist.h:81
 hrich700drawhist.h:82
 hrich700drawhist.h:83
 hrich700drawhist.h:84
 hrich700drawhist.h:85
 hrich700drawhist.h:86
 hrich700drawhist.h:87
 hrich700drawhist.h:88
 hrich700drawhist.h:89
 hrich700drawhist.h:90
 hrich700drawhist.h:91
 hrich700drawhist.h:92
 hrich700drawhist.h:93
 hrich700drawhist.h:94
 hrich700drawhist.h:95
 hrich700drawhist.h:96
 hrich700drawhist.h:97
 hrich700drawhist.h:98
 hrich700drawhist.h:99
 hrich700drawhist.h:100
 hrich700drawhist.h:101
 hrich700drawhist.h:102
 hrich700drawhist.h:103
 hrich700drawhist.h:104
 hrich700drawhist.h:105
 hrich700drawhist.h:106
 hrich700drawhist.h:107
 hrich700drawhist.h:108
 hrich700drawhist.h:109
 hrich700drawhist.h:110
 hrich700drawhist.h:111
 hrich700drawhist.h:112
 hrich700drawhist.h:113
 hrich700drawhist.h:114
 hrich700drawhist.h:115
 hrich700drawhist.h:116
 hrich700drawhist.h:117
 hrich700drawhist.h:118
 hrich700drawhist.h:119
 hrich700drawhist.h:120
 hrich700drawhist.h:121
 hrich700drawhist.h:122
 hrich700drawhist.h:123
 hrich700drawhist.h:124
 hrich700drawhist.h:125
 hrich700drawhist.h:126
 hrich700drawhist.h:127
 hrich700drawhist.h:128
 hrich700drawhist.h:129
 hrich700drawhist.h:130
 hrich700drawhist.h:131
 hrich700drawhist.h:132
 hrich700drawhist.h:133
 hrich700drawhist.h:134
 hrich700drawhist.h:135
 hrich700drawhist.h:136
 hrich700drawhist.h:137
 hrich700drawhist.h:138
 hrich700drawhist.h:139
 hrich700drawhist.h:140
 hrich700drawhist.h:141
 hrich700drawhist.h:142
 hrich700drawhist.h:143
 hrich700drawhist.h:144
 hrich700drawhist.h:145
 hrich700drawhist.h:146
 hrich700drawhist.h:147
 hrich700drawhist.h:148
 hrich700drawhist.h:149
 hrich700drawhist.h:150
 hrich700drawhist.h:151
 hrich700drawhist.h:152
 hrich700drawhist.h:153
 hrich700drawhist.h:154
 hrich700drawhist.h:155
 hrich700drawhist.h:156
 hrich700drawhist.h:157
 hrich700drawhist.h:158