CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions
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
 
- 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
 
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)
 
virtual ~ProducerBase () noexcept(false)
 
- 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
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
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
 

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::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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 ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
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)
 

Detailed Description

Definition at line 40 of file LogErrorHarvester.cc.

Constructor & Destructor Documentation

LogErrorHarvester::LogErrorHarvester ( ParameterSet const &  iPSet)
explicit

Definition at line 52 of file LogErrorHarvester.cc.

References edm::BranchDescription::branchType(), edm::ProducerBase::callWhenNewProductsRegistered(), edm::EDConsumerBase::consumes(), edm::ParameterSet::getUntrackedParameter(), SequenceTypes::ignore(), edm::InEvent, edm::global::EDProducerBase::moduleDescription(), edm::BranchDescription::moduleLabel(), or, edm::ModuleDescription::processName(), edm::BranchDescription::processName(), edm::PRODUCT_TYPE, edm::BranchDescription::productInstanceName(), and edm::BranchDescription::unwrappedTypeID().

52  {
53 
54  produces<std::vector<ErrorSummaryEntry>>();
55 
56  const edm::TypeID endPathStatusType{typeid(edm::EndPathStatus)};
57  const edm::TypeID pathStatusType{typeid(edm::PathStatus)};
58  const edm::TypeID triggerResultsType{typeid(edm::TriggerResults)};
59 
60  auto const& ignore = iPSet.getUntrackedParameter<std::vector<std::string>>("excludeModules");
61  const std::unordered_set<std::string> excludedModules(ignore.begin(),ignore.end());
62 
63  auto const& includeM = iPSet.getUntrackedParameter<std::vector<std::string>>("includeModules");
64  const std::unordered_set<std::string> includeModules(includeM.begin(),includeM.end());
65 
66  //Need to be sure to run only after all other EDProducers have run
68  endPathStatusType,pathStatusType,triggerResultsType,
69  excludedModules, includeModules](edm::BranchDescription const& iBD)
70  {
71  if((iBD.branchType() == edm::InEvent and moduleDescription().processName() == iBD.processName()) and
72  ( (includeModules.empty() or
73  includeModules.end() != includeModules.find(iBD.moduleLabel())) and
74  (iBD.unwrappedTypeID() != endPathStatusType and
75  iBD.unwrappedTypeID() != pathStatusType and
76  iBD.unwrappedTypeID() != triggerResultsType))) {
77  if(excludedModules.end() == excludedModules.find(iBD.moduleLabel())) {
80  iBD.productInstanceName(),
81  iBD.processName()});
82  }
83  }
84  });
85  }
void callWhenNewProductsRegistered(std::function< void(BranchDescription const &)> const &func)
Definition: ProducerBase.h:76
BranchType const & branchType() const
std::string const & processName() const
std::string const & processName() const
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::string const & moduleLabel() const
std::string const & productInstanceName() const
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
TypeID unwrappedTypeID() const
def ignore(seq)
ModuleDescription const & moduleDescription() const
HLTPathStatus PathStatus
Definition: PathStatus.h:7

Member Function Documentation

void LogErrorHarvester::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::global::EDProducerBase.

Definition at line 99 of file LogErrorHarvester.cc.

References edm::EnableLoggedErrorsSummary().

99  {
101  }
bool EnableLoggedErrorsSummary()
void LogErrorHarvester::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::global::EDProducerBase.

Definition at line 105 of file LogErrorHarvester.cc.

References edm::DisableLoggedErrorsSummary().

105  {
107  }
bool DisableLoggedErrorsSummary()
void LogErrorHarvester::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 112 of file LogErrorHarvester.cc.

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

112  {
114  desc.addUntracked<std::vector<std::string>>("excludeModules",std::vector<std::string>{})->setComment("List of module labels to exclude from consumes.");
115  desc.addUntracked<std::vector<std::string>>("includeModules",std::vector<std::string>{})->setComment("List of the only module labels to include in consumes. The empty list will include all.");
116  descriptions.add("logErrorHarvester", desc);
117  }
void LogErrorHarvester::produce ( StreamID  sid,
Event iEvent,
EventSetup const &   
) const
overrideprivatevirtual

Implements edm::global::EDProducerBase.

Definition at line 88 of file LogErrorHarvester.cc.

References edm::FreshErrorsExist(), diffTreeTool::index, edm::LoggedErrorsSummary(), edm::Event::put(), and edm::StreamID::value().

88  {
89  const auto index = sid.value();
90  if(!FreshErrorsExist(index)) {
91  iEvent.put(std::make_unique<std::vector<ErrorSummaryEntry>>());
92  } else {
93  iEvent.put(std::make_unique<std::vector<ErrorSummaryEntry>>(LoggedErrorsSummary(index)));
94  }
95  }
bool FreshErrorsExist(unsigned int iStreamID)
std::vector< ErrorSummaryEntry > LoggedErrorsSummary(unsigned int iStreamID)