diff --git a/src/classes/PMusrCanvas.cpp b/src/classes/PMusrCanvas.cpp index de58949c..f356fc83 100644 --- a/src/classes/PMusrCanvas.cpp +++ b/src/classes/PMusrCanvas.cpp @@ -50,6 +50,7 @@ PMusrCanvas::PMusrCanvas() fValid = false; fPlotNumber = -1; + fStyle = 0; fMainCanvas = 0; fTitlePad = 0; fDataTheoryPad = 0; @@ -67,6 +68,7 @@ PMusrCanvas::PMusrCanvas(const int number, const char* title, Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh) : fPlotNumber(number) { + CreateStyle(); InitMusrCanvas(title, wtopx, wtopy, ww, wh); } @@ -81,6 +83,7 @@ PMusrCanvas::PMusrCanvas(const int number, const char* title, const PIntVector markerList, const PIntVector colorList) : fPlotNumber(number), fMarkerList(markerList), fColorList(colorList) { + CreateStyle(); InitMusrCanvas(title, wtopx, wtopy, ww, wh); } @@ -94,6 +97,10 @@ PMusrCanvas::~PMusrCanvas() { cout << "~PMusrCanvas() called" << endl; // cleanup + if (fStyle) { + delete fStyle; + fStyle = 0; + } if (fTitlePad) { fTitlePad->Clear(); delete fTitlePad; @@ -124,6 +131,20 @@ cout << "~PMusrCanvas() called" << endl; } } +//-------------------------------------------------------------------------- +// CreateStyle +//-------------------------------------------------------------------------- +/** + *
Set styles for the canvas. Perhaps one could transfer them to the startup-file in the future.
+ */
+void PMusrCanvas::CreateStyle()
+{
+ fStyle = new TStyle("musrStyle", "musrStyle");
+ fStyle->SetOptStat(0); // no statistics options
+ fStyle->SetOptTitle(0); // no title
+ fStyle->cd();
+}
+
//--------------------------------------------------------------------------
// InitMusrCanvas
//--------------------------------------------------------------------------
diff --git a/src/include/PMusrCanvas.h b/src/include/PMusrCanvas.h
index 64d378d2..e54da749 100644
--- a/src/include/PMusrCanvas.h
+++ b/src/include/PMusrCanvas.h
@@ -34,6 +34,7 @@
#include