CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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], description().moduleLabel()),
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(),
36  description().moduleLabel(),
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;
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
static void fillDescription(ParameterSetDescription &desc)
std::unique_ptr< EventMsgBuilder > serializeEvent(SerializeDataBuffer &sbuf, EventForOutput const &e, Handle< TriggerResults > const &triggerResults, ParameterSetID const &selectorCfg)
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
Trig getTriggerResults(EDGetTokenT< TriggerResults > const &token, EventForOutput const &e) const
virtual void doOutputHeader(InitMsgBuilder const &init_message)=0
void endRun(RunForOutput const &) override
void write(EventForOutput const &e) override
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
tuple result
Definition: mps_fire.py:311
std::unique_ptr< SerializeDataBuffer > serializerBuffer_
static void fillDescription(ParameterSetDescription &desc)
ModuleDescription const & description() const
void beginRun(RunForOutput const &) override
void writeLuminosityBlock(LuminosityBlockForOutput const &) override
virtual void doOutputEvent(EventMsgBuilder const &msg)=0
ThinnedAssociationsHelper const * thinnedAssociationsHelper() const
BranchIDLists const * branchIDLists() const
StreamerOutputModuleBase(ParameterSet const &ps)
ParameterSetID selectorConfig() const
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)
static std::string const triggerResults("TriggerResults")
edm::EDGetTokenT< edm::TriggerResults > trToken_
tuple msg
Definition: mps_check.py:285
void writeRun(RunForOutput const &) override
BasicHandle getByToken(EDGetToken token, TypeID const &typeID) const
std::map< ParameterSetID, ParameterSetBlob > ParameterSetMap
edm::EDGetTokenT< SendJobHeader::ParameterSetMap > psetToken_
const ModuleDescription & moduleDescription() const