CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
edmtest::WhatsItESProducer Class Reference
Inheritance diagram for edmtest::WhatsItESProducer:
edm::ESProducer edm::ESProductResolverFactoryProducer edm::eventsetup::ESProductResolverProvider

Public Types

typedef std::unique_ptr< WhatsItReturnType
 
typedef std::unique_ptr< const WhatsItReturnTypeA
 
typedef std::shared_ptr< WhatsItReturnTypeB
 
typedef std::shared_ptr< const WhatsItReturnTypeC
 
typedef std::optional< WhatsItReturnTypeD
 

Public Member Functions

ReturnType produce (const GadgetRcd &)
 
ReturnTypeA produceA (const GadgetRcd &)
 
ReturnTypeB produceB (const GadgetRcd &)
 
ReturnTypeC produceC (const GadgetRcd &)
 
ReturnTypeD produceD (const GadgetRcd &)
 
 WhatsItESProducer (edm::ParameterSet const &pset)
 
 ~WhatsItESProducer () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
 ESProducer (ESProducer &&)=delete
 
ESResolverIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProduceroperator= (const ESProducer &)=delete
 
ESProduceroperator= (ESProducer &&)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESResolverIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProductResolverFactoryProducer
 ESProductResolverFactoryProducer ()
 
 ESProductResolverFactoryProducer (const ESProductResolverFactoryProducer &)=delete
 
const ESProductResolverFactoryProduceroperator= (const ESProductResolverFactoryProducer &)=delete
 
 ~ESProductResolverFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
void createKeyedResolvers (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
const ComponentDescriptiondescription () const
 
 ESProductResolverProvider ()
 
 ESProductResolverProvider (const ESProductResolverProvider &)=delete
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedResolverskeyedResolvers (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const ESProductResolverProvideroperator= (const ESProductResolverProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~ESProductResolverProvider () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
static void prevalidate (ConfigurationDescriptions &)
 

Private Attributes

edm::ESGetToken< edmtest::Doodad, GadgetRcdtoken_
 
edm::ESGetToken< edmtest::Doodad, GadgetRcdtokenA_
 
edm::ESGetToken< edmtest::Doodad, GadgetRcdtokenB_
 
edm::ESGetToken< edmtest::Doodad, GadgetRcdtokenC_
 
edm::ESGetToken< edmtest::Doodad, GadgetRcdtokenD_
 

Additional Inherited Members

- Protected Types inherited from edm::ESProductResolverFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::ESProductResolverProvider
using KeyedResolversVector = std::vector< std::pair< DataKey, std::shared_ptr< ESProductResolver > >>
 
- Protected Member Functions inherited from edm::ESProducer
ESConsumesInfoconsumesInfoPushBackNew ()
 
unsigned int consumesInfoSize () const
 
template<typename CallbackT , typename TList , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>> iCallback, const TList *, const TRecord *iRecord, const es::Label &iLabel)
 
template<typename CallbackT , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>>, const eventsetup::produce::Null *, const TRecord *, const es::Label &)
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TDecorator >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename TFunc >
auto setWhatProduced (TFunc &&func, const es::Label &iLabel={})
 
template<typename TReturn , typename TRecord , typename TFunc , typename TDecorator >
ESConsumesCollectorT< TRecord > setWhatProduced (TFunc &&func, TDecorator &&iDec, const es::Label &iLabel={})
 
void usesResources (std::vector< std::string > const &)
 
- Protected Member Functions inherited from edm::ESProductResolverFactoryProducer
template<class TFactory >
void registerFactory (std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ESProductResolverFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedResolversVector registerResolvers (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::ESProductResolverProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 

Detailed Description

Definition at line 45 of file WhatsItESProducer.cc.

Member Typedef Documentation

◆ ReturnType

Definition at line 50 of file WhatsItESProducer.cc.

◆ ReturnTypeA

typedef std::unique_ptr<const WhatsIt> edmtest::WhatsItESProducer::ReturnTypeA

Definition at line 51 of file WhatsItESProducer.cc.

◆ ReturnTypeB

Definition at line 52 of file WhatsItESProducer.cc.

◆ ReturnTypeC

typedef std::shared_ptr<const WhatsIt> edmtest::WhatsItESProducer::ReturnTypeC

Definition at line 53 of file WhatsItESProducer.cc.

◆ ReturnTypeD

Definition at line 54 of file WhatsItESProducer.cc.

Constructor & Destructor Documentation

◆ WhatsItESProducer()

WhatsItESProducer::WhatsItESProducer ( edm::ParameterSet const &  pset)

Definition at line 84 of file WhatsItESProducer.cc.

References edm::errors::Configuration, Exception, produceA(), produceB(), produceC(), produceD(), muonDTDigis_cfi::pset, edm::ESProducer::setWhatProduced(), AlCaHLTBitMon_QueryRunRegistry::string, token_, tokenA_, tokenB_, tokenC_, and tokenD_.

84  {
85  if (pset.getUntrackedParameter<bool>("test", true)) {
86  throw edm::Exception(edm::errors::Configuration, "Something is wrong with ESProducer validation\n")
87  << "Or the test configuration parameter was set true (it should never be true unless you want this "
88  "exception)\n";
89  }
90 
91  //the following line is needed to tell the framework what
92  // data is being produced
93  auto collector = setWhatProduced(this);
94  auto collectorA = setWhatProduced(this, &WhatsItESProducer::produceA, edm::es::Label("A"));
95  auto collectorB = setWhatProduced(this, &WhatsItESProducer::produceB, edm::es::Label("B"));
96  auto collectorC = setWhatProduced(this, &WhatsItESProducer::produceC, edm::es::Label("C"));
97  auto collectorD = setWhatProduced(this, &WhatsItESProducer::produceD, edm::es::Label("D"));
98 
99  //now do what ever other initialization is needed
100  auto const data_label = pset.exists("doodadLabel") ? pset.getParameter<std::string>("doodadLabel") : std::string{};
101  token_ = collector.consumes<edmtest::Doodad>(edm::ESInputTag{"", data_label});
102  tokenA_ = collectorA.consumes<edmtest::Doodad>(edm::ESInputTag{"", data_label});
103  tokenB_ = collectorB.consumes<edmtest::Doodad>(edm::ESInputTag{"", data_label});
104  tokenC_ = collectorC.consumes<edmtest::Doodad>(edm::ESInputTag{"", data_label});
105  tokenD_ = collectorD.consumes<edmtest::Doodad>(edm::ESInputTag{"", data_label});
106  }
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:166
edm::ESGetToken< edmtest::Doodad, GadgetRcd > tokenB_
ReturnTypeD produceD(const GadgetRcd &)
edm::ESGetToken< edmtest::Doodad, GadgetRcd > token_
edm::ESGetToken< edmtest::Doodad, GadgetRcd > tokenC_
ReturnTypeB produceB(const GadgetRcd &)
edm::ESGetToken< edmtest::Doodad, GadgetRcd > tokenA_
edm::ESGetToken< edmtest::Doodad, GadgetRcd > tokenD_
ReturnTypeC produceC(const GadgetRcd &)
ReturnTypeA produceA(const GadgetRcd &)

◆ ~WhatsItESProducer()

WhatsItESProducer::~WhatsItESProducer ( )
override

Definition at line 108 of file WhatsItESProducer.cc.

108  {
109  // do anything here that needs to be done at desctruction time
110  // (e.g. close files, deallocate resources etc.)
111  }

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 157 of file WhatsItESProducer.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and AlCaHLTBitMon_QueryRunRegistry::string.

157  {
159  desc.addOptional<std::string>("doodadLabel");
160  desc.addUntracked<bool>("test", false)
161  ->setComment("This parameter exists only to test the parameter set validation for ESSources");
162  descriptions.add("WhatsItESProducer", desc);
163  }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

WhatsItESProducer::ReturnType WhatsItESProducer::produce ( const GadgetRcd iRecord)

Definition at line 118 of file WhatsItESProducer.cc.

References edmtest::Doodad::a, edm::eventsetup::EventSetupRecordImplementation< T >::getHandle(), edm::service::TriggerNamesService::getProcessName(), and token_.

118  {
119  //This tests that the Service system is accessible from a ESProducer
121  tns->getProcessName();
122 
123  edm::ESHandle<Doodad> doodad = iRecord.getHandle(token_);
124  auto pWhatsIt = std::make_unique<WhatsIt>();
125  pWhatsIt->a = doodad->a;
126  return pWhatsIt;
127  }
edm::ESGetToken< edmtest::Doodad, GadgetRcd > token_
std::string const & getProcessName() const
ESHandle< PRODUCT > getHandle(ESGetToken< PRODUCT, T > const &iToken) const

◆ produceA()

WhatsItESProducer::ReturnTypeA WhatsItESProducer::produceA ( const GadgetRcd iRecord)

Definition at line 129 of file WhatsItESProducer.cc.

References edmtest::Doodad::a, edm::eventsetup::EventSetupRecordImplementation< T >::getHandle(), and tokenA_.

Referenced by WhatsItESProducer().

129  {
130  edm::ESHandle<Doodad> doodad = iRecord.getHandle(tokenA_);
131  auto pWhatsIt = std::make_unique<WhatsIt>();
132  pWhatsIt->a = doodad->a;
133  return pWhatsIt;
134  }
edm::ESGetToken< edmtest::Doodad, GadgetRcd > tokenA_
ESHandle< PRODUCT > getHandle(ESGetToken< PRODUCT, T > const &iToken) const

◆ produceB()

WhatsItESProducer::ReturnTypeB WhatsItESProducer::produceB ( const GadgetRcd iRecord)

Definition at line 136 of file WhatsItESProducer.cc.

References edmtest::Doodad::a, edm::eventsetup::EventSetupRecordImplementation< T >::getHandle(), and tokenB_.

Referenced by WhatsItESProducer().

136  {
137  edm::ESHandle<Doodad> doodad = iRecord.getHandle(tokenB_);
138  auto pWhatsIt = std::make_shared<WhatsIt>();
139  pWhatsIt->a = doodad->a;
140  return pWhatsIt;
141  }
edm::ESGetToken< edmtest::Doodad, GadgetRcd > tokenB_
ESHandle< PRODUCT > getHandle(ESGetToken< PRODUCT, T > const &iToken) const

◆ produceC()

WhatsItESProducer::ReturnTypeC WhatsItESProducer::produceC ( const GadgetRcd iRecord)

Definition at line 143 of file WhatsItESProducer.cc.

References edmtest::Doodad::a, edm::eventsetup::EventSetupRecordImplementation< T >::getHandle(), and tokenC_.

Referenced by WhatsItESProducer().

143  {
144  edm::ESHandle<Doodad> doodad = iRecord.getHandle(tokenC_);
145  auto pWhatsIt = std::make_shared<WhatsIt>();
146  pWhatsIt->a = doodad->a;
147  return pWhatsIt;
148  }
edm::ESGetToken< edmtest::Doodad, GadgetRcd > tokenC_
ESHandle< PRODUCT > getHandle(ESGetToken< PRODUCT, T > const &iToken) const

◆ produceD()

WhatsItESProducer::ReturnTypeD WhatsItESProducer::produceD ( const GadgetRcd iRecord)

Definition at line 150 of file WhatsItESProducer.cc.

References edmtest::Doodad::a, edm::eventsetup::EventSetupRecordImplementation< T >::getHandle(), and tokenD_.

Referenced by WhatsItESProducer().

150  {
151  edm::ESHandle<Doodad> doodad = iRecord.getHandle(tokenD_);
152  auto pWhatsIt = std::make_optional<WhatsIt>();
153  pWhatsIt->a = doodad->a;
154  return pWhatsIt;
155  }
ESHandle< PRODUCT > getHandle(ESGetToken< PRODUCT, T > const &iToken) const
edm::ESGetToken< edmtest::Doodad, GadgetRcd > tokenD_

Member Data Documentation

◆ token_

edm::ESGetToken<edmtest::Doodad, GadgetRcd> edmtest::WhatsItESProducer::token_
private

Definition at line 66 of file WhatsItESProducer.cc.

Referenced by produce(), and WhatsItESProducer().

◆ tokenA_

edm::ESGetToken<edmtest::Doodad, GadgetRcd> edmtest::WhatsItESProducer::tokenA_
private

Definition at line 67 of file WhatsItESProducer.cc.

Referenced by produceA(), and WhatsItESProducer().

◆ tokenB_

edm::ESGetToken<edmtest::Doodad, GadgetRcd> edmtest::WhatsItESProducer::tokenB_
private

Definition at line 68 of file WhatsItESProducer.cc.

Referenced by produceB(), and WhatsItESProducer().

◆ tokenC_

edm::ESGetToken<edmtest::Doodad, GadgetRcd> edmtest::WhatsItESProducer::tokenC_
private

Definition at line 69 of file WhatsItESProducer.cc.

Referenced by produceC(), and WhatsItESProducer().

◆ tokenD_

edm::ESGetToken<edmtest::Doodad, GadgetRcd> edmtest::WhatsItESProducer::tokenD_
private

Definition at line 70 of file WhatsItESProducer.cc.

Referenced by produceD(), and WhatsItESProducer().