CMS 3D CMS Logo

ProducerBase.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_ProducerBase_h
2 #define FWCore_Framework_ProducerBase_h
3 
4 /*----------------------------------------------------------------------
5 
6 EDProducer: The base class of all "modules" that will insert new
7 EDProducts into an Event.
8 
9 ----------------------------------------------------------------------*/
10 
13 
14 #include <functional>
15 #include <unordered_map>
16 #include <string>
17 #include <vector>
18 #include <array>
19 
20 namespace edm {
21  class BranchDescription;
22  class ModuleDescription;
23  class ProducesCollector;
24  class ProductRegistry;
25  class Event;
26  class LuminosityBlock;
27  class ProcessBlock;
28  class Run;
29 
30  class EDProducer;
31  class EDFilter;
32  namespace one {
33  class EDProducerBase;
34  class EDFilterBase;
35  } // namespace one
36  namespace global {
37  class EDProducerBase;
38  class EDFilterBase;
39  } // namespace global
40  namespace limited {
41  class EDProducerBase;
42  class EDFilterBase;
43  } // namespace limited
44  namespace stream {
45  template <typename T>
46  class ProducingModuleAdaptorBase;
47  }
48 
49  namespace producerbasehelper {
50  template <typename P>
52  template <>
54  static constexpr int kBranchType = InProcess;
55  };
56  template <>
57  struct PrincipalTraits<Run> {
58  static constexpr int kBranchType = InRun;
59  };
60  template <>
62  static constexpr int kBranchType = InLumi;
63  };
64  template <>
66  static constexpr int kBranchType = InEvent;
67  };
68  } // namespace producerbasehelper
69 
71  public:
73  ProducerBase();
74  ~ProducerBase() noexcept(false) override;
75 
78 
80 
83 
86  }
87 
89  std::unordered_multimap<std::string, std::tuple<edm::TypeID const*, const char*, edm::ProductResolverIndex>>;
90  void resolvePutIndicies(BranchType iBranchType,
91  ModuleToResolverIndicies const& iIndicies,
92  std::string const& moduleLabel);
93 
94  std::vector<edm::ProductResolverIndex> const& indiciesForPutProducts(BranchType iBranchType) const {
95  return putIndicies_[iBranchType];
96  }
97 
98  std::vector<edm::ProductResolverIndex> const& putTokenIndexToProductResolverIndex() const {
100  }
101 
102  protected:
105 
106  private:
107  friend class EDProducer;
108  friend class EDFilter;
109  friend class one::EDProducerBase;
110  friend class one::EDFilterBase;
112  friend class global::EDFilterBase;
114  friend class limited::EDFilterBase;
115  friend class PuttableSourceBase;
116  template <typename T>
118 
119  template <typename P>
120  void commit_(P& iPrincipal) {
122  }
123 
124  template <typename P, typename I>
125  void commit_(P& iPrincipal, I* iID) {
127  }
128 
130  std::array<std::vector<edm::ProductResolverIndex>, edm::NumBranchTypes> putIndicies_;
131  std::vector<edm::ProductResolverIndex> putTokenToResolverIndex_;
132  };
133 } // namespace edm
134 #endif
SiPixelPI::one
Definition: SiPixelPayloadInspectorHelper.h:39
funct::false
false
Definition: Factorize.h:29
edm::ProducerBase::ModuleToResolverIndicies
std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > > ModuleToResolverIndicies
Definition: ProducerBase.h:89
edm::producerbasehelper::PrincipalTraits
Definition: ProducerBase.h:51
edm::ProducerBase::ProducerBase
ProducerBase()
Definition: ProducerBase.cc:16
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
edm::Run
Definition: Run.h:45
edm::ProducerBase::putIndicies_
std::array< std::vector< edm::ProductResolverIndex >, edm::NumBranchTypes > putIndicies_
Definition: ProducerBase.h:130
edm::ProducerBase::TypeLabelList
ProductRegistryHelper::TypeLabelList TypeLabelList
Definition: ProducerBase.h:72
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::limited::EDFilterBase
Definition: EDFilterBase.h:49
cms::cuda::stream
cudaStream_t stream
Definition: HistoContainer.h:57
edm::limited::EDProducerBase
Definition: EDProducerBase.h:50
ProductResolverIndex.h
edm::ProducerBase::commit_
void commit_(P &iPrincipal)
Definition: ProducerBase.h:120
edm::ProducerBase::indiciesForPutProducts
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts(BranchType iBranchType) const
Definition: ProducerBase.h:94
ProductRegistryHelper.h
EDFilterBase
watchdog.const
const
Definition: watchdog.py:83
edm::InRun
Definition: BranchType.h:11
edm::ProducerBase::putTokenIndexToProductResolverIndex
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex() const
Definition: ProducerBase.h:98
edm::BranchType
BranchType
Definition: BranchType.h:11
edm::ModuleDescription
Definition: ModuleDescription.h:21
edm::NumBranchTypes
Definition: BranchType.h:11
edm::ProductRegistry
Definition: ProductRegistry.h:37
edm::ProducerBase::callWhenNewProductsRegistered
void callWhenNewProductsRegistered(std::function< void(BranchDescription const &)> const &func)
Definition: ProducerBase.h:84
edm::InProcess
Definition: BranchType.h:11
Exhume::I
const std::complex< double > I
Definition: I.h:8
LuminosityBlock
Event
edm::global::EDProducerBase
Definition: EDProducerBase.h:50
edm::InEvent
Definition: BranchType.h:11
edm::ProductRegistryHelper::recordProvenanceList
std::vector< bool > const & recordProvenanceList() const
Definition: ProductRegistryHelper.h:91
edm::ProductRegistryHelper::typeLabelList
TypeLabelList const & typeLabelList() const
used by the fwk to register the list of products of this module
Definition: ProductRegistryHelper.cc:20
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ProducerBase::commit_
void commit_(P &iPrincipal, I *iID)
Definition: ProducerBase.h:125
edm::ProducerBase::registrationCallback
std::function< void(BranchDescription const &)> registrationCallback() const
used by the fwk to register list of products
Definition: ProducerBase.cc:19
edm::InLumi
Definition: BranchType.h:11
EDProducerBase
edm::ProductRegistryHelper::TypeLabelList
std::vector< TypeLabelItem > TypeLabelList
Definition: ProductRegistryHelper.h:86
edm::EDFilter
Definition: EDFilter.h:38
edm::ProducerBase::putTokenToResolverIndex_
std::vector< edm::ProductResolverIndex > putTokenToResolverIndex_
Definition: ProducerBase.h:131
edm::stream::ProducingModuleAdaptorBase
Definition: Event.h:70
TrackCollections2monitor_cff.func
func
Definition: TrackCollections2monitor_cff.py:359
edm::ProducerBase::~ProducerBase
~ProducerBase() noexcept(false) override
Definition: ProducerBase.cc:17
edm::ProductRegistryHelper::produces
BranchAliasSetterT< ProductType > produces()
declare what type of product will make and with which optional label
Definition: ProductRegistryHelper.h:108
std
Definition: JetResolutionObject.h:76
edm::ProducesCollector
Definition: ProducesCollector.h:43
edm::ProducerBase::callWhenNewProductsRegistered_
std::function< void(BranchDescription const &)> callWhenNewProductsRegistered_
Definition: ProducerBase.h:129
edm::one::EDFilterBase
Definition: EDFilterBase.h:47
edm::one::EDProducerBase
Definition: EDProducerBase.h:47
edm::ProducerBase::resolvePutIndicies
void resolvePutIndicies(BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
Definition: ProducerBase.cc:79
edm::global::EDFilterBase
Definition: EDFilterBase.h:49
HiBiasedCentrality_cfi.function
function
Definition: HiBiasedCentrality_cfi.py:4
edm::EDProducer
Definition: EDProducer.h:35
funct::void
TEMPL(T2) struct Divides void
Definition: Factorize.h:24
edm::BranchDescription
Definition: BranchDescription.h:32
HerwigMaxPtPartonFilter_cfi.moduleLabel
moduleLabel
Definition: HerwigMaxPtPartonFilter_cfi.py:4
edm::ProducerBase
Definition: ProducerBase.h:70
edm::ProducerBase::registerProducts
void registerProducts(ProducerBase *, ProductRegistry *, ModuleDescription const &)
Definition: ProducerBase.cc:57
P
std::pair< OmniClusterRef, TrackingParticleRef > P
Definition: BDHadronTrackMonitoringAnalyzer.cc:202
edm::PuttableSourceBase
Definition: PuttableSourceBase.h:30
edm::Event
Definition: Event.h:73
edm::ProducerBase::producesCollector
ProducesCollector producesCollector()
Definition: ProducerBase.cc:105
edm::ProcessBlock
Definition: ProcessBlock.h:36
edm::ProductRegistryHelper
Definition: ProductRegistryHelper.h:23
Run