File indexing completed on 2024-09-07 04:36:40
0001 #ifndef IOPool_Streamer_StreamerOutputModuleBase_h
0002 #define IOPool_Streamer_StreamerOutputModuleBase_h
0003
0004 #include "IOPool/Streamer/interface/StreamerOutputModuleCommon.h"
0005 #include "FWCore/Framework/interface/one/OutputModule.h"
0006 #include "FWCore/Utilities/interface/EDGetToken.h"
0007 #include "IOPool/Streamer/interface/MsgTools.h"
0008 #include "DataFormats/Streamer/interface/StreamedProducts.h"
0009
0010
0011
0012
0013 namespace edm {
0014 class ParameterSetDescription;
0015
0016 typedef detail::TriggerResultsBasedEventSelector::handle_t Trig;
0017
0018 namespace streamer {
0019 class InitMsgBuilder;
0020 class EventMsgBuilder;
0021
0022 class StreamerOutputModuleBase : public one::OutputModule<one::WatchRuns, one::WatchLuminosityBlocks>,
0023 StreamerOutputModuleCommon {
0024 public:
0025 explicit StreamerOutputModuleBase(ParameterSet const& ps);
0026 ~StreamerOutputModuleBase() override;
0027 static void fillDescription(ParameterSetDescription& desc);
0028
0029 private:
0030 void beginRun(RunForOutput const&) override;
0031 void endRun(RunForOutput const&) override;
0032 void beginJob() override;
0033 void endJob() override;
0034 void writeRun(RunForOutput const&) override;
0035 void writeLuminosityBlock(LuminosityBlockForOutput const&) override;
0036 void write(EventForOutput const& e) override;
0037
0038 virtual void start() = 0;
0039 virtual void stop() = 0;
0040 virtual void doOutputHeader(InitMsgBuilder const& init_message) = 0;
0041 virtual void doOutputEvent(EventMsgBuilder const& msg) = 0;
0042
0043 Trig getTriggerResults(EDGetTokenT<TriggerResults> const& token, EventForOutput const& e) const;
0044
0045 private:
0046 edm::EDGetTokenT<edm::TriggerResults> trToken_;
0047 edm::EDGetTokenT<SendJobHeader::ParameterSetMap> psetToken_;
0048 bool lastCallWasBeginRun_ = false;
0049
0050 };
0051 }
0052 }
0053
0054 #endif