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);
68  run.setProducer(this);
69  callWithTryCatchAndPrint<void>( [this,&run](){ beginRun(run); }, "Calling Source::beginRun" );
70  commit_(run);
71 }
72 
73 void
74 PuttableSourceBase::doEndRun(RunPrincipal& rp, bool cleaningUpAfterException, ProcessContext const* ) {
75  Run run(rp, moduleDescription(), nullptr);
76  run.setProducer(this);
77  callWithTryCatchAndPrint<void>( [this,&run](){ endRun(run); }, "Calling Source::endRun", cleaningUpAfterException );
78  commit_(run);
79 }
80 
81 void
83  LuminosityBlock lb(lbp, moduleDescription(), nullptr);
84  lb.setProducer(this);
85  callWithTryCatchAndPrint<void>( [this,&lb](){ beginLuminosityBlock(lb); }, "Calling Source::beginLuminosityBlock" );
86  commit_(lb);
87 }
88 
89 void
90 PuttableSourceBase::doEndLumi(LuminosityBlockPrincipal& lbp, bool cleaningUpAfterException, ProcessContext const* ) {
91  LuminosityBlock lb(lbp, moduleDescription(), nullptr);
92  lb.setProducer(this);
93  callWithTryCatchAndPrint<void>( [this,&lb](){ endLuminosityBlock(lb); }, "Calling Source::endLuminosityBlock", cleaningUpAfterException );
94  commit_(lb);
95 }
96 
97 void
99 }
100 
101 void
103 }
104 
105 void
107 }
108 
109 void
111 }
112 
113 
void setProducer(ProducerBase const *iProducer)
Definition: Run.cc:79
virtual void beginRun(Run &)
ProductRegistry & productRegistryUpdate()
Definition: InputSource.h:339
virtual void endLuminosityBlock(LuminosityBlock &)
std::string const & processName() const
void doEndRun(RunPrincipal &rp, bool cleaningUpAfterException, ProcessContext const *) override
Called by framework at end of run.
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:504
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:162
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:203
virtual void endRun(Run &)
void commit_(P &iPrincipal)
Definition: ProducerBase.h:107
void doEndLumi(LuminosityBlockPrincipal &lbp, bool cleaningUpAfterException, ProcessContext const *) override
Called by framework at end of lumi block.
Definition: Run.h:43