CMS 3D CMS Logo

StreamerOutputModuleBase.cc
Go to the documentation of this file.
1 
3 
12 
13 #include "zlib.h"
14 
15 namespace edm::streamer {
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 =
34  moduleDescription().mainParameterSetID(),
35  psetMapHandle.isValid() ? psetMapHandle.product() : nullptr);
36 
37  doOutputHeader(*init_message);
38  lastCallWasBeginRun_ = true;
39 
41  }
42 
44 
46 
48 
50 
52 
55 
59  lastCallWasBeginRun_ = false;
60  }
62 
63  doOutputEvent(*msg); // You can't use msg in StreamerOutputModuleBase after this point
64  }
65 
67  EventForOutput const& e) const {
68  Trig result;
69  e.getByToken<TriggerResults>(token, result);
70  return result;
71  }
72 
75  OutputModule::fillDescription(desc);
76  desc.addUntracked<edm::InputTag>("psetMap", {"hltPSetMap"})
77  ->setComment("Optionally allow the map of ParameterSets to be calculated externally.");
78  }
79 } // namespace edm::streamer
void writeLuminosityBlock(LuminosityBlockForOutput const &) override
void write(EventForOutput const &e) override
void beginRun(RunForOutput const &) override
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
ModuleDescription const & description() const
static void fillDescription(ParameterSetDescription &desc)
ThinnedAssociationsHelper const * thinnedAssociationsHelper() const
edm::EDGetTokenT< SendJobHeader::ParameterSetMap > psetToken_
Trig getTriggerResults(EDGetTokenT< TriggerResults > const &token, EventForOutput const &e) const
BranchIDLists const * branchIDLists() const
void endRun(RunForOutput const &) override
std::unique_ptr< InitMsgBuilder > serializeRegistry(std::string const &processName, std::string const &moduleLabel, ParameterSetID const &toplevel, SendJobHeader::ParameterSetMap const *psetMap)
std::unique_ptr< EventMsgBuilder > serializeEventMetaData(BranchIDLists const &branchLists, ThinnedAssociationsHelper const &helper)
virtual void doOutputEvent(EventMsgBuilder const &msg)=0
edm::EDGetTokenT< edm::TriggerResults > trToken_
ParameterSetID selectorConfig() const
static void fillDescription(ParameterSetDescription &desc)
static std::string const triggerResults("TriggerResults")
void writeRun(RunForOutput const &) override
tuple msg
Definition: mps_check.py:286
std::map< ParameterSetID, ParameterSetBlob > ParameterSetMap
HLT enums.
virtual void doOutputHeader(InitMsgBuilder const &init_message)=0
const ModuleDescription & moduleDescription() const
std::unique_ptr< EventMsgBuilder > serializeEvent(EventForOutput const &e, Handle< TriggerResults > const &triggerResults, ParameterSetID const &selectorCfg)