00001
00002
00004 #ifndef __GwollumPlot__
00005 #define __GwollumPlot__
00006
00007 #include "CUtils.h"
00008 #include "TStyle.h"
00009 #include "TPad.h"
00010 #include "TCanvas.h"
00011 #include "TLegend.h"
00012 #include "TText.h"
00013
00014 using namespace std;
00015
00028 class GwollumPlot{
00029
00030 public:
00031
00049 GwollumPlot(const string aName, const string aStyleName="GWOLLUM");
00050
00054 virtual ~GwollumPlot(void);
00055
00069 void AddText(const string atext, const double ax, const double ay, const double asize);
00070
00077 void AddLegendEntry(const TObject *Obj, const string alabel, const string astyle="LPF");
00078
00083 void AddLegendHeader(const string alabel);
00084
00088 void DrawLegend(void);
00089
00093 void ResetLegend(void){ Wleg->Clear(); };
00094
00095
00101 inline void Draw(TObject *Obj, string Options=""){ Wpad->cd(); Obj->Draw(Options.c_str()); Wpad->Modified(); Wpad->Update(); };
00102
00107 inline void Print(const string filename){ Wcan->cd(); Wcan->Print(filename.c_str()); };
00108
00117 void Print(const string filename, const double rescale);
00118
00128 inline void SetLogx(const int value){ Wpad->SetLogx(value); Wpad->Modified(); Wpad->Update(); };
00129
00139 inline void SetLogy(const int value){ Wpad->SetLogy(value); Wpad->Modified(); Wpad->Update(); };
00140
00145 inline void SetLogz(const int value = 1){ Wpad->SetLogz(value); Wpad->Modified(); Wpad->Update(); };
00146
00151 inline void SetGridx(const int value = 1){ Wpad->SetGridx(value); Wpad->Modified(); Wpad->Update(); };
00156 inline void SetGridy(const int value = 1){ Wpad->SetGridy(value); Wpad->Modified(); Wpad->Update(); };
00157
00166 inline void ResizePlot(const int aWidth, const int aHeight){ Wcan->SetCanvasSize(aWidth,aHeight); Wpad->Modified(); Wpad->Update(); };
00167
00171 void SetGwollumStyle(void);
00175 void SetWhiteGwollumStyle(void);
00179 void SetStandardStyle(void);
00180
00181
00182 protected:
00183
00184 int randid;
00185 string srandid;
00186
00187
00188 TStyle *Wstyle;
00189
00190
00191 TCanvas *Wcan;
00192 TPad *Wpad;
00193
00194
00195 TLegend *Wleg;
00196 TText *tt;
00197
00198 ClassDef(GwollumPlot,0)
00199 };
00200
00201 #endif
00202
00203