CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
edm::StreamerOutputModuleBase Class Referenceabstract

#include <StreamerOutputModuleBase.h>

Inheritance diagram for edm::StreamerOutputModuleBase:
edm::one::OutputModule< one::WatchRuns, one::WatchLuminosityBlocks > edm::StreamerOutputModuleCommon edm::one::OutputModuleBase edm::core::OutputModuleCore edm::EDConsumerBase edm::StreamerOutputModule< Consumer >

Public Member Functions

 StreamerOutputModuleBase (ParameterSet const &ps)
 
 ~StreamerOutputModuleBase () override
 
- Public Member Functions inherited from edm::one::OutputModule< one::WatchRuns, one::WatchLuminosityBlocks >
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const OutputModuleoperator= (const OutputModule &)=delete
 
 OutputModule (edm::ParameterSet const &iPSet)
 
 OutputModule (const OutputModule &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::OutputModuleBase
OutputModuleBaseoperator= (OutputModuleBase const &)=delete
 
 OutputModuleBase (ParameterSet const &pset)
 
 OutputModuleBase (OutputModuleBase const &)=delete
 
SharedResourcesAcquirersharedResourcesAcquirer ()
 
SubProcessParentageHelper const * subProcessParentageHelper () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
- Public Member Functions inherited from edm::core::OutputModuleCore
BranchIDLists const * branchIDLists () const
 
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::array< bool, NumBranchTypes > const & hasNewlyDroppedBranch () const
 
SelectedProductsForBranchType const & keptProducts () const
 
int maxEvents () const
 
const ModuleDescriptionmoduleDescription () const
 
OutputModuleCoreoperator= (OutputModuleCore const &)=delete
 
 OutputModuleCore (ParameterSet const &pset)
 
 OutputModuleCore (OutputModuleCore const &)=delete
 
OutputProcessBlockHelper const & outputProcessBlockHelper () const
 
std::string const & processName () const
 
int remainingEvents () const
 
bool selected (BranchDescription const &desc) const
 
void selectProducts (ProductRegistry const &preg, ThinnedAssociationsHelper const &, ProcessBlockHelperBase const &)
 
ThinnedAssociationsHelper const * thinnedAssociationsHelper () const
 
bool wantAllEvents () const
 
 ~OutputModuleCore () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescription (ParameterSetDescription &desc)
 
- Static Public Member Functions inherited from edm::core::OutputModuleCore
static const std::string & baseType ()
 
static void fillDescription (ParameterSetDescription &desc, std::vector< std::string > const &iDefaultOutputCommands=ProductSelectorRules::defaultSelectionStrings())
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Private Member Functions

void beginJob () override
 
void beginRun (RunForOutput const &) override
 
virtual void doOutputEvent (EventMsgBuilder const &msg)=0
 
virtual void doOutputHeader (InitMsgBuilder const &init_message)=0
 
void endJob () override
 
void endRun (RunForOutput const &) override
 
Trig getTriggerResults (EDGetTokenT< TriggerResults > const &token, EventForOutput const &e) const
 
virtual void start ()=0
 
virtual void stop ()=0
 
void write (EventForOutput const &e) override
 
void writeLuminosityBlock (LuminosityBlockForOutput const &) override
 
void writeRun (RunForOutput const &) override
 
- Private Member Functions inherited from edm::StreamerOutputModuleCommon
SerializeDataBuffergetSerializerBuffer ()
 
std::unique_ptr< EventMsgBuilderserializeEvent (SerializeDataBuffer &sbuf, EventForOutput const &e, Handle< TriggerResults > const &triggerResults, ParameterSetID const &selectorCfg)
 
std::unique_ptr< InitMsgBuilderserializeRegistry (SerializeDataBuffer &sbuf, BranchIDLists const &branchLists, ThinnedAssociationsHelper const &helper, std::string const &processName, std::string const &moduleLabel, ParameterSetID const &toplevel, SendJobHeader::ParameterSetMap const *psetMap)
 
 StreamerOutputModuleCommon (Parameters const &p, SelectedProducts const *selections, std::string const &moduleLabel)
 
 StreamerOutputModuleCommon (ParameterSet const &ps, SelectedProducts const *selections, std::string const &moduleLabel)
 
 ~StreamerOutputModuleCommon ()
 

Private Attributes

edm::EDGetTokenT< SendJobHeader::ParameterSetMappsetToken_
 
edm::EDGetTokenT< edm::TriggerResultstrToken_
 
- Private Attributes inherited from edm::StreamerOutputModuleCommon
std::unique_ptr< SerializeDataBufferserializerBuffer_
 

Additional Inherited Members

- Public Types inherited from edm::one::OutputModuleBase
typedef OutputModuleBase ModuleType
 
- Public Types inherited from edm::core::OutputModuleCore
typedef OutputModuleCore ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::one::OutputModuleBase
void configure (OutputModuleDescription const &desc)
 
void doBeginJob ()
 
bool doEvent (EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)
 
void doPreallocate (PreallocationConfiguration const &)
 
- Protected Member Functions inherited from edm::core::OutputModuleCore
void configure (OutputModuleDescription const &desc)
 
ModuleDescription const & description () const
 
void doAccessInputProcessBlock (ProcessBlockPrincipal const &, ModuleCallingContext const *)
 
void doBeginJob_ ()
 
bool doBeginLuminosityBlock (LumiTransitionInfo const &, ModuleCallingContext const *)
 
void doBeginProcessBlock (ProcessBlockPrincipal const &, ModuleCallingContext const *)
 
bool doBeginRun (RunTransitionInfo const &, ModuleCallingContext const *)
 
void doEndJob ()
 
bool doEndLuminosityBlock (LumiTransitionInfo const &, ModuleCallingContext const *)
 
void doEndProcessBlock (ProcessBlockPrincipal const &, ModuleCallingContext const *)
 
bool doEndRun (RunTransitionInfo const &, ModuleCallingContext const *)
 
bool doEvent_ (EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)
 
void doPreallocate_ (PreallocationConfiguration const &)
 
std::map< BranchID::value_type, BranchID::value_type > const & droppedBranchIDToKeptBranchID ()
 
virtual void preallocLumis (unsigned int)
 
ParameterSetID selectorConfig () const
 
void setEventSelectionInfo (std::map< std::string, std::vector< std::pair< std::string, int >>> const &outputModulePathPositions, bool anyProductProduced)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 
- Protected Attributes inherited from edm::core::OutputModuleCore
std::atomic< int > remainingEvents_
 
- Static Private Member Functions inherited from edm::StreamerOutputModuleCommon
static void fillDescription (ParameterSetDescription &desc)
 
static Parameters parameters (ParameterSet const &ps)
 

Detailed Description

Definition at line 20 of file StreamerOutputModuleBase.h.

Constructor & Destructor Documentation

◆ StreamerOutputModuleBase()

edm::StreamerOutputModuleBase::StreamerOutputModuleBase ( ParameterSet const &  ps)
explicit

Definition at line 16 of file StreamerOutputModuleBase.cc.

18  one::OutputModule<one::WatchRuns, one::WatchLuminosityBlocks>(ps),
20  trToken_(consumes<edm::TriggerResults>(edm::InputTag("TriggerResults"))),
21  psetToken_(
22  consumes<SendJobHeader::ParameterSetMap, edm::InRun>(ps.getUntrackedParameter<edm::InputTag>("psetMap"))) {}
ModuleDescription const & description() const
OutputModuleBase(ParameterSet const &pset)
SelectedProductsForBranchType const & keptProducts() const
edm::EDGetTokenT< edm::TriggerResults > trToken_
edm::EDGetTokenT< SendJobHeader::ParameterSetMap > psetToken_
StreamerOutputModuleCommon(Parameters const &p, SelectedProducts const *selections, std::string const &moduleLabel)
std::string const & moduleLabel() const

◆ ~StreamerOutputModuleBase()

edm::StreamerOutputModuleBase::~StreamerOutputModuleBase ( )
override

Definition at line 24 of file StreamerOutputModuleBase.cc.

24 {}

Member Function Documentation

◆ beginJob()

void edm::StreamerOutputModuleBase::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::core::OutputModuleCore.

Definition at line 46 of file StreamerOutputModuleBase.cc.

46 {}

◆ beginRun()

void edm::StreamerOutputModuleBase::beginRun ( RunForOutput const &  iRun)
overrideprivate

Definition at line 26 of file StreamerOutputModuleBase.cc.

References edm::core::OutputModuleCore::branchIDLists(), edm::core::OutputModuleCore::description(), doOutputHeader(), edm::OccurrenceForOutput::getHandle(), edm::StreamerOutputModuleCommon::getSerializerBuffer(), edm::core::OutputModuleCore::moduleDescription(), HerwigMaxPtPartonFilter_cfi::moduleLabel, SimL1EmulatorRepack_CalouGT_cff::processName, psetToken_, edm::StreamerOutputModuleCommon::serializerBuffer_, edm::StreamerOutputModuleCommon::serializeRegistry(), start(), and edm::core::OutputModuleCore::thinnedAssociationsHelper().

26  {
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  }
virtual void doOutputHeader(InitMsgBuilder const &init_message)=0
ModuleDescription const & description() const
ThinnedAssociationsHelper const * thinnedAssociationsHelper() const
std::unique_ptr< SerializeDataBuffer > serializerBuffer_
BranchIDLists const * branchIDLists() 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)
edm::EDGetTokenT< SendJobHeader::ParameterSetMap > psetToken_
const ModuleDescription & moduleDescription() const

◆ doOutputEvent()

virtual void edm::StreamerOutputModuleBase::doOutputEvent ( EventMsgBuilder const &  msg)
privatepure virtual

Implemented in edm::StreamerOutputModule< Consumer >.

Referenced by write().

◆ doOutputHeader()

virtual void edm::StreamerOutputModuleBase::doOutputHeader ( InitMsgBuilder const &  init_message)
privatepure virtual

Implemented in edm::StreamerOutputModule< Consumer >.

Referenced by beginRun().

◆ endJob()

void edm::StreamerOutputModuleBase::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::core::OutputModuleCore.

Definition at line 48 of file StreamerOutputModuleBase.cc.

References stop().

48 { stop(); }

◆ endRun()

void edm::StreamerOutputModuleBase::endRun ( RunForOutput const &  )
overrideprivate

Definition at line 44 of file StreamerOutputModuleBase.cc.

References stop().

44 { stop(); }

◆ fillDescription()

void edm::StreamerOutputModuleBase::fillDescription ( ParameterSetDescription desc)
static

Definition at line 68 of file StreamerOutputModuleBase.cc.

References submitPVResolutionJobs::desc, and edm::StreamerOutputModuleCommon::fillDescription().

Referenced by edm::StreamerOutputModule< Consumer >::fillDescriptions().

68  {
70  OutputModule::fillDescription(desc);
71  desc.addUntracked<edm::InputTag>("psetMap", {"hltPSetMap"})
72  ->setComment("Optionally allow the map of ParameterSets to be calculated externally.");
73  }
static void fillDescription(ParameterSetDescription &desc)

◆ getTriggerResults()

Trig edm::StreamerOutputModuleBase::getTriggerResults ( EDGetTokenT< TriggerResults > const &  token,
EventForOutput const &  e 
) const
private

◆ start()

virtual void edm::StreamerOutputModuleBase::start ( )
privatepure virtual

◆ stop()

virtual void edm::StreamerOutputModuleBase::stop ( )
privatepure virtual

Implemented in edm::StreamerOutputModule< Consumer >.

Referenced by endJob(), and endRun().

◆ write()

void edm::StreamerOutputModuleBase::write ( EventForOutput const &  e)
overrideprivatevirtual

Implements edm::core::OutputModuleCore.

Definition at line 54 of file StreamerOutputModuleBase.cc.

References doOutputEvent(), MillePedeFileConverter_cfg::e, edm::StreamerOutputModuleCommon::getSerializerBuffer(), getTriggerResults(), mps_check::msg, edm::core::OutputModuleCore::selectorConfig(), edm::StreamerOutputModuleCommon::serializeEvent(), edm::triggerResults(), and trToken_.

54  {
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  }
std::unique_ptr< EventMsgBuilder > serializeEvent(SerializeDataBuffer &sbuf, EventForOutput const &e, Handle< TriggerResults > const &triggerResults, ParameterSetID const &selectorCfg)
Trig getTriggerResults(EDGetTokenT< TriggerResults > const &token, EventForOutput const &e) const
virtual void doOutputEvent(EventMsgBuilder const &msg)=0
ParameterSetID selectorConfig() const
static std::string const triggerResults("TriggerResults")
edm::EDGetTokenT< edm::TriggerResults > trToken_
tuple msg
Definition: mps_check.py:286

◆ writeLuminosityBlock()

void edm::StreamerOutputModuleBase::writeLuminosityBlock ( LuminosityBlockForOutput const &  )
overrideprivatevirtual

Implements edm::core::OutputModuleCore.

Definition at line 52 of file StreamerOutputModuleBase.cc.

52 {}

◆ writeRun()

void edm::StreamerOutputModuleBase::writeRun ( RunForOutput const &  )
overrideprivatevirtual

Implements edm::core::OutputModuleCore.

Definition at line 50 of file StreamerOutputModuleBase.cc.

50 {}

Member Data Documentation

◆ psetToken_

edm::EDGetTokenT<SendJobHeader::ParameterSetMap> edm::StreamerOutputModuleBase::psetToken_
private

Definition at line 45 of file StreamerOutputModuleBase.h.

Referenced by beginRun().

◆ trToken_

edm::EDGetTokenT<edm::TriggerResults> edm::StreamerOutputModuleBase::trToken_
private

Definition at line 44 of file StreamerOutputModuleBase.h.

Referenced by write().