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