CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
edm::LogErrorHarvester Class Reference
Inheritance diagram for edm::LogErrorHarvester:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 LogErrorHarvester (ParameterSet const &)
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (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::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void beginJob () override
 
void endJob () override
 
void produce (StreamID, Event &, EventSetup const &) const override
 

Private Attributes

EDPutTokenT< std::vector< ErrorSummaryEntry > > token_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (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 ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
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)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 41 of file LogErrorHarvester.cc.

Constructor & Destructor Documentation

◆ LogErrorHarvester()

LogErrorHarvester::LogErrorHarvester ( ParameterSet const &  iPSet)
explicit

Definition at line 53 of file LogErrorHarvester.cc.

53  : token_{produces<std::vector<ErrorSummaryEntry>>()} {
54  const edm::TypeID endPathStatusType{typeid(edm::EndPathStatus)};
55  const edm::TypeID pathStatusType{typeid(edm::PathStatus)};
56  const edm::TypeID triggerResultsType{typeid(edm::TriggerResults)};
57 
58  auto const& ignore = iPSet.getUntrackedParameter<std::vector<std::string>>("excludeModules");
59  const std::unordered_set<std::string> excludedModules(ignore.begin(), ignore.end());
60 
61  auto const& includeM = iPSet.getUntrackedParameter<std::vector<std::string>>("includeModules");
62  const std::unordered_set<std::string> includeModules(includeM.begin(), includeM.end());
63 
64  //Need to be sure to run only after all other EDProducers have run
66  [this, endPathStatusType, pathStatusType, triggerResultsType, excludedModules, includeModules](
67  edm::BranchDescription const& iBD) {
68  if ((iBD.branchType() == edm::InEvent and moduleDescription().processName() == iBD.processName()) and
69  ((includeModules.empty() or includeModules.end() != includeModules.find(iBD.moduleLabel())) and
70  (iBD.unwrappedTypeID() != endPathStatusType and iBD.unwrappedTypeID() != pathStatusType and
71  iBD.unwrappedTypeID() != triggerResultsType))) {
72  if (excludedModules.end() == excludedModules.find(iBD.moduleLabel())) {
75  }
76  }
77  });
78  }

Member Function Documentation

◆ beginJob()

void LogErrorHarvester::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::global::EDProducerBase.

Definition at line 91 of file LogErrorHarvester.cc.

References edm::EnableLoggedErrorsSummary().

◆ endJob()

void LogErrorHarvester::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::global::EDProducerBase.

Definition at line 94 of file LogErrorHarvester.cc.

References edm::DisableLoggedErrorsSummary().

◆ fillDescriptions()

void LogErrorHarvester::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 97 of file LogErrorHarvester.cc.

97  {
99  desc.addUntracked<std::vector<std::string>>("excludeModules", std::vector<std::string>{})
100  ->setComment("List of module labels to exclude from consumes.");
101  desc.addUntracked<std::vector<std::string>>("includeModules", std::vector<std::string>{})
102  ->setComment("List of the only module labels to include in consumes. The empty list will include all.");
103  descriptions.add("logErrorHarvester", desc);
104  }

References edm::ConfigurationDescriptions::add(), and edm::ParameterSetDescription::addUntracked().

◆ produce()

void LogErrorHarvester::produce ( StreamID  sid,
Event iEvent,
EventSetup const &   
) const
overrideprivatevirtual

Implements edm::global::EDProducerBase.

Definition at line 80 of file LogErrorHarvester.cc.

80  {
81  const auto index = sid.value();
82  if (!FreshErrorsExist(index)) {
83  //puts a default constructed product in the event
84  iEvent.emplace(token_);
85  } else {
87  }
88  }

References edm::FreshErrorsExist(), iEvent, edm::LoggedErrorsSummary(), token_, and edm::StreamID::value().

Member Data Documentation

◆ token_

EDPutTokenT<std::vector<ErrorSummaryEntry> > edm::LogErrorHarvester::token_
private

Definition at line 50 of file LogErrorHarvester.cc.

Referenced by produce().

edm::BranchDescription::productInstanceName
std::string const & productInstanceName() const
Definition: BranchDescription.h:81
edm::PRODUCT_TYPE
Definition: ProductKindOfType.h:5
edm::LogErrorHarvester::token_
EDPutTokenT< std::vector< ErrorSummaryEntry > > token_
Definition: LogErrorHarvester.cc:50
edm::global::EDProducerBase::moduleDescription
ModuleDescription const & moduleDescription() const
Definition: EDProducerBase.h:69
edm::EndPathStatus
Definition: EndPathStatus.h:5
edm::ModuleDescription::processName
std::string const & processName() const
Definition: ModuleDescription.cc:47
edm::PathStatus
HLTPathStatus PathStatus
Definition: PathStatus.h:7
edm::DisableLoggedErrorsSummary
bool DisableLoggedErrorsSummary()
Definition: MessageSender.cc:154
edm::ProducerBase::callWhenNewProductsRegistered
void callWhenNewProductsRegistered(std::function< void(BranchDescription const &)> const &func)
Definition: ProducerBase.h:79
edm::BranchDescription::processName
std::string const & processName() const
Definition: BranchDescription.h:73
edm::BranchDescription::unwrappedTypeID
TypeID unwrappedTypeID() const
Definition: BranchDescription.h:97
edm::InEvent
Definition: BranchType.h:11
edm::EnableLoggedErrorsSummary
bool EnableLoggedErrorsSummary()
Definition: MessageSender.cc:149
iEvent
int iEvent
Definition: GenABIO.cc:224
Reconstruction_cff.includeModules
includeModules
Definition: Reconstruction_cff.py:208
edm::BranchDescription::branchType
BranchType const & branchType() const
Definition: BranchDescription.h:121
edm::LoggedErrorsSummary
std::vector< ErrorSummaryEntry > LoggedErrorsSummary(unsigned int iStreamID)
Definition: MessageSender.cc:164
SequenceTypes.ignore
def ignore(seq)
Definition: SequenceTypes.py:630
edm::TypeID
Definition: TypeID.h:22
edm::BranchDescription::moduleLabel
std::string const & moduleLabel() const
Definition: BranchDescription.h:72
ParameterSetDescription
or
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
edm::BranchDescription
Definition: BranchDescription.h:32
edm::FreshErrorsExist
bool FreshErrorsExist(unsigned int iStreamID)
Definition: MessageSender.cc:159
edm::EDConsumerBase::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: EDConsumerBase.h:126
edm::TypeToGet
Definition: TypeToGet.h:32
HLTObjectsMonitor_cfi.TriggerResults
TriggerResults
Definition: HLTObjectsMonitor_cfi.py:9
edm::InputTag
Definition: InputTag.h:15