#ifndef VEGA_VGenericSignal #define VEGA_VGenericSignal #include "FrameL.h" #ifdef USE_VEGA // ************************************************** // Case of using the library in conjonction with vega // ************************************************** #include "VManagerFrameL.h" class VGenericSignal { private : VSPlot* mPlot; // pointer to representation on screen protected : FrVect* mVect; // pointer to vector public : VGenericSignal() {mPlot = 0;} inline void Draw(Option_t* option="") {gVM->Draw(mVect,option); mPlot = gVM->GetLastPlot();} // Plot manipulation and changes. // Need to have these functions here to avoid deriving from TH1F or other BIG classes inline Color_t GetLineColor() const {if (gVM->GetPlot(mPlot)) return mPlot->GetLineColor(); return 0;} inline Style_t GetLineStyle() const {if (gVM->GetPlot(mPlot)) return mPlot->GetLineStyle(); return 0;} inline Width_t GetLineWidth() const {if (gVM->GetPlot(mPlot)) return mPlot->GetLineWidth(); return 0;} inline Color_t GetFillColor() const {if (gVM->GetPlot(mPlot)) return mPlot->GetFillColor(); return 0;} inline Style_t GetFillStyle() const {if (gVM->GetPlot(mPlot)) return mPlot->GetFillStyle(); return 0;} inline Color_t GetMarkerColor() const {if (gVM->GetPlot(mPlot)) return mPlot->GetMarkerColor(); return 0;} inline Size_t GetMarkerSize() const {if (gVM->GetPlot(mPlot)) return mPlot->GetMarkerSize(); return 0;} inline Style_t GetMarkerStyle() const {if (gVM->GetPlot(mPlot)) return mPlot->GetMarkerStyle(); return 0;} inline Color_t GetAxisColor(Option_t* axis = "X") const {if (gVM->GetPlot(mPlot)) return mPlot->GetAxisColor(axis); return 0;} inline Float_t GetBarOffset() const {if (gVM->GetPlot(mPlot)) return mPlot->GetBarOffset(); return 0;} inline Float_t GetBarWidth() const {if (gVM->GetPlot(mPlot)) return mPlot->GetBarWidth(); return 0;} inline Color_t GetLabelColor(Option_t* axis = "X") const {if (gVM->GetPlot(mPlot)) return mPlot->GetLabelColor(axis); return 0;} inline Style_t GetLabelFont(Option_t* axis = "X") const {if (gVM->GetPlot(mPlot)) return mPlot->GetLabelFont(axis); return 0;} inline Float_t GetLabelOffset(Option_t* axis = "X") const {if (gVM->GetPlot(mPlot)) return mPlot->GetLabelOffset(axis); return 0;} inline Float_t GetLabelSize(Option_t* axis = "X") const {if (gVM->GetPlot(mPlot)) return mPlot->GetLabelSize(axis); return 0;} inline Int_t GetNdivisions(Option_t* axis = "X") const {if (gVM->GetPlot(mPlot)) return mPlot->GetNdivisions(axis); return 0;} inline Float_t GetTickLength(Option_t* axis = "X") const {if (gVM->GetPlot(mPlot)) return mPlot->GetTickLength(axis); return 0;} inline Float_t GetTitleOffset(Option_t* axis = "X") const {if (gVM->GetPlot(mPlot)) return mPlot->GetTitleOffset(axis); return 0;} inline Float_t GetTitleSize(Option_t* axis = "X") const {if (gVM->GetPlot(mPlot)) return mPlot->GetTitleSize(axis); return 0;} inline TAxis* GetXaxis() {if (gVM->GetPlot(mPlot)) return mPlot->GetXaxis(); return 0;} inline TAxis* GetYaxis() {if (gVM->GetPlot(mPlot)) return mPlot->GetYaxis(); return 0;} inline TAxis* GetZaxis() {if (gVM->GetPlot(mPlot)) return mPlot->GetZaxis(); return 0;} inline void SetLineColor(Color_t lcolor) {if (gVM->GetPlot(mPlot)) mPlot->SetLineColor(lcolor);} inline void SetLineStyle(Style_t lstyle) {if (gVM->GetPlot(mPlot)) mPlot->SetLineStyle(lstyle);} inline void SetLineWidth(Width_t lwidth) {if (gVM->GetPlot(mPlot)) mPlot->SetLineWidth(lwidth);} inline void SetFillColor(Color_t fcolor) {if (gVM->GetPlot(mPlot)) mPlot->SetFillColor(fcolor);} inline void SetFillStyle(Style_t fstyle) {if (gVM->GetPlot(mPlot)) mPlot->SetFillStyle(fstyle);} inline void SetMarkerColor(Color_t tcolor = 1) {if (gVM->GetPlot(mPlot)) mPlot->SetMarkerColor(tcolor);} inline void SetMarkerSize(Size_t msize = 1) {if (gVM->GetPlot(mPlot)) mPlot->SetMarkerSize(msize);} inline void SetMarkerStyle(Style_t mstyle = 1) {if (gVM->GetPlot(mPlot)) mPlot->SetMarkerStyle(mstyle);} inline void SetAxisColor(Color_t color = 1, Option_t* axis = "X") {if (gVM->GetPlot(mPlot)) mPlot->SetAxisColor(color,axis);} inline void SetAxisRange(Axis_t xmin, Axis_t xmax, Option_t* axis = "X") {if (gVM->GetPlot(mPlot)) mPlot->SetAxisRange(xmin,xmax,axis);} inline void SetBarOffset(Float_t offset = 0.25) {if (gVM->GetPlot(mPlot)) mPlot->SetBarOffset(offset);} inline void SetBarWidth(Float_t width = 0.5) {if (gVM->GetPlot(mPlot)) mPlot->SetBarWidth(width);} inline void SetLabelColor(Color_t color = 1, Option_t* axis = "X") {if (gVM->GetPlot(mPlot)) mPlot->SetLabelColor(color,axis);} inline void SetLabelFont(Style_t font = 62, Option_t* axis = "X") {if (gVM->GetPlot(mPlot)) mPlot->SetLabelFont(font,axis);} inline void SetLabelOffset(Float_t offset = 0.005, Option_t* axis = "X") {if (gVM->GetPlot(mPlot)) mPlot->SetLabelOffset(offset,axis);} inline void SetLabelSize(Float_t size = 0.02, Option_t* axis = "X") {if (gVM->GetPlot(mPlot)) mPlot->SetLabelSize(size,axis);} inline void SetMaximum(Double_t maximum = -1111) {if (gVM->GetPlot(mPlot)) mPlot->SetMaximum(maximum);} inline void SetMinimum(Double_t minimum = -1111) {if (gVM->GetPlot(mPlot)) mPlot->SetMinimum(minimum);} inline void SetNdivisions(Int_t n = 510, Option_t* axis = "X") {if (gVM->GetPlot(mPlot)) mPlot->SetNdivisions(n,axis);} inline void SetPlotTitle(const char* title) {if (gVM->GetPlot(mPlot)) mPlot->SetTitle(title);} inline void SetTickLength(Float_t length = 0.02, Option_t* axis = "X") {if (gVM->GetPlot(mPlot)) mPlot->SetTickLength(length,axis);} inline void SetTitleOffset(Float_t offset = 1, Option_t* axis = "X") {if (gVM->GetPlot(mPlot)) mPlot->SetTitleOffset(offset,axis);} inline void SetTitleSize(Float_t size = 0.02, Option_t* axis = "X") {if (gVM->GetPlot(mPlot)) mPlot->SetTitleSize(size,axis);} inline void SetXTitle(const char* title) {if (gVM->GetPlot(mPlot)) mPlot->SetXTitle(title);} inline void SetYTitle(const char* title) {if (gVM->GetPlot(mPlot)) mPlot->SetYTitle(title);} inline void SetZTitle(const char* title) {if (gVM->GetPlot(mPlot)) mPlot->SetZTitle(title);} inline void UseCurrentStyle() {if (gVM->GetPlot(mPlot)) mPlot->UseCurrentStyle();} // STATISTICS double Mean(); double Rms(); double Max(); double Min(); double PkPk(); double Delta(); ClassDef(VGenericSignal,0) // Base class for signal view. Contains type-independent methods }; #else // ************************************** // Standalone library use case // ************************************** class VGenericSignal { protected : FrVect* mVect; // pointer to vector public : VGenericSignal() {mVect = 0;} // STATISTICS double Mean(); double Rms(); double Max(); double Min(); double PkPk(); double Delta(); }; #endif #endif