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 Run;
28 
29  class EDProducer;
30  class EDFilter;
31  namespace one {
32  class EDProducerBase;
33  class EDFilterBase;
34  } // namespace one
35  namespace global {
36  class EDProducerBase;
37  class EDFilterBase;
38  } // namespace global
39  namespace limited {
40  class EDProducerBase;
41  class EDFilterBase;
42  } // namespace limited
43  namespace stream {
44  template <typename T>
45  class ProducingModuleAdaptorBase;
46  }
47 
48  namespace producerbasehelper {
49  template <typename P>
51  template <>
52  struct PrincipalTraits<Run> {
53  static constexpr int kBranchType = InRun;
54  };
55  template <>
57  static constexpr int kBranchType = InLumi;
58  };
59  template <>
61  static constexpr int kBranchType = InEvent;
62  };
63  } // namespace producerbasehelper
64 
66  public:
68  ProducerBase();
69  ~ProducerBase() noexcept(false) override;
70 
73 
75 
78 
81  }
82 
84  std::unordered_multimap<std::string, std::tuple<edm::TypeID const*, const char*, edm::ProductResolverIndex>>;
85  void resolvePutIndicies(BranchType iBranchType,
86  ModuleToResolverIndicies const& iIndicies,
87  std::string const& moduleLabel);
88 
89  std::vector<edm::ProductResolverIndex> const& indiciesForPutProducts(BranchType iBranchType) const {
90  return putIndicies_[iBranchType];
91  }
92 
93  std::vector<edm::ProductResolverIndex> const& putTokenIndexToProductResolverIndex() const {
95  }
96 
97  protected:
100 
101  private:
102  friend class EDProducer;
103  friend class EDFilter;
104  friend class one::EDProducerBase;
105  friend class one::EDFilterBase;
107  friend class global::EDFilterBase;
109  friend class limited::EDFilterBase;
110  friend class PuttableSourceBase;
111  template <typename T>
113 
114  template <typename P>
115  void commit_(P& iPrincipal) {
117  }
118 
119  template <typename P, typename I>
120  void commit_(P& iPrincipal, I* iID) {
122  }
123 
125  std::array<std::vector<edm::ProductResolverIndex>, edm::NumBranchTypes> putIndicies_;
126  std::vector<edm::ProductResolverIndex> putTokenToResolverIndex_;
127  };
128 } // namespace edm
129 #endif
funct::false
false
Definition: Factorize.h:34
edm::ProducerBase::ModuleToResolverIndicies
std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > > ModuleToResolverIndicies
Definition: ProducerBase.h:84
edm::producerbasehelper::PrincipalTraits
Definition: ProducerBase.h:50
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:125
edm::ProducerBase::TypeLabelList
ProductRegistryHelper::TypeLabelList TypeLabelList
Definition: ProducerBase.h:67
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::limited::EDFilterBase
Definition: EDFilterBase.h:50
cms::cuda::stream
cudaStream_t stream
Definition: HistoContainer.h:57
edm::limited::EDProducerBase
Definition: EDProducerBase.h:51
ProductResolverIndex.h
edm::ProducerBase::commit_
void commit_(P &iPrincipal)
Definition: ProducerBase.h:115
edm::ProducerBase::indiciesForPutProducts
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts(BranchType iBranchType) const
Definition: ProducerBase.h:89
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:93
edm::BranchType
BranchType
Definition: BranchType.h:11
edm::ModuleDescription
Definition: ModuleDescription.h:21
edm::NumBranchTypes
Definition: BranchType.h:11
edm::ProductRegistry
Definition: ProductRegistry.h:34
edm::ProducerBase::callWhenNewProductsRegistered
void callWhenNewProductsRegistered(std::function< void(BranchDescription const &)> const &func)
Definition: ProducerBase.h:79
Exhume::I
const std::complex< double > I
Definition: I.h:8
LuminosityBlock
Event
edm::global::EDProducerBase
Definition: EDProducerBase.h:51
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:120
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:39
edm::ProducerBase::putTokenToResolverIndex_
std::vector< edm::ProductResolverIndex > putTokenToResolverIndex_
Definition: ProducerBase.h:126
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:124
edm::one::EDFilterBase
Definition: EDFilterBase.h:48
edm::one::EDProducerBase
Definition: EDProducerBase.h:48
edm::ProducerBase::resolvePutIndicies
void resolvePutIndicies(BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
Definition: ProducerBase.cc:79
edm::global::EDFilterBase
Definition: EDFilterBase.h:50
HiBiasedCentrality_cfi.function
function
Definition: HiBiasedCentrality_cfi.py:4
function
Definition: vlib.h:246
edm::EDProducer
Definition: EDProducer.h:36
funct::void
TEMPL(T2) struct Divides void
Definition: Factorize.h:29
edm::BranchDescription
Definition: BranchDescription.h:32
HerwigMaxPtPartonFilter_cfi.moduleLabel
moduleLabel
Definition: HerwigMaxPtPartonFilter_cfi.py:4
edm::ProducerBase
Definition: ProducerBase.h:65
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::ProductRegistryHelper
Definition: ProductRegistryHelper.h:23
Run