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 
edm::ModuleDescription::moduleLabel
std::string const & moduleLabel() const
Definition: ModuleDescription.h:43
ProductResolverIndexHelper.h
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
edm::Run
Definition: Run.h:45
edm::LuminosityBlock::setProducer
void setProducer(ProducerBase const *iProducer)
Definition: LuminosityBlock.cc:55
LuminosityBlock.h
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::ProcessContext
Definition: ProcessContext.h:27
edm::ProducerBase::commit_
void commit_(P &iPrincipal)
Definition: ProducerBase.h:120
edm::LuminosityBlockPrincipal
Definition: LuminosityBlockPrincipal.h:31
edm::InputSourceDescription
Definition: InputSourceDescription.h:21
edm::PuttableSourceBase::beginJob
void beginJob() override
Begin protected makes it easier to do template programming.
Definition: PuttableSourceBase.cc:43
edm::ModuleDescription::processName
std::string const & processName() const
Definition: ModuleDescription.cc:47
ProductRegistry.h
PuttableSourceBase.h
edm::InRun
Definition: BranchType.h:11
edm::InputSource::productRegistry
std::shared_ptr< ProductRegistry const > productRegistry() const
Accessors for product registry.
Definition: InputSource.h:136
edm::PuttableSourceBase::PuttableSourceBase
PuttableSourceBase(ParameterSet const &, InputSourceDescription const &)
Definition: PuttableSourceBase.cc:38
edm::InputSource::moduleDescription
ModuleDescription const & moduleDescription() const
Accessor for 'module' description.
Definition: InputSource.h:189
Run.h
edm::PuttableSourceBase::doBeginRun
void doBeginRun(RunPrincipal &rp, ProcessContext const *) override
Called by framework at beginning of run.
Definition: PuttableSourceBase.cc:59
edm::InEvent
Definition: BranchType.h:11
edm::PuttableSourceBase::registerProducts
void registerProducts() final
Register any produced products.
Definition: PuttableSourceBase.cc:41
edm::ParameterSet
Definition: ParameterSet.h:47
edm::PuttableSourceBase::beginLuminosityBlock
virtual void beginLuminosityBlock(LuminosityBlock &)
Definition: PuttableSourceBase.cc:75
Event.h
edm::InputSource::productRegistryUpdate
ProductRegistry & productRegistryUpdate()
Definition: InputSource.h:330
edm::InLumi
Definition: BranchType.h:11
SimL1EmulatorRepack_CalouGT_cff.processName
processName
Definition: SimL1EmulatorRepack_CalouGT_cff.py:17
alignCSCRings.r
r
Definition: alignCSCRings.py:93
ExceptionHelpers.h
edm::ProducerBase::resolvePutIndicies
void resolvePutIndicies(BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
Definition: ProducerBase.cc:79
edm::PuttableSourceBase::beginRun
virtual void beginRun(Run &)
Definition: PuttableSourceBase.cc:73
edm::PuttableSourceBase::doBeginLumi
void doBeginLumi(LuminosityBlockPrincipal &lbp, ProcessContext const *) override
Called by framework at beginning of lumi block.
Definition: PuttableSourceBase.cc:66
edm::InputSource
Definition: InputSource.h:52
HerwigMaxPtPartonFilter_cfi.moduleLabel
moduleLabel
Definition: HerwigMaxPtPartonFilter_cfi.py:4
edm::RunPrincipal
Definition: RunPrincipal.h:34
edm::InputSource::run
RunNumber_t run() const
Accessor for current run number.
Definition: InputSource.cc:457