CMS 3D CMS Logo

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

#include <ThingWithMergeProducer.h>

Inheritance diagram for edmtest::ThingWithMergeProducer:
edm::one::EDProducer< edm::EndRunProducer, edm::BeginRunProducer, edm::BeginLuminosityBlockProducer, edm::EndLuminosityBlockProducer, edm::one::WatchRuns, edm::one::WatchLuminosityBlocks > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void beginLuminosityBlock (edm::LuminosityBlock const &lb, edm::EventSetup const &c) override
 
void beginLuminosityBlockProduce (edm::LuminosityBlock &lb, edm::EventSetup const &c) override
 
void beginRun (edm::Run const &r, edm::EventSetup const &c) override
 
void beginRunProduce (edm::Run &r, edm::EventSetup const &c) override
 
void endLuminosityBlock (edm::LuminosityBlock const &lb, edm::EventSetup const &c) override
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lb, edm::EventSetup const &c) override
 
void endRun (edm::Run const &r, edm::EventSetup const &c) override
 
void endRunProduce (edm::Run &r, edm::EventSetup const &c) override
 
void produce (edm::Event &e, edm::EventSetup const &c) override
 
 ThingWithMergeProducer (edm::ParameterSet const &ps)
 
 ~ThingWithMergeProducer () override
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::BeginRunProducer, edm::BeginLuminosityBlockProducer, edm::EndLuminosityBlockProducer, edm::one::WatchRuns, edm::one::WatchLuminosityBlocks >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () 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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > 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
 
bool registeredToConsumeMany (TypeID const &, 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::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Types

typedef std::vector< std::string >::const_iterator Iter
 

Private Attributes

bool changeIsEqualValue_
 
std::vector< std::string > labelsToGet_
 
bool noPut_
 

Additional Inherited Members

- Public Types inherited from edm::one::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 ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
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 11 of file ThingWithMergeProducer.h.

Member Typedef Documentation

◆ Iter

typedef std::vector<std::string>::const_iterator edmtest::ThingWithMergeProducer::Iter
private

Definition at line 43 of file ThingWithMergeProducer.h.

Constructor & Destructor Documentation

◆ ThingWithMergeProducer()

edmtest::ThingWithMergeProducer::ThingWithMergeProducer ( edm::ParameterSet const &  ps)
explicit

Definition at line 23 of file ThingWithMergeProducer.cc.

References HLT_2022v15_cff::InputTag, label, labelsToGet_, and AlCaHLTBitMon_QueryRunRegistry::string.

24  : changeIsEqualValue_(pset.getUntrackedParameter<bool>("changeIsEqualValue", false)),
25  labelsToGet_(pset.getUntrackedParameter<std::vector<std::string>>("labelsToGet", std::vector<std::string>())),
26  noPut_(pset.getUntrackedParameter<bool>("noPut", false)) {
27  produces<Thing>("event");
28  produces<Thing, edm::Transition::BeginLuminosityBlock>("beginLumi");
29  produces<Thing, edm::Transition::EndLuminosityBlock>("endLumi");
30  produces<Thing, edm::Transition::BeginRun>("beginRun");
31  produces<Thing, edm::Transition::EndRun>("endRun");
32 
33  produces<ThingWithMerge>("event");
34  produces<ThingWithMerge, edm::Transition::BeginLuminosityBlock>("beginLumi");
35  produces<ThingWithMerge, edm::Transition::EndLuminosityBlock>("endLumi");
36  produces<ThingWithMerge, edm::Transition::BeginRun>("beginRun");
37  produces<ThingWithMerge, edm::Transition::EndRun>("endRun");
38 
39  produces<ThingWithIsEqual>("event");
40  produces<ThingWithIsEqual, edm::Transition::BeginLuminosityBlock>("beginLumi");
41  produces<ThingWithIsEqual, edm::Transition::EndLuminosityBlock>("endLumi");
42  produces<ThingWithIsEqual, edm::Transition::BeginRun>("beginRun");
43  produces<ThingWithIsEqual, edm::Transition::EndRun>("endRun");
44 
45  const std::string s_prod("PROD");
46  for (auto const& label : labelsToGet_) {
47  consumes<Thing>(edm::InputTag(label, "event", s_prod));
48  consumes<Thing, edm::InLumi>(edm::InputTag(label, "beginLumi", s_prod));
49  consumes<Thing, edm::InLumi>(edm::InputTag(label, "endLumi", s_prod));
50  consumes<Thing, edm::InRun>(edm::InputTag(label, "beginRun", s_prod));
51  consumes<Thing, edm::InRun>(edm::InputTag(label, "endRun", s_prod));
52  }
53  }
std::vector< std::string > labelsToGet_
char const * label

◆ ~ThingWithMergeProducer()

edmtest::ThingWithMergeProducer::~ThingWithMergeProducer ( )
override

Definition at line 55 of file ThingWithMergeProducer.cc.

55 {}

Member Function Documentation

◆ beginLuminosityBlock()

void edmtest::ThingWithMergeProducer::beginLuminosityBlock ( edm::LuminosityBlock const &  lb,
edm::EventSetup const &  c 
)
override

Definition at line 162 of file ThingWithMergeProducer.cc.

References edm::LuminosityBlock::getByLabel(), h, labelsToGet_, and makeGlobalPositionRcd_cfg::tag.

162  {
163  for (Iter iter = labelsToGet_.begin(), ie = labelsToGet_.end(); iter != ie; ++iter) {
165  edm::InputTag tag(*iter, "beginLumi", "PROD");
166  lb.getByLabel(tag, h);
167  }
168  }
std::vector< std::string > labelsToGet_
std::vector< std::string >::const_iterator Iter
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ beginLuminosityBlockProduce()

void edmtest::ThingWithMergeProducer::beginLuminosityBlockProduce ( edm::LuminosityBlock lb,
edm::EventSetup const &  c 
)
override

Definition at line 85 of file ThingWithMergeProducer.cc.

References changeIsEqualValue_, eostools::move(), noPut_, edm::LuminosityBlock::put(), and mps_fire::result.

85  {
86  auto result = std::make_unique<Thing>();
87  result->a = 101;
88  if (!noPut_)
89  lb.put(std::move(result), "beginLumi");
90 
91  auto result2 = std::make_unique<ThingWithMerge>();
92  result2->a = 102;
93  if (!noPut_)
94  lb.put(std::move(result2), "beginLumi");
95 
96  auto result3 = std::make_unique<ThingWithIsEqual>();
97  result3->a = 103;
99  result3->a = 104;
100  if (!noPut_)
101  lb.put(std::move(result3), "beginLumi");
102  }
void put(std::unique_ptr< PROD > product)
Put a new product.
def move(src, dest)
Definition: eostools.py:511

◆ beginRun()

void edmtest::ThingWithMergeProducer::beginRun ( edm::Run const &  r,
edm::EventSetup const &  c 
)
override

Definition at line 179 of file ThingWithMergeProducer.cc.

References h, labelsToGet_, and makeGlobalPositionRcd_cfg::tag.

179  {
180  for (Iter iter = labelsToGet_.begin(), ie = labelsToGet_.end(); iter != ie; ++iter) {
182  edm::InputTag tag(*iter, "beginRun", "PROD");
183  r.getByLabel(tag, h);
184  }
185  }
std::vector< std::string > labelsToGet_
std::vector< std::string >::const_iterator Iter
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ beginRunProduce()

void edmtest::ThingWithMergeProducer::beginRunProduce ( edm::Run r,
edm::EventSetup const &  c 
)
override

Definition at line 124 of file ThingWithMergeProducer.cc.

References changeIsEqualValue_, eostools::move(), noPut_, and mps_fire::result.

124  {
125  auto result = std::make_unique<Thing>();
126  result->a = 10001;
127  if (!noPut_)
128  r.put(std::move(result), "beginRun");
129 
130  auto result2 = std::make_unique<ThingWithMerge>();
131  result2->a = 10002;
132  if (!noPut_)
133  r.put(std::move(result2), "beginRun");
134 
135  auto result3 = std::make_unique<ThingWithIsEqual>();
136  result3->a = 10003;
138  result3->a = 10004;
139  if (!noPut_)
140  r.put(std::move(result3), "beginRun");
141  }
def move(src, dest)
Definition: eostools.py:511

◆ endLuminosityBlock()

void edmtest::ThingWithMergeProducer::endLuminosityBlock ( edm::LuminosityBlock const &  lb,
edm::EventSetup const &  c 
)
override

Definition at line 170 of file ThingWithMergeProducer.cc.

References edm::LuminosityBlock::getByLabel(), h, labelsToGet_, and makeGlobalPositionRcd_cfg::tag.

170  {
171  for (Iter iter = labelsToGet_.begin(), ie = labelsToGet_.end(); iter != ie; ++iter) {
173  edm::InputTag tag(*iter, "endLumi", "PROD");
174  lb.getByLabel(tag, h);
175  }
176  }
std::vector< std::string > labelsToGet_
std::vector< std::string >::const_iterator Iter
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ endLuminosityBlockProduce()

void edmtest::ThingWithMergeProducer::endLuminosityBlockProduce ( edm::LuminosityBlock lb,
edm::EventSetup const &  c 
)
override

Definition at line 104 of file ThingWithMergeProducer.cc.

References changeIsEqualValue_, eostools::move(), noPut_, edm::LuminosityBlock::put(), and mps_fire::result.

104  {
105  auto result = std::make_unique<Thing>();
106  result->a = 1001;
107  if (!noPut_)
108  lb.put(std::move(result), "endLumi");
109 
110  auto result2 = std::make_unique<ThingWithMerge>();
111  result2->a = 1002;
112  if (!noPut_)
113  lb.put(std::move(result2), "endLumi");
114 
115  auto result3 = std::make_unique<ThingWithIsEqual>();
116  result3->a = 1003;
118  result3->a = 1004;
119  if (!noPut_)
120  lb.put(std::move(result3), "endLumi");
121  }
void put(std::unique_ptr< PROD > product)
Put a new product.
def move(src, dest)
Definition: eostools.py:511

◆ endRun()

void edmtest::ThingWithMergeProducer::endRun ( edm::Run const &  r,
edm::EventSetup const &  c 
)
override

Definition at line 187 of file ThingWithMergeProducer.cc.

References h, labelsToGet_, and makeGlobalPositionRcd_cfg::tag.

187  {
188  for (Iter iter = labelsToGet_.begin(), ie = labelsToGet_.end(); iter != ie; ++iter) {
190  edm::InputTag tag(*iter, "endRun", "PROD");
191  r.getByLabel(tag, h);
192  }
193  }
std::vector< std::string > labelsToGet_
std::vector< std::string >::const_iterator Iter
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ endRunProduce()

void edmtest::ThingWithMergeProducer::endRunProduce ( edm::Run r,
edm::EventSetup const &  c 
)
override

Definition at line 143 of file ThingWithMergeProducer.cc.

References changeIsEqualValue_, eostools::move(), noPut_, and mps_fire::result.

143  {
144  auto result = std::make_unique<Thing>();
145  result->a = 100001;
146  if (!noPut_)
147  r.put(std::move(result), "endRun");
148 
149  auto result2 = std::make_unique<ThingWithMerge>();
150  result2->a = 100002;
151  if (!noPut_)
152  r.put(std::move(result2), "endRun");
153 
154  auto result3 = std::make_unique<ThingWithIsEqual>();
155  result3->a = 100003;
157  result3->a = 100004;
158  if (!noPut_)
159  r.put(std::move(result3), "endRun");
160  }
def move(src, dest)
Definition: eostools.py:511

◆ fillDescriptions()

void edmtest::ThingWithMergeProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 195 of file ThingWithMergeProducer.cc.

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

195  {
197  desc.addUntracked<bool>("changeIsEqualValue", false);
198  desc.addUntracked<std::vector<std::string>>("labelsToGet", std::vector<std::string>());
199  desc.addUntracked<bool>("noPut", false);
200  descriptions.add("thingWithMergeProducer", desc);
201  }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

void edmtest::ThingWithMergeProducer::produce ( edm::Event e,
edm::EventSetup const &  c 
)
overridevirtual

Implements edm::one::EDProducerBase.

Definition at line 57 of file ThingWithMergeProducer.cc.

References changeIsEqualValue_, MillePedeFileConverter_cfg::e, h, labelsToGet_, eostools::move(), noPut_, mps_fire::result, AlCaHLTBitMon_QueryRunRegistry::string, and makeGlobalPositionRcd_cfg::tag.

57  {
58  // The purpose of this first getByLabel call is to cause the products
59  // that are "put" below to have a parent so we can do tests with the
60  // parentage provenance.
61  for (Iter iter = labelsToGet_.begin(), ie = labelsToGet_.end(); iter != ie; ++iter) {
63  edm::InputTag tag(*iter, "event", "PROD");
64  e.getByLabel(tag, h);
65  }
66 
67  auto result = std::make_unique<Thing>();
68  result->a = 11;
69  if (!noPut_)
70  e.put(std::move(result), std::string("event"));
71 
72  auto result2 = std::make_unique<ThingWithMerge>();
73  result2->a = 12;
74  if (!noPut_)
75  e.put(std::move(result2), std::string("event"));
76 
77  auto result3 = std::make_unique<ThingWithIsEqual>();
78  result3->a = 13;
80  result3->a = 14;
81  if (!noPut_)
82  e.put(std::move(result3), std::string("event"));
83  }
std::vector< std::string > labelsToGet_
std::vector< std::string >::const_iterator Iter
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ changeIsEqualValue_

bool edmtest::ThingWithMergeProducer::changeIsEqualValue_
private

◆ labelsToGet_

std::vector<std::string> edmtest::ThingWithMergeProducer::labelsToGet_
private

◆ noPut_

bool edmtest::ThingWithMergeProducer::noPut_
private