CMS 3D CMS Logo

StreamerOutputModuleBase.cc
Go to the documentation of this file.
1 
3 
12 
13 #include "zlib.h"
14 
15 namespace edm {
18  one::OutputModule<one::WatchRuns, one::WatchLuminosityBlocks>(ps),
19  StreamerOutputModuleCommon(ps, &keptProducts()[InEvent]),
20  trToken_(consumes<edm::TriggerResults>(edm::InputTag("TriggerResults"))),
21  psetToken_(
22  consumes<SendJobHeader::ParameterSetMap, edm::InRun>(ps.getUntrackedParameter<edm::InputTag>("psetMap"))) {}
23 
25 
27  start();
28 
29  auto psetMapHandle = iRun.getHandle(psetToken_);
30 
31  std::unique_ptr<InitMsgBuilder> init_message =
33  *branchIDLists(),
37  moduleDescription().mainParameterSetID(),
38  psetMapHandle.isValid() ? psetMapHandle.product() : nullptr);
39 
40  doOutputHeader(*init_message);
41  serializerBuffer_->clearHeaderBuffer();
42  }
43 
45 
47 
49 
51 
53 
56 
57  std::unique_ptr<EventMsgBuilder> msg = serializeEvent(*getSerializerBuffer(), e, triggerResults, selectorConfig());
58  doOutputEvent(*msg); // You can't use msg in StreamerOutputModuleBase after this point
59  }
60 
62  EventForOutput const& e) const {
63  Trig result;
64  e.getByToken<TriggerResults>(token, result);
65  return result;
66  }
67 
70  OutputModule::fillDescription(desc);
71  desc.addUntracked<edm::InputTag>("psetMap", {"hltPSetMap"})
72  ->setComment("Optionally allow the map of ParameterSets to be calculated externally.");
73  }
74 } // namespace edm
edm::StreamerOutputModuleCommon::serializeRegistry
std::unique_ptr< InitMsgBuilder > serializeRegistry(SerializeDataBuffer &sbuf, BranchIDLists const &branchLists, ThinnedAssociationsHelper const &helper, std::string const &processName, std::string const &moduleLabel, ParameterSetID const &toplevel, SendJobHeader::ParameterSetMap const *psetMap)
Definition: StreamerOutputModuleCommon.cc:91
edm::one::OutputModuleBase::moduleDescription
const ModuleDescription & moduleDescription() const
Definition: OutputModuleBase.h:124
edm::StreamerOutputModuleBase::beginJob
void beginJob() override
Definition: StreamerOutputModuleBase.cc:46
edm::StreamerOutputModuleBase::fillDescription
static void fillDescription(ParameterSetDescription &desc)
Definition: StreamerOutputModuleBase.cc:68
TriggerResults.h
edm::EDGetTokenT< TriggerResults >
edm::StreamerOutputModuleBase::StreamerOutputModuleBase
StreamerOutputModuleBase(ParameterSet const &ps)
Definition: StreamerOutputModuleBase.cc:16
edm::OccurrenceForOutput::getHandle
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
Definition: OccurrenceForOutput.h:115
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::StreamerOutputModuleBase::doOutputEvent
virtual void doOutputEvent(EventMsgBuilder const &msg)=0
mps_check.msg
tuple msg
Definition: mps_check.py:285
edm::StreamerOutputModuleBase::~StreamerOutputModuleBase
~StreamerOutputModuleBase() override
Definition: StreamerOutputModuleBase.cc:24
EventForOutput.h
edm::StreamerOutputModuleBase::getTriggerResults
Trig getTriggerResults(EDGetTokenT< TriggerResults > const &token, EventForOutput const &e) const
Definition: StreamerOutputModuleBase.cc:61
edm::one::OutputModuleBase::thinnedAssociationsHelper
ThinnedAssociationsHelper const * thinnedAssociationsHelper() const
Definition: OutputModuleBase.cc:336
edm::Handle
Definition: AssociativeIterator.h:50
edm::InRun
Definition: BranchType.h:11
edm::StreamerOutputModuleCommon::serializerBuffer_
std::unique_ptr< SerializeDataBuffer > serializerBuffer_
Definition: StreamerOutputModuleCommon.h:43
edm::LuminosityBlockForOutput
Definition: LuminosityBlockForOutput.h:40
ModuleDescription.h
edm::ParameterSetMap
std::map< ParameterSetID, ParameterSetBlob > ParameterSetMap
Definition: ParameterSetConverter.h:40
edm::RunForOutput
Definition: RunForOutput.h:39
edm::one::OutputModuleBase::selectorConfig
ParameterSetID selectorConfig() const
Definition: OutputModuleBase.h:129
InitMsgBuilder.h
EventMsgBuilder.h
edm::InEvent
Definition: BranchType.h:11
ParameterSetDescription.h
edm::StreamerOutputModuleBase::psetToken_
edm::EDGetTokenT< SendJobHeader::ParameterSetMap > psetToken_
Definition: StreamerOutputModuleBase.h:45
OutputModuleBase
edm::StreamerOutputModuleBase::writeRun
void writeRun(RunForOutput const &) override
Definition: StreamerOutputModuleBase.cc:50
edm::ParameterSetDescription::addUntracked
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:100
edm::ParameterSet
Definition: ParameterSet.h:36
edm::StreamerOutputModuleBase::stop
virtual void stop()=0
edm::StreamerOutputModuleBase::write
void write(EventForOutput const &e) override
Definition: StreamerOutputModuleBase.cc:54
edm::one::OutputModuleBase::branchIDLists
BranchIDLists const * branchIDLists()
Definition: OutputModuleBase.cc:316
StreamerOutputModuleBase.h
edm::StreamerOutputModuleBase::endJob
void endJob() override
Definition: StreamerOutputModuleBase.cc:48
edm::StreamerOutputModuleCommon::getSerializerBuffer
SerializeDataBuffer * getSerializerBuffer()
Definition: StreamerOutputModuleCommon.cc:283
edm::StreamerOutputModuleBase::writeLuminosityBlock
void writeLuminosityBlock(LuminosityBlockForOutput const &) override
Definition: StreamerOutputModuleBase.cc:52
edm::StreamerOutputModuleBase::endRun
void endRun(RunForOutput const &) override
Definition: StreamerOutputModuleBase.cc:44
SimL1EmulatorRepack_CalouGT_cff.processName
processName
Definition: SimL1EmulatorRepack_CalouGT_cff.py:17
edm::EventForOutput
Definition: EventForOutput.h:50
edm::one::OutputModuleBase::description
ModuleDescription const & description() const
Definition: OutputModuleBase.cc:340
edm::StreamerOutputModuleCommon::serializeEvent
std::unique_ptr< EventMsgBuilder > serializeEvent(SerializeDataBuffer &sbuf, EventForOutput const &e, Handle< TriggerResults > const &triggerResults, ParameterSetID const &selectorCfg)
Definition: StreamerOutputModuleCommon.cc:199
edm::StreamerOutputModuleBase::beginRun
void beginRun(RunForOutput const &) override
Definition: StreamerOutputModuleBase.cc:26
edm::StreamerOutputModuleBase::start
virtual void start()=0
edm::triggerResults
static const std::string triggerResults("TriggerResults")
ParameterSetID.h
mps_fire.result
result
Definition: mps_fire.py:303
ParameterSet.h
HerwigMaxPtPartonFilter_cfi.moduleLabel
moduleLabel
Definition: HerwigMaxPtPartonFilter_cfi.py:4
edm::StreamerOutputModuleBase::doOutputHeader
virtual void doOutputHeader(InitMsgBuilder const &init_message)=0
edm::StreamerOutputModuleCommon::fillDescription
static void fillDescription(ParameterSetDescription &desc)
Definition: StreamerOutputModuleCommon.cc:270
edm::SendJobHeader
Definition: StreamedProducts.h:102
edm::StreamerOutputModuleCommon
Definition: StreamerOutputModuleCommon.h:21
edm::InputTag
Definition: InputTag.h:15
edm::StreamerOutputModuleBase::trToken_
edm::EDGetTokenT< edm::TriggerResults > trToken_
Definition: StreamerOutputModuleBase.h:44
edm::TriggerResults
Definition: TriggerResults.h:35
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
unpackBuffers-CaloStage2.token
token
Definition: unpackBuffers-CaloStage2.py:316