QTScatterPlot.hh
00001 #ifndef _QT_SCATTERPLOT_HH_
00002 #define _QT_SCATTERPLOT_HH_
00003
00004 #include "QCuore.hh"
00005 #include <TCanvas.h>
00006 #include <TGraph.h>
00007 #include <string>
00008
00009 class TH1D;
00010
00011 Q_BEGIN_NAMESPACE
00012
00013 class QTScatterPlot : public TGraph {
00014
00015 public:
00016 QTScatterPlot();
00017
00018 virtual ~QTScatterPlot();
00019
00020 void AddEntry(const double x, const double y);
00021
00022 void AutoSetDisplayInRange(
00023 const double xLowerBound, const double xUpperBound,
00024 const double yLowerBound, const double yUpperBound
00025 );
00026
00027 void AutoSetXAxisDisplayInRange(
00028 const double xLowerBound, const double xUpperBound);
00029
00030 void AutoSetYAxisDisplayInRange(
00031 const double yLowerBound, const double yUpperBound);
00032
00033 void Draw(Option_t* chopt = "");
00034
00035 int GetChannel() const
00036 {return fChannel;}
00037
00038 double GetMedianAbsoluteDeviationInRange(
00039 Int_t axis, const double lowerBound, const double upperBound) const;
00040
00041 double GetMedian(Int_t axis = 1) const;
00042
00043 double GetMedianInRange(
00044 Int_t axis, const double lowerBound, const double upperBound) const;
00045
00046 int GetRun() const
00047 {return fRun;}
00048
00049 const std::string& GetVarName() const
00050 {return fVarName;}
00051
00052 void Projection(const Int_t axis, TH1D& histogram);
00053
00054 void SaveAs(const std::string filename, Option_t* option = "");
00055
00056 void SetChannel(const int channel)
00057 {fChannel = channel; SetName();}
00058
00059 void SetName();
00060
00061 void SetRun(const int run)
00062 {fRun = run; SetName();}
00063
00064 void SetVarName(const std::string varName)
00065 {fVarName = varName; SetName();}
00066
00067 void SetXVariable(const std::string var)
00068 {fXVariable = var;}
00069
00070 void SetYVariable(const std::string var)
00071 {fYVariable = var;}
00072
00073 private:
00074 int fChannel;
00075
00076 int fRun;
00077
00078 std::string fVarName;
00079
00080 std::string fXVariable;
00081
00082 std::string fYVariable;
00083
00084 };
00085
00086 Q_END_NAMESPACE
00087
00088 #endif