eicplot  trunk
EIC ROOT plotting utilities
/Users/thomasburton/Documents/projects/eic/Utilities/eicplot/trunk/include/eicplot/Q2VsXPlot.h
Go to the documentation of this file.
00001 
00008 #ifndef _EICPLOT_Q2VSXPLOT_H_
00009 #define _EICPLOT_Q2VSXPLOT_H_
00010 
00011 #include <TF1.h>
00012 #include <TH2D.h>
00013 #include <TString.h>
00014 #include <TText.h>
00015 
00016 #include "eicplot/Utilities.h" // For erhic::Range<double>
00017 
00018 class TF1;
00019 
00020 namespace erhic {
00025    class Q2VsXPlot : public TH2D {
00026    public:
00028       Q2VsXPlot(const TString& name = "", const TString& title = "",
00029                 const Int_t nXBins = 100,
00030                 const Double_t& xLow = 1e-5, const Double_t& xHigh = 1.,
00031                 const Int_t nQ2Bins = 100,
00032                 const Double_t& Q2Low = 0.01, const Double_t& Q2High = 100.);
00034       virtual ~Q2VsXPlot();
00039       void setS(const Double_t&);
00044       Double_t getS() const;
00049       void setYRange(const Range<double>& = Range<double>(0.01, 0.95));
00051       void setYRange(double min, double max);
00055       const Range<double>& getYRange() const;
00059       virtual void Draw(Option_t* = "");
00063       virtual void SetLineColor(Color_t);
00067       virtual void SetLineStyle(Style_t);
00073       virtual void SetLabelColor(Color_t, Option_t*);
00078       TF1* yLower();
00083       TF1* yUpper();
00088       TText* GetLabelLower();
00093       TText* GetLabelUpper();
00103       TF1* Q2FromSXY(Double_t y, const TString& name, TF1* = NULL);
00105       void SetLabel(const TF1&, double y, TText&);
00106    protected:
00107       Double_t mS; 
00108       TF1* mYLowerFunction; 
00109       TF1* mYUpperFunction; 
00110       Range<double> mYRange; 
00111       TText mTextYLower; 
00112       TText mTextYUpper; 
00113       ClassDef(Q2VsXPlot, 1)
00114    };
00115 
00116    inline void Q2VsXPlot::setS(const Double_t& s) {
00117       mS = s;
00118    }
00119 
00120    inline Double_t Q2VsXPlot::getS() const {
00121       return mS;
00122    }
00123    
00124    inline const Range<double>& Q2VsXPlot::getYRange() const {
00125       return mYRange;
00126    }
00127    
00128    inline void Q2VsXPlot::setYRange(double min, double max) {
00129       setYRange(Range<double>(min, max));
00130    }
00131    
00132    inline TF1* Q2VsXPlot::yLower() {
00133       return mYLowerFunction;
00134    }
00135 
00136    inline TF1* Q2VsXPlot::yUpper() {
00137       return mYUpperFunction;
00138    }
00139 } // namespace erhic
00140 
00141 #endif