00001 #ifndef _QG_CALIBRATION_WINDOW_HH_ 00002 #define _QG_CALIBRATION_WINDOW_HH_ 00003 00011 #include "QGWindow.hh" 00012 #include <map> 00013 #include <string> 00014 #include <vector> 00015 00016 class QGCalibrationPeakFrame; 00017 class QGPlot; 00018 class TGComboBox; 00019 class TGHorizontalFrame; 00020 class TGTextButton; 00021 class TGVerticalFrame; 00022 00023 class QGCalibrationWindow : public QGWindow { 00024 public: 00026 QGCalibrationWindow(const TGWindow *p = 0, UInt_t w = 350, UInt_t h = 300); 00027 00029 virtual ~QGCalibrationWindow(); 00030 00032 void AddPeak(Double_t energy); 00033 00035 void Clear(); 00036 00038 QGPlot *GetCurrentPlot() const; 00039 00041 void HandleDrawButton(); 00042 00044 void HandleHistogramDropDownBox(const char *text); 00045 00047 void HandleSaveButton(); 00048 00050 void SetProperty(const std::string& key, const std::string& value); 00051 00052 private: 00054 void LoadData(const std::string& histogramName); 00055 00057 void SaveData(); 00058 00060 void SetUpHistograms(); 00061 00063 std::vector<QGCalibrationPeakFrame*> fCalibrationPeakFrames; 00064 00066 std::string fCurrentHistogramName; 00067 00069 TGTextButton *fDrawButton; 00070 00072 TGComboBox *fHistogramDropDownBox; 00073 00075 TGHorizontalFrame *fHistogramFrame; 00076 00078 std::map<std::string, std::map<QGCalibrationPeakFrame*, Double_t> > fMaxData; 00079 00081 std::map<std::string, std::map<QGCalibrationPeakFrame*, Double_t> > fMinData; 00082 00084 std::string fOutputFilename; 00085 00087 TGTextButton *fSaveButton; 00088 00089 ClassDef(QGCalibrationWindow, 0) 00090 }; 00091 00092 #endif