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 
42 
44  auto r = productRegistry();
45  auto const runLookup = r->productLookup(InRun);
46  auto const lumiLookup = r->productLookup(InLumi);
47  auto const eventLookup = r->productLookup(InEvent);
48  auto const& processName = moduleDescription().processName();
49  auto const& moduleLabel = moduleDescription().moduleLabel();
50 
51  auto const& runModuleToIndicies = runLookup->indiciesForModulesInProcess(processName);
52  auto const& lumiModuleToIndicies = lumiLookup->indiciesForModulesInProcess(processName);
53  auto const& eventModuleToIndicies = eventLookup->indiciesForModulesInProcess(processName);
54  resolvePutIndicies(InRun, runModuleToIndicies, moduleLabel);
55  resolvePutIndicies(InLumi, lumiModuleToIndicies, moduleLabel);
56  resolvePutIndicies(InEvent, eventModuleToIndicies, moduleLabel);
57 }
58 
60  Run run(rp, moduleDescription(), nullptr, false);
61  run.setProducer(this);
62  callWithTryCatchAndPrint<void>([this, &run]() { beginRun(run); }, "Calling Source::beginRun");
63  commit_(run);
64 }
65 
67  LuminosityBlock lb(lbp, moduleDescription(), nullptr, false);
68  lb.setProducer(this);
69  callWithTryCatchAndPrint<void>([this, &lb]() { beginLuminosityBlock(lb); }, "Calling Source::beginLuminosityBlock");
70  commit_(lb);
71 }
72 
74 
virtual void beginRun(Run &)
ProductRegistry & productRegistryUpdate()
Definition: InputSource.h:359
void beginJob() override
Begin protected makes it easier to do template programming.
void doBeginLumi(LuminosityBlockPrincipal &lbp, ProcessContext const *) override
Called by framework at beginning of lumi block.
RunNumber_t run() const
Accessor for current run number.
Definition: InputSource.cc:458
void registerProducts() final
Register any produced products.
void resolvePutIndicies(BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
Definition: ProducerBase.cc:79
virtual void beginLuminosityBlock(LuminosityBlock &)
void doBeginRun(RunPrincipal &rp, ProcessContext const *) override
Called by framework at beginning of run.
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:220
PuttableSourceBase(ParameterSet const &, InputSourceDescription const &)
std::string const & processName() const
std::shared_ptr< ProductRegistry const > productRegistry() const
Accessors for product registry.
Definition: InputSource.h:165
void setProducer(ProducerBase const *iProducer)
HLT enums.
void commit_(P &iPrincipal)
Definition: ProducerBase.h:122
std::string const & moduleLabel() const
Definition: Run.h:45