MQwCodaControlEvent.h
Go to the documentation of this file.00001 #ifndef __MQWCODACONTROLEVENT__
00002 #define __MQWCODACONTROLEVENT__
00003
00004 #include <vector>
00005 #include <iostream>
00006 #include <Rtypes.h>
00007 #include <ctime>
00008 #include "TDatime.h"
00009 #include "TString.h"
00010
00011
00012
00013 class MQwCodaControlEvent
00014 {
00015 public:
00016 MQwCodaControlEvent();
00017 ~MQwCodaControlEvent();
00018
00019 void ResetControlParameters();
00020 void ProcessControlEvent(UInt_t evtype, UInt_t* buffer);
00021 void ReportRunSummary();
00022
00023 UInt_t GetStartTime() {return fStartTime;};
00024 UInt_t GetPrestartTime() {return fPrestartTime;};
00025 UInt_t GetPrestartRunNumber() {return fPrestartRunNumber;};
00026 UInt_t GetRunType() {return fRunType;};
00027
00028 UInt_t GetGoTime(int index = 0);
00029 UInt_t GetGoEventCount(int index = 0);
00030
00031 UInt_t GetPauseTime(int index = 0);
00032 UInt_t GetPauseEventCount(int index = 0);
00033
00034 UInt_t GetEndTime() {return fEndTime;};
00035 UInt_t GetEndEventCount() {return fEndEventCount;};
00036
00037 TString GetStartSQLTime();
00038 TString GetEndSQLTime();
00039
00040 time_t GetStartUnixTime();
00041 time_t GetEndUnixTime();
00042
00043
00044 protected:
00045 void ProcessSync(UInt_t local_time, UInt_t statuscode);
00046 void ProcessPrestart(UInt_t local_time, UInt_t local_runnumber,
00047 UInt_t local_runtype);
00048 void ProcessGo(UInt_t local_time, UInt_t evt_count);
00049 void ProcessPause(UInt_t local_time, UInt_t evt_count);
00050 void ProcessEnd(UInt_t local_time, UInt_t evt_count);
00051
00052 protected:
00053 enum EventTypes{
00054 kSYNC_EVENT = 16,
00055 kPRESTART_EVENT = 17,
00056 kGO_EVENT = 18,
00057 kPAUSE_EVENT = 19,
00058 kEND_EVENT = 20
00059 };
00060
00061 protected:
00062 Bool_t fFoundControlEvents;
00063
00064 UInt_t fPrestartTime;
00065 UInt_t fPrestartRunNumber;
00066 UInt_t fRunType;
00067
00068 UInt_t fEndTime;
00069 UInt_t fEndEventCount;
00070
00071 UInt_t fNumberPause;
00072 std::vector<UInt_t> fPauseEventCount;
00073 std::vector<UInt_t> fPauseTime;
00074
00075 UInt_t fNumberGo;
00076 std::vector<UInt_t> fGoEventCount;
00077 std::vector<UInt_t> fGoTime;
00078 UInt_t fStartTime;
00079
00080 TDatime fPrestartDatime;
00081 TDatime fStartDatime;
00082 TDatime fEndDatime;
00083 };
00084
00085
00086 #endif