00001 #ifndef IOPool_Streamer_StreamerOutputModuleBase_h 00002 #define IOPool_Streamer_StreamerOutputModuleBase_h 00003 00004 #include "FWCore/Framework/interface/OutputModule.h" 00005 #include "IOPool/Streamer/interface/MsgTools.h" 00006 #include "IOPool/Streamer/interface/StreamSerializer.h" 00007 #include <memory> 00008 #include <vector> 00009 00010 class InitMsgBuilder; 00011 class EventMsgBuilder; 00012 namespace edm { 00013 class ParameterSetDescription; 00014 class StreamerOutputModuleBase : public OutputModule { 00015 public: 00016 explicit StreamerOutputModuleBase(ParameterSet const& ps); 00017 virtual ~StreamerOutputModuleBase(); 00018 static void fillDescription(ParameterSetDescription & desc); 00019 00020 private: 00021 virtual void beginRun(RunPrincipal const&); 00022 virtual void endRun(RunPrincipal const&); 00023 virtual void beginJob(); 00024 virtual void endJob(); 00025 virtual void writeRun(RunPrincipal const&); 00026 virtual void writeLuminosityBlock(LuminosityBlockPrincipal const&); 00027 virtual void write(EventPrincipal const& e); 00028 00029 virtual void start() const = 0; 00030 virtual void stop() const = 0; 00031 virtual void doOutputHeader(InitMsgBuilder const& init_message) const = 0; 00032 virtual void doOutputEvent(EventMsgBuilder const& msg) const = 0; 00033 00034 std::auto_ptr<InitMsgBuilder> serializeRegistry(); 00035 std::auto_ptr<EventMsgBuilder> serializeEvent(EventPrincipal const& e); 00036 void setHltMask(EventPrincipal const& e); 00037 void setLumiSection(); 00038 00039 private: 00040 Selections const* selections_; 00041 00042 int maxEventSize_; 00043 bool useCompression_; 00044 int compressionLevel_; 00045 00046 // test luminosity sections 00047 int lumiSectionInterval_; 00048 double timeInSecSinceUTC; 00049 00050 StreamSerializer serializer_; 00051 00052 //Event variables, made class memebers to avoid re instatiation for each event. 00053 unsigned int hltsize_; 00054 uint32 lumi_; 00055 std::vector<bool> l1bit_; 00056 std::vector<unsigned char> hltbits_; 00057 uint32 origSize_; 00058 char host_name_[255]; 00059 00060 Strings hltTriggerSelections_; 00061 uint32 outputModuleId_; 00062 }; //end-of-class-def 00063 } // end of namespace-edm 00064 00065 #endif