CMS 3D CMS Logo

PuttableSourceBase.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: FWCore/Sources
4 // Class : PuttableSourceBase
5 //
6 // Implementation:
7 // [Notes on implementation]
8 //
9 // Original Author: root
10 // Created: Tue, 26 Sep 2017 20:52:26 GMT
11 //
12 
13 // system include files
14 
15 // user include files
17 
20 
25 
26 using namespace edm;
27 //
28 // constants, enums and typedefs
29 //
30 
31 //
32 // static data member definitions
33 //
34 
35 //
36 // constructors and destructor
37 //
39 InputSource(iPSet,iISD)
40 {
41 }
42 
43 void
46 }
47 
48 void
50  auto r = productRegistry();
51  auto const runLookup = r->productLookup(InRun);
52  auto const lumiLookup = r->productLookup(InLumi);
53  auto const eventLookup = r->productLookup(InEvent);
54  auto const& processName = moduleDescription().processName();
55  auto const& moduleLabel = moduleDescription().moduleLabel();
56 
57  auto const& runModuleToIndicies = runLookup->indiciesForModulesInProcess(processName);
58  auto const& lumiModuleToIndicies = lumiLookup->indiciesForModulesInProcess(processName);
59  auto const& eventModuleToIndicies = eventLookup->indiciesForModulesInProcess(processName);
60  resolvePutIndicies(InRun,runModuleToIndicies,moduleLabel);
61  resolvePutIndicies(InLumi,lumiModuleToIndicies,moduleLabel);
62  resolvePutIndicies(InEvent,eventModuleToIndicies,moduleLabel);
63 }
64 
65 void
67  Run run(rp, moduleDescription(), nullptr, false);
68  run.setProducer(this);
69  callWithTryCatchAndPrint<void>( [this,&run](){ beginRun(run); }, "Calling Source::beginRun" );
70  commit_(run);
71 }
72 
73 void
75  LuminosityBlock lb(lbp, moduleDescription(), nullptr, false);
76  lb.setProducer(this);
77  callWithTryCatchAndPrint<void>( [this,&lb](){ beginLuminosityBlock(lb); }, "Calling Source::beginLuminosityBlock" );
78  commit_(lb);
79 }
80 
81 void
83 }
84 
85 void
87 }
88 
89 
void setProducer(ProducerBase const *iProducer)
Definition: Run.cc:79
virtual void beginRun(Run &)
ProductRegistry & productRegistryUpdate()
Definition: InputSource.h:334
std::string const & processName() const
void doBeginLumi(LuminosityBlockPrincipal &lbp, ProcessContext const *) override
Called by framework at beginning of lumi block.
void registerProducts() final
Register any produced products.
RunNumber_t run() const
Accessor for current run number.
Definition: InputSource.cc:497
std::string const & moduleLabel() const
void resolvePutIndicies(BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
Definition: ProducerBase.cc:85
virtual void beginLuminosityBlock(LuminosityBlock &)
void doBeginRun(RunPrincipal &rp, ProcessContext const *) override
Called by framework at beginning of run.
PuttableSourceBase(ParameterSet const &, InputSourceDescription const &)
void setProducer(ProducerBase const *iProducer)
HLT enums.
std::shared_ptr< ProductRegistry const > productRegistry() const
Accessors for product registry.
Definition: InputSource.h:164
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:205
void commit_(P &iPrincipal)
Definition: ProducerBase.h:107
Definition: Run.h:43