00001 #ifndef DaqSource_DaqSource_H 00002 #define DaqSource_DaqSource_H 00003 00013 #include <memory> 00014 #include "boost/shared_ptr.hpp" 00015 #include "FWCore/Framework/interface/InputSource.h" 00016 #include "FWCore/Framework/interface/Frameworkfwd.h" 00017 #include "EventFilter/Utilities/interface/ModuleWeb.h" 00018 00019 #include "xdata/UnsignedInteger32.h" 00020 #include "xdata/Boolean.h" 00021 00022 #include <pthread.h> 00023 00024 class DaqBaseReader; 00025 00026 namespace edm { 00027 class ParameterSet; 00028 class Timestamp; 00029 class InputSourceDescription; 00030 class EventPrincipal; 00031 class LuminosityBlockAuxiliary; 00032 00033 00034 class DaqSource : public InputSource, private evf::ModuleWeb { 00035 00036 public: 00037 explicit DaqSource(const ParameterSet& pset, 00038 const InputSourceDescription& desc); 00039 00040 virtual ~DaqSource(); 00041 00042 private: 00043 00044 void defaultWebPage(xgi::Input *in, xgi::Output *out); 00045 virtual EventPrincipal* readEvent_(); 00046 virtual boost::shared_ptr<LuminosityBlockAuxiliary> readLuminosityBlockAuxiliary_(); 00047 virtual boost::shared_ptr<RunAuxiliary> readRunAuxiliary_(); 00048 virtual EventPrincipal* readIt(EventID const& eventID); 00049 virtual void skip(int offset); 00050 virtual void setLumi(LuminosityBlockNumber_t lb); 00051 virtual void setRun(RunNumber_t r); 00052 virtual ItemType getNextItemType(); 00053 00054 00055 virtual void publish(xdata::InfoSpace *); 00056 virtual void publishToXmas(xdata::InfoSpace *); 00057 virtual void openBackDoor(unsigned int); 00058 virtual void closeBackDoor(); 00059 virtual void signalWaitingThreadAndBlock(); 00060 00061 DaqBaseReader* reader_; 00062 unsigned int lumiSegmentSizeInEvents_; //temporary kludge, LS# will come from L1 Global record 00063 bool useEventCounter_; 00064 unsigned int eventCounter_; 00065 bool keepUsingPsidFromTrigger_; 00066 bool fakeLSid_; 00067 00068 RunNumber_t runNumber_; 00069 LuminosityBlockNumber_t luminosityBlockNumber_; 00070 bool noMoreEvents_; 00071 bool newRun_; 00072 bool newLumi_; 00073 bool eventCached_; 00074 bool alignLsToLast_; 00075 00076 pthread_mutex_t mutex_; 00077 pthread_mutex_t signal_lock_; 00078 pthread_cond_t cond_; 00079 xdata::UnsignedInteger32 *lumiSectionIndex_; 00080 xdata::UnsignedInteger32 *prescaleSetIndex_; 00081 xdata::UnsignedInteger32 *lastLumiPrescaleIndex_; 00082 xdata::UnsignedInteger32 *lastLumiUsingEol_; 00083 xdata::Boolean *lsTimedOut_; 00084 xdata::Boolean *lsToBeRecovered_; 00085 xdata::InfoSpace *is_; 00086 xdata::InfoSpace *mis_; 00087 int count; 00088 unsigned int thisEventLSid; 00089 bool goToStopping; 00090 }; 00091 00092 } 00093 00094 #endif