1+ // -*- C++ -*-
12#ifndef Framework_ComponentMaker_h
23#define Framework_ComponentMaker_h
3- // -*- C++ -*-
44//
55// Package: Framework
66// Class : ComponentMaker
77//
8- /* *\class ComponentMaker ComponentMaker.h FWCore/Framework/interface/ComponentMaker.h
8+ /* *\class edm::eventsetup:: ComponentMaker
99
1010 Description: <one line class summary>
1111
2828#include " FWCore/Framework/interface/ComponentDescription.h"
2929#include " FWCore/Framework/interface/ESProductResolverProvider.h"
3030#include " FWCore/Framework/interface/EventSetupRecordIntervalFinder.h"
31+ #include " FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
32+ #include " FWCore/ParameterSet/interface/ParameterSet.h"
3133#include " FWCore/ParameterSet/interface/ParameterSetDescriptionFiller.h"
3234#include " FWCore/Utilities/interface/ConvertException.h"
33-
34- // forward declarations
35+ #include " FWCore/Utilities/interface/Exception.h"
3536
3637namespace edm {
3738 namespace eventsetup {
39+
40+ // forward declarations
3841 class EventSetupProvider ;
39- class EventSetupsController ;
40- class ESProductResolverProvider ;
4142
4243 class ComponentMakerBaseHelper {
4344 public:
@@ -51,10 +52,7 @@ namespace edm {
5152 class ComponentMakerBase : public ComponentMakerBaseHelper {
5253 public:
5354 typedef typename T::base_type base_type;
54- virtual std::shared_ptr<base_type> addTo (EventSetupsController& esController,
55- EventSetupProvider& iProvider,
56- ParameterSet& iConfiguration,
57- bool replaceExisting) const = 0;
55+ virtual std::shared_ptr<base_type> addTo (EventSetupProvider& iProvider, ParameterSet& iConfiguration) const = 0;
5856 };
5957
6058 template <class T , class TComponent >
@@ -65,15 +63,8 @@ namespace edm {
6563 const ComponentMaker& operator =(const ComponentMaker&) = delete ; // stop default
6664 typedef typename T::base_type base_type;
6765
68- // ---------- const member functions ---------------------
69- std::shared_ptr<base_type> addTo (EventSetupsController& esController,
70- EventSetupProvider& iProvider,
71- ParameterSet& iConfiguration,
72- bool replaceExisting) const override ;
73-
74- // ---------- static member functions --------------------
66+ std::shared_ptr<base_type> addTo (EventSetupProvider& iProvider, ParameterSet& iConfiguration) const override ;
7567
76- // ---------- member functions ---------------------------
7768 private:
7869 void setDescription (ESProductResolverProvider* iProv, const ComponentDescription& iDesc) const {
7970 iProv->setDescription (iDesc);
@@ -89,19 +80,11 @@ namespace edm {
8980 void setDescription (void *, const ComponentDescription&) const {}
9081 void setDescriptionForFinder (void *, const ComponentDescription&) const {}
9182 void setPostConstruction (void *, const edm::ParameterSet&) const {}
92- // ---------- member data --------------------------------
9383 };
9484
9585 template <class T , class TComponent >
9686 std::shared_ptr<typename ComponentMaker<T, TComponent>::base_type> ComponentMaker<T, TComponent>::addTo(
97- EventSetupsController& esController,
98- EventSetupProvider& iProvider,
99- ParameterSet& iConfiguration,
100- bool replaceExisting) const {
101- // This adds components to the EventSetupProvider for the process. It might
102- // make a new component then add it or reuse a component from an earlier
103- // SubProcess or the top level process and add that.
104-
87+ EventSetupProvider& iProvider, ParameterSet& iConfiguration) const {
10588 {
10689 auto modtype = iConfiguration.getParameter <std::string>(" @module_type" );
10790 auto moduleLabel = iConfiguration.getParameter <std::string>(" @module_label" );
@@ -119,48 +102,15 @@ namespace edm {
119102 throw ;
120103 }
121104 }
122-
123- if (!replaceExisting) {
124- std::shared_ptr<typename T::base_type> alreadyMadeComponent =
125- T::getComponentAndRegisterProcess (esController, iConfiguration);
126-
127- if (alreadyMadeComponent) {
128- // This is for the case when a component is shared between
129- // a SubProcess and a previous SubProcess or the top level process
130- // because the component has an identical configuration to a component
131- // from the top level process or earlier SubProcess.
132- std::shared_ptr<TComponent> component (
133- std::static_pointer_cast<TComponent, typename T::base_type>(alreadyMadeComponent));
134- T::addTo (iProvider, component, iConfiguration, true );
135- return component;
136- }
137- }
138-
139105 std::shared_ptr<TComponent> component = std::make_shared<TComponent>(iConfiguration);
140106 ComponentDescription description = this ->createComponentDescription (iConfiguration);
141107
142108 this ->setDescription (component.get (), description);
143109 this ->setDescriptionForFinder (component.get (), description);
144110 this ->setPostConstruction (component.get (), iConfiguration);
145111
146- if (replaceExisting) {
147- // This case is for ESProducers where in the first pass
148- // the algorithm thought the component could be shared
149- // across SubProcess's because there was an ESProducer
150- // from a previous process with an identical configuration.
151- // But in a later check it was determined that sharing was not
152- // possible because other components associated with the
153- // same record or records that record depends on had
154- // differing configurations.
155- T::replaceExisting (iProvider, component);
156- } else {
157- // This is for the case when a new component is being constructed.
158- // All components for the top level process fall in this category.
159- // Or it could be a SubProcess where neither the top level process
160- // nor any prior SubProcess had a component with exactly the same configuration.
161- T::addTo (iProvider, component, iConfiguration, false );
162- T::putComponent (esController, iConfiguration, component);
163- }
112+ T::addTo (iProvider, component);
113+
164114 return component;
165115 }
166116 } // namespace eventsetup
0 commit comments