CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaGlobalProducerNullES Class Reference
Inheritance diagram for ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaGlobalProducerNullES:
ALPAKA_ACCELERATOR_NAMESPACE::global::EDProducer<> edm::ProducerBase< edm::global::EDProducer, Args... >

Public Member Functions

void produce (edm::StreamID, device::Event &iEvent, device::EventSetup const &iSetup) const override
 
 TestAlpakaGlobalProducerNullES (edm::ParameterSet const &config)
 
- Public Member Functions inherited from ALPAKA_ACCELERATOR_NAMESPACE::global::EDProducer<>
void produce (edm::StreamID sid, edm::Event &iEvent, edm::EventSetup const &iSetup) const final
 
- Public Member Functions inherited from edm::ProducerBase< edm::global::EDProducer, Args... >
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
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

const device::ESGetToken< AlpakaESTestDataADevice, AlpakaESTestRecordAesTokenA_
 
const device::ESGetToken< AlpakaESTestDataCDevice, AlpakaESTestRecordAesTokenC_
 
const device::ESGetToken< AlpakaESTestDataCDevice, AlpakaESTestRecordAesTokenCNotExist_
 

Additional Inherited Members

- Public Types inherited from edm::ProducerBase< edm::global::EDProducer, Args... >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Protected Member Functions inherited from edm::ProducerBase< edm::global::EDProducer, Args... >
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
BranchAliasSetterT< ProductType > produces ()
 
auto produces () noexcept
 
ProducesCollector producesCollector ()
 

Detailed Description

This class tests various ways of a device ESProduct being missing

Definition at line 15 of file TestAlpakaGlobalProducerNullES.cc.

Constructor & Destructor Documentation

◆ TestAlpakaGlobalProducerNullES()

ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaGlobalProducerNullES::TestAlpakaGlobalProducerNullES ( edm::ParameterSet const &  config)
inline

Definition at line 17 of file TestAlpakaGlobalProducerNullES.cc.

18  : esTokenA_(esConsumes(config.getParameter<edm::ESInputTag>("eventSetupSource"))),
19  esTokenC_(esConsumes(config.getParameter<edm::ESInputTag>("eventSetupSource"))),
20  esTokenCNotExist_(esConsumes(edm::ESInputTag("", "doesNotExist"))) {}
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
Definition: config.py:1
const device::ESGetToken< AlpakaESTestDataCDevice, AlpakaESTestRecordA > esTokenCNotExist_
const device::ESGetToken< AlpakaESTestDataCDevice, AlpakaESTestRecordA > esTokenC_
const device::ESGetToken< AlpakaESTestDataADevice, AlpakaESTestRecordA > esTokenA_

Member Function Documentation

◆ fillDescriptions()

static void ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaGlobalProducerNullES::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
inlinestatic

◆ produce()

void ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaGlobalProducerNullES::produce ( edm::StreamID  ,
device::Event iEvent,
device::EventSetup const &  iSetup 
) const
inlineoverridevirtual

Implements ALPAKA_ACCELERATOR_NAMESPACE::global::EDProducer<>.

Definition at line 22 of file TestAlpakaGlobalProducerNullES.cc.

References MillePedeFileConverter_cfg::e, esTokenA_, esTokenC_, esTokenCNotExist_, Exception, ALPAKA_ACCELERATOR_NAMESPACE::device::EventSetup::getData(), and ALPAKA_ACCELERATOR_NAMESPACE::device::EventSetup::getHandle().

22  {
23  bool threw = false;
24  try {
25  [[maybe_unused]] auto handleA = iSetup.getHandle(esTokenA_);
26  } catch (cms::Exception& e) {
27  threw = true;
28  }
29  if (not threw) {
30  throw cms::Exception("Assert") << "Getting AlpakaESTestDataADevice ESProduct did not throw";
31  }
32 
33  threw = false;
34  try {
35  [[maybe_unused]] auto const& prodC = iSetup.getData(esTokenC_);
36  } catch (cms::Exception& e) {
37  threw = true;
38  }
39  if (not threw) {
40  throw cms::Exception("Assert") << "Getting AlpakaESTestDataCDevice ESProduct did not throw";
41  }
42 
43  auto handleC = iSetup.getHandle(esTokenCNotExist_);
44  if (handleC.isValid()) {
45  throw cms::Exception("Assert") << "Getting non-existing AlpakaESTestDataCDevice succeeded, should have failed";
46  }
47  threw = false;
48  try {
49  [[maybe_unused]] auto const& prodC = *handleC;
50  } catch (cms::Exception& e) {
51  threw = true;
52  }
53  if (not threw) {
54  throw cms::Exception("Assert")
55  << "De-referencing ESHandle of non-existentAlpakaESTestDataADevice did not throw";
56  }
57  }
const device::ESGetToken< AlpakaESTestDataCDevice, AlpakaESTestRecordA > esTokenCNotExist_
const device::ESGetToken< AlpakaESTestDataCDevice, AlpakaESTestRecordA > esTokenC_
const device::ESGetToken< AlpakaESTestDataADevice, AlpakaESTestRecordA > esTokenA_

Member Data Documentation

◆ esTokenA_

const device::ESGetToken<AlpakaESTestDataADevice, AlpakaESTestRecordA> ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaGlobalProducerNullES::esTokenA_
private

Definition at line 66 of file TestAlpakaGlobalProducerNullES.cc.

Referenced by produce().

◆ esTokenC_

const device::ESGetToken<AlpakaESTestDataCDevice, AlpakaESTestRecordA> ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaGlobalProducerNullES::esTokenC_
private

Definition at line 67 of file TestAlpakaGlobalProducerNullES.cc.

Referenced by produce().

◆ esTokenCNotExist_

const device::ESGetToken<AlpakaESTestDataCDevice, AlpakaESTestRecordA> ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaGlobalProducerNullES::esTokenCNotExist_
private

Definition at line 68 of file TestAlpakaGlobalProducerNullES.cc.

Referenced by produce().