CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
edm::GetProductCheckerOutputModule Class Reference
Inheritance diagram for edm::GetProductCheckerOutputModule:
edm::one::OutputModule<> edm::one::OutputModuleBase edm::core::OutputModuleCore edm::EDConsumerBase

Public Member Functions

 GetProductCheckerOutputModule (ParameterSet const &pset)
 
 ~GetProductCheckerOutputModule () override
 
- Public Member Functions inherited from edm::one::OutputModule<>
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const OutputModuleoperator= (const OutputModule &)=delete
 
 OutputModule (edm::ParameterSet const &iPSet)
 
 OutputModule (const OutputModule &)=delete
 
bool wantsGlobalLuminosityBlocks () const noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept 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 noexcept
 
bool wantsStreamRuns () const noexcept
 
- 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 fillDescriptions (ConfigurationDescriptions &descriptions)
 
- 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 write (EventForOutput const &e) override
 
void writeLuminosityBlock (LuminosityBlockForOutput const &) override
 
void writeRun (RunForOutput const &) override
 

Private Attributes

const std::vector< std::string > crosscheck_
 
const bool verbose_
 

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_
 

Detailed Description

Definition at line 33 of file GetProductCheckerOutputModule.cc.

Constructor & Destructor Documentation

◆ GetProductCheckerOutputModule()

edm::GetProductCheckerOutputModule::GetProductCheckerOutputModule ( ParameterSet const &  pset)
explicit

Definition at line 59 of file GetProductCheckerOutputModule.cc.

60  : one::OutputModuleBase(iPSet),
61  one::OutputModule<>(iPSet),
62  crosscheck_(iPSet.getUntrackedParameter<std::vector<std::string>>("crosscheck")),
63  verbose_(iPSet.getUntrackedParameter<bool>("verbose")) {}
const std::vector< std::string > crosscheck_

◆ ~GetProductCheckerOutputModule()

edm::GetProductCheckerOutputModule::~GetProductCheckerOutputModule ( )
override

Definition at line 69 of file GetProductCheckerOutputModule.cc.

69 {}

Member Function Documentation

◆ fillDescriptions()

void edm::GetProductCheckerOutputModule::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 167 of file GetProductCheckerOutputModule.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and edm::core::OutputModuleCore::fillDescription().

167  {
170  desc.addUntracked<std::vector<std::string>>("crosscheck", {})
171  ->setComment("Branch names that should be in the event. If empty no check done.");
172  desc.addUntracked<bool>("verbose", false);
173  descriptions.add("productChecker", desc);
174  }
static void fillDescription(ParameterSetDescription &desc, std::vector< std::string > const &iDefaultOutputCommands=ProductSelectorRules::defaultSelectionStrings())

◆ write()

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

Implements edm::core::OutputModuleCore.

Definition at line 124 of file GetProductCheckerOutputModule.cc.

References edm::check(), crosscheck_, MillePedeFileConverter_cfg::e, Exception, newFWLiteAna::found, edm::InEvent, edm::core::OutputModuleCore::keptProducts(), AlCaHLTBitMon_ParallelJobs::p, str, and verbose_.

Referenced by pkg.AbstractPkg::generate().

124  {
125  std::ostringstream str;
126  str << e.id();
127  check(e, str.str(), keptProducts()[InEvent], verbose_);
128  if (not crosscheck_.empty()) {
129  std::set<std::string> expectedProducts(crosscheck_.begin(), crosscheck_.end());
130  for (auto const& kp : keptProducts()[InEvent]) {
131  auto bn = canonicalName(kp.first->branchName());
132  auto found = expectedProducts.find(bn);
133  if (found == expectedProducts.end()) {
134  throw cms::Exception("CrosscheckFailed") << "unexpected kept product " << bn;
135  }
136  expectedProducts.erase(bn);
137  }
138  if (not expectedProducts.empty()) {
139  cms::Exception e("CrosscheckFailed");
140  e << "Did not find the expected products:\n";
141  for (auto const& p : expectedProducts) {
142  e << p << "\n";
143  }
144  throw e;
145  }
146  }
147  }
const std::vector< std::string > crosscheck_
SelectedProductsForBranchType const & keptProducts() const
static void check(T const &p, std::string const &id, SelectedProducts const &iProducts, bool iVerbose)
#define str(s)

◆ writeLuminosityBlock()

void edm::GetProductCheckerOutputModule::writeLuminosityBlock ( LuminosityBlockForOutput const &  l)
overrideprivatevirtual

Implements edm::core::OutputModuleCore.

Definition at line 148 of file GetProductCheckerOutputModule.cc.

References edm::check(), edm::InLumi, edm::core::OutputModuleCore::keptProducts(), MainPageGenerator::l, str, and verbose_.

148  {
149  std::ostringstream str;
150  str << l.id();
151  check(l, str.str(), keptProducts()[InLumi], verbose_);
152  }
SelectedProductsForBranchType const & keptProducts() const
static void check(T const &p, std::string const &id, SelectedProducts const &iProducts, bool iVerbose)
#define str(s)

◆ writeRun()

void edm::GetProductCheckerOutputModule::writeRun ( RunForOutput const &  r)
overrideprivatevirtual

Implements edm::core::OutputModuleCore.

Definition at line 153 of file GetProductCheckerOutputModule.cc.

References edm::check(), edm::InRun, edm::core::OutputModuleCore::keptProducts(), str, and verbose_.

153  {
154  std::ostringstream str;
155  str << r.id();
156  check(r, str.str(), keptProducts()[InRun], verbose_);
157  }
SelectedProductsForBranchType const & keptProducts() const
static void check(T const &p, std::string const &id, SelectedProducts const &iProducts, bool iVerbose)
#define str(s)

Member Data Documentation

◆ crosscheck_

const std::vector<std::string> edm::GetProductCheckerOutputModule::crosscheck_
private

Definition at line 44 of file GetProductCheckerOutputModule.cc.

Referenced by write().

◆ verbose_

const bool edm::GetProductCheckerOutputModule::verbose_
private

Definition at line 45 of file GetProductCheckerOutputModule.cc.

Referenced by write(), writeLuminosityBlock(), and writeRun().