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