CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
edmtest::ThingProducer Class Reference

#include <ThingProducer.h>

Inheritance diagram for edmtest::ThingProducer:
edm::global::EDProducer< edm::BeginRunProducer, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::BeginLuminosityBlockProducer > edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void globalBeginLuminosityBlockProduce (edm::LuminosityBlock &lb, edm::EventSetup const &c) const override
 
void globalBeginRunProduce (edm::Run &r, edm::EventSetup const &c) const override
 
void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lb, edm::EventSetup const &c) const override
 
void globalEndRunProduce (edm::Run &r, edm::EventSetup const &c) const override
 
void produce (edm::StreamID, edm::Event &e, edm::EventSetup const &c) const override
 
 ThingProducer (edm::ParameterSet const &ps)
 
 ~ThingProducer () override
 
- Public Member Functions inherited from edm::global::EDProducer< edm::BeginRunProducer, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::BeginLuminosityBlockProducer >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () 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 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 (edm::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 Attributes

ThingAlgorithm alg_
 
edm::EDPutTokenT< ThingCollection > blToken_
 
edm::EDPutTokenT< ThingCollection > brToken_
 
edm::EDPutTokenT< ThingCollection > elToken_
 
edm::EDPutTokenT< ThingCollection > erToken_
 
edm::EDPutTokenT< ThingCollection > evToken_
 
bool noPut_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
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
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
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)
 
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 ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- 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)
 

Detailed Description

Definition at line 19 of file ThingProducer.h.

Constructor & Destructor Documentation

◆ ThingProducer()

ThingProducer::ThingProducer ( edm::ParameterSet const &  ps)
explicit

Definition at line 8 of file ThingProducer.cc.

References blToken_, brToken_, elToken_, erToken_, and evToken_.

9  : alg_(iConfig.getParameter<int>("offsetDelta"),
10  iConfig.getParameter<int>("nThings"),
11  iConfig.getParameter<bool>("grow")),
12  noPut_(iConfig.getUntrackedParameter<bool>("noPut")) // used for testing with missing products
13  {
14  evToken_ = produces<ThingCollection>();
15  blToken_ = produces<ThingCollection, edm::Transition::BeginLuminosityBlock>("beginLumi");
16  elToken_ = produces<ThingCollection, edm::Transition::EndLuminosityBlock>("endLumi");
17  brToken_ = produces<ThingCollection, edm::Transition::BeginRun>("beginRun");
18  erToken_ = produces<ThingCollection, edm::Transition::EndRun>("endRun");
19  }
edm::EDPutTokenT< ThingCollection > evToken_
Definition: ThingProducer.h:42
edm::EDPutTokenT< ThingCollection > elToken_
Definition: ThingProducer.h:46
edm::EDPutTokenT< ThingCollection > blToken_
Definition: ThingProducer.h:45
edm::EDPutTokenT< ThingCollection > erToken_
Definition: ThingProducer.h:44
ThingAlgorithm alg_
Definition: ThingProducer.h:41
edm::EDPutTokenT< ThingCollection > brToken_
Definition: ThingProducer.h:43

◆ ~ThingProducer()

ThingProducer::~ThingProducer ( )
override

Definition at line 22 of file ThingProducer.cc.

22 {}

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 97 of file ThingProducer.cc.

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

97  {
99  desc.add<int>("offsetDelta", 0)
100  ->setComment(
101  "How much extra to increment the value used when creating Things for a new container. E.g. the last value "
102  "used to create Thing from the previous event is incremented by 'offsetDelta' to compute the value to use "
103  "of the first Thing created in the next Event.");
104  desc.add<int>("nThings", 20)->setComment("How many Things to put in each collection.");
105  desc.add<bool>("grow", false)
106  ->setComment("If true, multiply 'nThings' by the value of offset for each run of the algorithm.");
107  desc.addUntracked<bool>("noPut", false)
108  ->setComment("If true, data is not put into the Principal. This is used to test missing products.");
109  descriptions.add("thingProd", desc);
110  }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ globalBeginLuminosityBlockProduce()

void ThingProducer::globalBeginLuminosityBlockProduce ( edm::LuminosityBlock lb,
edm::EventSetup const &  c 
) const
override

Definition at line 40 of file ThingProducer.cc.

References alg_, blToken_, edm::LuminosityBlock::emplace(), eostools::move(), noPut_, mps_fire::result, and edmtest::ThingAlgorithm::run().

40  {
41  // Step A: Get Inputs
42 
43  // Step B: Create empty output
44  ThingCollection result; //Empty
45 
46  // Step C: Invoke the algorithm, passing in inputs (NONE) and getting back outputs.
47  alg_.run(result);
48 
49  // Step D: Put outputs into lumi block
50  if (!noPut_)
52  }
void run(ThingCollection &thingCollection) const
void emplace(EDPutTokenT< PROD > token, Args &&... args)
puts a new product
edm::EDPutTokenT< ThingCollection > blToken_
Definition: ThingProducer.h:45
def move(src, dest)
Definition: eostools.py:511
ThingAlgorithm alg_
Definition: ThingProducer.h:41

◆ globalBeginRunProduce()

void ThingProducer::globalBeginRunProduce ( edm::Run r,
edm::EventSetup const &  c 
) const
override

Definition at line 69 of file ThingProducer.cc.

References alg_, brToken_, eostools::move(), noPut_, mps_fire::result, and edmtest::ThingAlgorithm::run().

69  {
70  // Step A: Get Inputs
71 
72  // Step B: Create empty output
73  ThingCollection result; //Empty
74 
75  // Step C: Invoke the algorithm, passing in inputs (NONE) and getting back outputs.
76  alg_.run(result);
77 
78  // Step D: Put outputs into event
79  if (!noPut_)
80  r.emplace(brToken_, std::move(result));
81  }
void run(ThingCollection &thingCollection) const
def move(src, dest)
Definition: eostools.py:511
ThingAlgorithm alg_
Definition: ThingProducer.h:41
edm::EDPutTokenT< ThingCollection > brToken_
Definition: ThingProducer.h:43

◆ globalEndLuminosityBlockProduce()

void ThingProducer::globalEndLuminosityBlockProduce ( edm::LuminosityBlock lb,
edm::EventSetup const &  c 
) const
override

Definition at line 54 of file ThingProducer.cc.

References alg_, elToken_, edm::LuminosityBlock::emplace(), eostools::move(), noPut_, mps_fire::result, and edmtest::ThingAlgorithm::run().

54  {
55  // Step A: Get Inputs
56 
57  // Step B: Create empty output
58  ThingCollection result; //Empty
59 
60  // Step C: Invoke the algorithm, passing in inputs (NONE) and getting back outputs.
61  alg_.run(result);
62 
63  // Step D: Put outputs into lumi block
64  if (!noPut_)
66  }
edm::EDPutTokenT< ThingCollection > elToken_
Definition: ThingProducer.h:46
void run(ThingCollection &thingCollection) const
void emplace(EDPutTokenT< PROD > token, Args &&... args)
puts a new product
def move(src, dest)
Definition: eostools.py:511
ThingAlgorithm alg_
Definition: ThingProducer.h:41

◆ globalEndRunProduce()

void ThingProducer::globalEndRunProduce ( edm::Run r,
edm::EventSetup const &  c 
) const
override

Definition at line 83 of file ThingProducer.cc.

References alg_, erToken_, eostools::move(), noPut_, mps_fire::result, and edmtest::ThingAlgorithm::run().

83  {
84  // Step A: Get Inputs
85 
86  // Step B: Create empty output
87  ThingCollection result; //Empty
88 
89  // Step C: Invoke the algorithm, passing in inputs (NONE) and getting back outputs.
90  alg_.run(result);
91 
92  // Step D: Put outputs into event
93  if (!noPut_)
94  r.emplace(erToken_, std::move(result));
95  }
void run(ThingCollection &thingCollection) const
edm::EDPutTokenT< ThingCollection > erToken_
Definition: ThingProducer.h:44
def move(src, dest)
Definition: eostools.py:511
ThingAlgorithm alg_
Definition: ThingProducer.h:41

◆ produce()

void ThingProducer::produce ( edm::StreamID  ,
edm::Event e,
edm::EventSetup const &  c 
) const
overridevirtual

Implements edm::global::EDProducerBase.

Definition at line 25 of file ThingProducer.cc.

References alg_, MillePedeFileConverter_cfg::e, evToken_, eostools::move(), noPut_, mps_fire::result, and edmtest::ThingAlgorithm::run().

25  {
26  // Step A: Get Inputs
27 
28  // Step B: Create empty output
29  ThingCollection result; //Empty
30 
31  // Step C: Invoke the algorithm, passing in inputs (NONE) and getting back outputs.
32  alg_.run(result);
33 
34  // Step D: Put outputs into event
35  if (!noPut_)
36  e.emplace(evToken_, std::move(result));
37  }
edm::EDPutTokenT< ThingCollection > evToken_
Definition: ThingProducer.h:42
void run(ThingCollection &thingCollection) const
def move(src, dest)
Definition: eostools.py:511
ThingAlgorithm alg_
Definition: ThingProducer.h:41

Member Data Documentation

◆ alg_

ThingAlgorithm edmtest::ThingProducer::alg_
private

◆ blToken_

edm::EDPutTokenT<ThingCollection> edmtest::ThingProducer::blToken_
private

Definition at line 45 of file ThingProducer.h.

Referenced by globalBeginLuminosityBlockProduce(), and ThingProducer().

◆ brToken_

edm::EDPutTokenT<ThingCollection> edmtest::ThingProducer::brToken_
private

Definition at line 43 of file ThingProducer.h.

Referenced by globalBeginRunProduce(), and ThingProducer().

◆ elToken_

edm::EDPutTokenT<ThingCollection> edmtest::ThingProducer::elToken_
private

Definition at line 46 of file ThingProducer.h.

Referenced by globalEndLuminosityBlockProduce(), and ThingProducer().

◆ erToken_

edm::EDPutTokenT<ThingCollection> edmtest::ThingProducer::erToken_
private

Definition at line 44 of file ThingProducer.h.

Referenced by globalEndRunProduce(), and ThingProducer().

◆ evToken_

edm::EDPutTokenT<ThingCollection> edmtest::ThingProducer::evToken_
private

Definition at line 42 of file ThingProducer.h.

Referenced by produce(), and ThingProducer().

◆ noPut_

bool edmtest::ThingProducer::noPut_
private