00001 #ifndef _QG_PULSE_HH_ 00002 #define _QG_PULSE_HH_ 00003 00011 #include <list> 00012 #include <vector> 00013 #include "QGGraph.hh" 00014 00015 class TEventList; 00016 class TMarker; 00017 00018 class QGPulse : public QGGraph { 00019 public: 00021 QGPulse(); 00022 00024 QGPulse(const QGPulse&); 00025 00027 virtual ~QGPulse(); 00028 00030 void AutoSetStyle(); 00031 00033 void Display(); 00034 00036 void DisplayEditWindow(); 00037 00039 void DrawStylePulse(); 00040 00042 void Duplicate(); 00043 00045 void Erase(); 00046 00048 void FillEventData(); 00049 00051 void Generate(QChain *chain = 0); 00052 00054 const std::vector<std::string>& GetEventData() const {return fEventData;} 00055 00057 Int_t GetEventIndex() {return fEventIndex;} 00058 00060 Int_t GetNumberOfEvents(); 00061 00063 const std::string& GetOrderVariable() const {return fOrderVariable;} 00064 00066 void GetParametersFromEditWindow(); 00067 00069 void GetPulseFromChain(Long64_t eventIndex); 00070 00072 TGraph *GetStylePulse() {return fStylePulse;} 00073 00075 bool IsUseADCUnitsSet() const {return fUseADCUnits;} 00076 00078 void MakeStylePlot(); 00079 00081 bool NeedsReordering() const {return fNeedsReordering;} 00082 00084 void Order(); 00085 00087 void SetEventData(const std::vector<std::string>& eventData) {fEventData = eventData;} 00088 00090 void SetEventIndex(Long_t index); 00091 00093 void SetName(const char *name = 0); 00094 00096 void SetOrderVariable(const std::string& orderVariable); 00097 00099 void SetProperty(const std::string& key, const std::string& value); 00100 00102 void SetReorder(bool flag = true) {fNeedsReordering = flag;} 00103 00105 void SetUseADCUnits(bool flag = true) {fUseADCUnits = flag;} 00106 00108 void UpdatePulseEditWindow(); 00109 00110 private: 00112 void DisplaySampleMarkers(); 00113 00115 std::vector<std::string> fEventData; 00116 00118 std::vector<Long64_t>::size_type fEventIndex; 00119 00121 TEventList *fEventList; 00122 00124 bool fNeedsReordering; 00125 00127 std::vector<Long64_t> fOrderedEvents; 00128 00130 std::string fOrderVariable; 00131 00133 static std::list<QGPulse*> fPulses; 00134 00136 std::vector<TMarker*> fSampleMarkers; 00137 00139 TGraph *fStylePulse; 00140 00142 bool fUseADCUnits; 00143 00144 ClassDef(QGPulse, 0) 00145 }; 00146 00147 #endif