CMS 3D CMS Logo

EDAnalyzerBase.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: FWCore/Framework
4 // Class : one::EDAnalyzerBase
5 //
6 // Implementation:
7 // [Notes on implementation]
8 //
9 // Original Author: Chris Jones
10 // Created: Thu, 02 May 2013 21:56:04 GMT
11 //
12 
13 // system include files
14 
15 // user include files
26 
29 
33 
34 //
35 // constants, enums and typedefs
36 //
37 namespace edm {
38  namespace one {
39  //
40  // static data member definitions
41  //
42 
43  //
44  // constructors and destructor
45  //
46  EDAnalyzerBase::EDAnalyzerBase() : moduleDescription_() {}
47 
49 
52  }
53 
55  ActivityRegistry* act,
56  ModuleCallingContext const* mcc) {
58  e.setConsumer(this);
59  e.setSharedResourcesAcquirer(&resourcesAcquirer_);
60  EventSignalsSentry sentry(act, mcc);
61  ESParentContext parentC(mcc);
62  const EventSetup c{
63  info, static_cast<unsigned int>(Transition::Event), esGetTokenIndices(Transition::Event), parentC, false};
64  this->analyze(e, c);
65  return true;
66  }
67 
70  std::vector<std::shared_ptr<SerialTaskQueue>>(1, std::make_shared<SerialTaskQueue>())};
71  }
72 
75 
78 
79  this->beginJob();
80  }
81 
82  void EDAnalyzerBase::doEndJob() { this->endJob(); }
83 
86  }
87  void EDAnalyzerBase::preallocLumis(unsigned int){};
88 
90  ProcessBlock processBlock(pbp, moduleDescription_, mcc, false);
91  processBlock.setConsumer(this);
92  ProcessBlock const& constProcessBlock = processBlock;
93  this->doBeginProcessBlock_(constProcessBlock);
94  }
95 
97  ProcessBlock processBlock(pbp, moduleDescription_, mcc, false);
98  processBlock.setConsumer(this);
99  ProcessBlock const& constProcessBlock = processBlock;
100  this->doAccessInputProcessBlock_(constProcessBlock);
101  }
102 
104  ProcessBlock processBlock(pbp, moduleDescription_, mcc, true);
105  processBlock.setConsumer(this);
106  ProcessBlock const& constProcessBlock = processBlock;
107  this->doEndProcessBlock_(constProcessBlock);
108  }
109 
111  Run r(info, moduleDescription_, mcc, false);
112  r.setConsumer(this);
113  Run const& cnstR = r;
114  ESParentContext parentC(mcc);
115  const EventSetup c{info,
116  static_cast<unsigned int>(Transition::BeginRun),
118  parentC,
119  false};
120  this->doBeginRun_(cnstR, c);
121  }
122 
124  Run r(info, moduleDescription_, mcc, true);
125  r.setConsumer(this);
126  Run const& cnstR = r;
127  ESParentContext parentC(mcc);
128  const EventSetup c{
129  info, static_cast<unsigned int>(Transition::EndRun), esGetTokenIndices(Transition::EndRun), parentC, false};
130  this->doEndRun_(cnstR, c);
131  }
132 
134  LuminosityBlock lb(info, moduleDescription_, mcc, false);
135  lb.setConsumer(this);
136  LuminosityBlock const& cnstLb = lb;
137  ESParentContext parentC(mcc);
138  const EventSetup c{info,
139  static_cast<unsigned int>(Transition::BeginLuminosityBlock),
141  parentC,
142  false};
143  this->doBeginLuminosityBlock_(cnstLb, c);
144  }
145 
147  LuminosityBlock lb(info, moduleDescription_, mcc, true);
148  lb.setConsumer(this);
149  LuminosityBlock const& cnstLb = lb;
150  ESParentContext parentC(mcc);
151  const EventSetup c{info,
152  static_cast<unsigned int>(Transition::EndLuminosityBlock),
154  parentC,
155  false};
156  this->doEndLuminosityBlock_(cnstLb, c);
157  }
158 
160  //respondToOpenInputFile(fb);
161  }
162 
164  //respondToCloseInputFile(fb);
165  }
166 
170 
171  void EDAnalyzerBase::doBeginRun_(Run const& rp, EventSetup const& c) {}
172  void EDAnalyzerBase::doEndRun_(Run const& rp, EventSetup const& c) {}
175 
178  desc.setUnknown();
179  descriptions.addDefault(desc);
180  }
181 
183 
184  static const std::string kBaseType("EDAnalyzer");
185 
187 
191 
193  regService->watchProductAdditions(callWhenNewProductsRegistered_);
194  }
195  }
196 
197  } // namespace one
198 } // namespace edm
ConfigurationDescriptions.h
edm::EventTransitionInfo
Definition: TransitionInfoTypes.h:26
ConstProductRegistry.h
edm::SharedResourcesAcquirer
Definition: SharedResourcesAcquirer.h:34
edm::ProductRegistry::callForEachBranch
void callForEachBranch(T const &iFunc)
Definition: ProductRegistry.h:100
SiPixelPI::one
Definition: SiPixelPayloadInspectorHelper.h:39
edm::one::EDAnalyzerBase::doEndJob
void doEndJob()
Definition: EDAnalyzerBase.cc:82
edm::one::EDAnalyzerBase::doEndLuminosityBlock
void doEndLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:146
edm::LumiTransitionInfo
Definition: TransitionInfoTypes.h:42
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
edm::Run
Definition: Run.h:45
LuminosityBlock.h
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::Transition::Event
edm::one::EDAnalyzerBase::~EDAnalyzerBase
~EDAnalyzerBase() override
Definition: EDAnalyzerBase.cc:48
edm::one::EDAnalyzerBase::doEvent
bool doEvent(EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:54
edm::one::EDAnalyzerBase::doBeginRun
void doBeginRun(RunTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:110
edm::one::EDAnalyzerBase::registerProductsAndCallbacks
void registerProductsAndCallbacks(EDAnalyzerBase const *module, ProductRegistry *reg)
Definition: EDAnalyzerBase.cc:188
ProcessBlock.h
edmodule_mightGet_config.h
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::one::EDAnalyzerBase::callWhenNewProductsRegistered_
std::function< void(BranchDescription const &)> callWhenNewProductsRegistered_
Definition: EDAnalyzerBase.h:125
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:153
edm::SerialTaskQueue
Definition: SerialTaskQueue.h:67
edm::one::EDAnalyzerBase::doBeginJob
void doBeginJob()
Definition: EDAnalyzerBase.cc:76
edm::one::EDAnalyzerBase::doBeginProcessBlock_
virtual void doBeginProcessBlock_(ProcessBlock const &)
Definition: EDAnalyzerBase.cc:167
PreallocationConfiguration.h
edm::one::EDAnalyzerBase::moduleDescription_
ModuleDescription moduleDescription_
Definition: EDAnalyzerBase.h:124
edm::one::EDAnalyzerBase::callWhenNewProductsRegistered
void callWhenNewProductsRegistered(std::function< void(BranchDescription const &)> const &func)
Definition: EDAnalyzerBase.cc:50
edm::RunTransitionInfo
Definition: TransitionInfoTypes.h:64
EventSignalsSentry.h
edm::ProcessBlockPrincipal
Definition: ProcessBlockPrincipal.h:22
edm::one::EDAnalyzerBase::doBeginProcessBlock
void doBeginProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:89
edm::one::EDAnalyzerBase::resourcesAcquirer_
SharedResourcesAcquirer resourcesAcquirer_
Definition: EDAnalyzerBase.h:127
edm::one::EDAnalyzerBase::doBeginRun_
virtual void doBeginRun_(Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:171
edm::ProductRegistry
Definition: ProductRegistry.h:37
edm::FileBlock
Definition: FileBlock.h:20
edm::one::EDAnalyzerBase::doEndProcessBlock
void doEndProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:103
edm::PreallocationConfiguration::numberOfLuminosityBlocks
unsigned int numberOfLuminosityBlocks() const
Definition: PreallocationConfiguration.h:36
edm::one::EDAnalyzerBase::doRespondToOpenInputFile
void doRespondToOpenInputFile(FileBlock const &fb)
Definition: EDAnalyzerBase.cc:159
edm::one::EDAnalyzerBase::doBeginLuminosityBlock_
virtual void doBeginLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:173
edm::one::EDAnalyzerBase::doRespondToCloseInputFile
void doRespondToCloseInputFile(FileBlock const &fb)
Definition: EDAnalyzerBase.cc:163
edm::ProcessBlock::setConsumer
void setConsumer(EDConsumerBase const *iConsumer)
Definition: ProcessBlock.h:53
Service.h
edm::ActivityRegistry
Definition: ActivityRegistry.h:134
Run.h
edm::one::EDAnalyzerBase::beginJob
virtual void beginJob()
Definition: EDAnalyzerBase.h:107
edm::one::EDAnalyzerBase::doBeginLuminosityBlock
void doBeginLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:133
edm::one::EDAnalyzerBase::EDAnalyzerBase
EDAnalyzerBase()
Definition: EDAnalyzerBase.cc:46
edm::Transition::BeginLuminosityBlock
ParameterSetDescription.h
edm::one::EDAnalyzerBase::doAccessInputProcessBlock_
virtual void doAccessInputProcessBlock_(ProcessBlock const &)
Definition: EDAnalyzerBase.cc:168
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::one::EDAnalyzerBase::doPreallocate
void doPreallocate(PreallocationConfiguration const &)
Definition: EDAnalyzerBase.cc:84
edm::one::EDAnalyzerBase::doEndProcessBlock_
virtual void doEndProcessBlock_(ProcessBlock const &)
Definition: EDAnalyzerBase.cc:169
edm::one::EDAnalyzerBase::doEndRun_
virtual void doEndRun_(Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:172
edm::one::EDAnalyzerBase::endJob
virtual void endJob()
Definition: EDAnalyzerBase.h:108
ESParentContext.h
Event.h
edm::LuminosityBlock::setConsumer
void setConsumer(EDConsumerBase const *iConsumer)
Definition: LuminosityBlock.cc:34
edm::one::EDAnalyzerBase::prevalidate
static void prevalidate(ConfigurationDescriptions &descriptions)
Definition: EDAnalyzerBase.cc:182
edm::Service
Definition: Service.h:30
edm::EventSetup
Definition: EventSetup.h:58
edm::one::EDAnalyzerBase::doEndLuminosityBlock_
virtual void doEndLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:174
edm::ESParentContext
Definition: ESParentContext.h:21
TrackCollections2monitor_cff.func
func
Definition: TrackCollections2monitor_cff.py:359
edm::one::EDAnalyzerBase::doEndRun
void doEndRun(RunTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:123
edm::one::EDAnalyzerBase::createAcquirer
virtual SharedResourcesAcquirer createAcquirer()
Definition: EDAnalyzerBase.cc:68
alignCSCRings.r
r
Definition: alignCSCRings.py:93
edm::PreallocationConfiguration
Definition: PreallocationConfiguration.h:27
edm::EventSignalsSentry
Definition: EventSignalsSentry.h:29
edm::one::EDAnalyzerBase::analyze
virtual void analyze(Event const &, EventSetup const &)=0
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
edm::Transition::EndLuminosityBlock
edm::one::kBaseType
static const std::string kBaseType("EDAnalyzer")
edm::one::EDAnalyzerBase::globalLuminosityBlocksQueue
virtual SerialTaskQueue * globalLuminosityBlocksQueue()
Definition: EDAnalyzerBase.cc:74
edm::EDConsumerBase::esGetTokenIndices
ESProxyIndex const * esGetTokenIndices(edm::Transition iTrans) const
Definition: EDConsumerBase.h:120
edm::Transition::BeginRun
edm::one::EDAnalyzerBase::baseType
static const std::string & baseType()
Definition: EDAnalyzerBase.cc:186
HiBiasedCentrality_cfi.function
function
Definition: HiBiasedCentrality_cfi.py:4
EventSetup.h
edm::one::EDAnalyzerBase::preallocLumis
virtual void preallocLumis(unsigned int)
Definition: EDAnalyzerBase.cc:87
edm::one::EDAnalyzerBase::globalRunsQueue
virtual SerialTaskQueue * globalRunsQueue()
Definition: EDAnalyzerBase.cc:73
edm::BranchDescription
Definition: BranchDescription.h:32
edm::edmodule_mightGet_config
void edmodule_mightGet_config(ConfigurationDescriptions &iDesc)
Definition: edmodule_mightGet_config.cc:36
TransitionInfoTypes.h
edm::one::EDAnalyzerBase::doAccessInputProcessBlock
void doAccessInputProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:96
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
edm::Event
Definition: Event.h:73
edm::Transition::EndRun
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
edm::ProcessBlock
Definition: ProcessBlock.h:36
benchmark_cfg.fb
fb
Definition: benchmark_cfg.py:14
EDAnalyzerBase.h
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
edm::one::EDAnalyzerBase::fillDescriptions
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: EDAnalyzerBase.cc:176
edm::one::EDAnalyzerBase
Definition: EDAnalyzerBase.h:46
edm::ModuleCallingContext
Definition: ModuleCallingContext.h:29