00001 #ifndef _M_COINCIDENCE_TIMING_HH_ 00002 #define _M_COINCIDENCE_TIMING_HH_ 00003 00072 #include "QModule.hh" 00073 #include <map> 00074 #include <string> 00075 #include <vector> 00076 00077 class MCoincidenceTiming : public QModule { 00078 00079 public: 00081 MCoincidenceTiming(QSequence* s); 00082 00084 virtual ~MCoincidenceTiming(); 00085 00087 void Init(); 00088 00090 QEvent* Do(QEvent* ev); 00091 00093 void Done(); 00094 00095 private: 00096 00097 class EventInfo { 00098 public: 00099 EventInfo(const QEvent *ev); 00100 void ApplyOffset(double samplingPeriod); 00101 // Define < operator in order to sort events by time 00102 bool operator<(const EventInfo& ev) const { 00103 return (this->fTimeFromStartRunNs < ev.fTimeFromStartRunNs); 00104 } 00105 int fChannel; 00106 int fEventNumber; 00107 int fHeaterChannel; 00108 bool fPassed; 00109 double fPulseTimeOffset; 00110 int fRelative; 00111 long long fTimeFromStartRunNs; 00112 }; 00113 00114 class ChannelInfo { 00115 public: 00116 int fHeaterChan; 00117 int fRelative; 00118 }; 00119 00121 std::string fDetectorSetupFile; 00122 00124 std::vector<EventInfo> fEventList; 00125 00127 std::map<int, unsigned int> fEventListIndex; 00128 00130 std::string fFilteredEventsType; 00131 00133 bool fIsRunDataLoaded; 00134 00137 std::map<int, ChannelInfo> fRelatedMap; 00138 00140 double fSamplingPeriod; 00141 00143 double fTimeWindow; 00144 00147 bool fUsePulseStartTimeOffset; 00148 00149 }; 00150 00151 #endif