CMS 3D CMS Logo

EDAnalyzerBase.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: FWCore/Framework
4 // Class : limited::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
24 
27 
29 
32 
33 //
34 // constants, enums and typedefs
35 //
36 namespace edm {
37  namespace limited {
38  //
39  // static data member definitions
40  //
41 
42  //
43  // constructors and destructor
44  //
46  : moduleDescription_(), queue_(pset.getUntrackedParameter<unsigned int>("concurrencyLimit")) {}
47 
49 
51  EventSetupImpl const& ci,
52  ActivityRegistry* act,
53  ModuleCallingContext const* mcc) {
54  Event e(ep, moduleDescription_, mcc);
55  e.setConsumer(this);
56  EventSignalsSentry sentry(act, mcc);
57  const EventSetup c{ci, static_cast<unsigned int>(Transition::Event), esGetTokenIndices(Transition::Event), false};
58  this->analyze(e.streamID(), e, c);
59  return true;
60  }
61 
63  preallocStreams(iPrealloc.numberOfStreams());
66  preallocate(iPrealloc);
67  }
68 
70 
71  void EDAnalyzerBase::doEndJob() { this->endJob(); }
72 
74  Run r(rp, moduleDescription_, mcc, false);
75  r.setConsumer(this);
76  Run const& cnstR = r;
77  const EventSetup c{
78  ci, static_cast<unsigned int>(Transition::BeginRun), esGetTokenIndices(Transition::BeginRun), false};
79  this->doBeginRun_(cnstR, c);
80  this->doBeginRunSummary_(cnstR, c);
81  }
82 
84  Run r(rp, moduleDescription_, mcc, true);
85  r.setConsumer(this);
86  Run const& cnstR = r;
87  const EventSetup c{
88  ci, static_cast<unsigned int>(Transition::EndRun), esGetTokenIndices(Transition::EndRun), false};
89  this->doEndRunSummary_(r, c);
90  this->doEndRun_(cnstR, c);
91  }
92 
94  EventSetupImpl const& ci,
95  ModuleCallingContext const* mcc) {
96  LuminosityBlock lb(lbp, moduleDescription_, mcc, false);
97  lb.setConsumer(this);
98  LuminosityBlock const& cnstLb = lb;
99  const EventSetup c{ci,
100  static_cast<unsigned int>(Transition::BeginLuminosityBlock),
102  false};
103  this->doBeginLuminosityBlock_(cnstLb, c);
104  this->doBeginLuminosityBlockSummary_(cnstLb, c);
105  }
106 
108  EventSetupImpl const& ci,
109  ModuleCallingContext const* mcc) {
110  LuminosityBlock lb(lbp, moduleDescription_, mcc, true);
111  lb.setConsumer(this);
112  LuminosityBlock const& cnstLb = lb;
113  const EventSetup c{ci,
114  static_cast<unsigned int>(Transition::EndLuminosityBlock),
116  false};
117  this->doEndLuminosityBlockSummary_(cnstLb, c);
118  this->doEndLuminosityBlock_(cnstLb, c);
119  }
120 
124  RunPrincipal const& rp,
125  EventSetupImpl const& ci,
126  ModuleCallingContext const* mcc) {
127  Run r(rp, moduleDescription_, mcc, false);
128  r.setConsumer(this);
129  const EventSetup c{
130  ci, static_cast<unsigned int>(Transition::BeginRun), esGetTokenIndices(Transition::BeginRun), false};
131  this->doStreamBeginRun_(id, r, c);
132  }
134  RunPrincipal const& rp,
135  EventSetupImpl const& ci,
136  ModuleCallingContext const* mcc) {
137  Run r(rp, moduleDescription_, mcc, true);
138  r.setConsumer(this);
139  const EventSetup c{
140  ci, static_cast<unsigned int>(Transition::EndRun), esGetTokenIndices(Transition::EndRun), false};
141  this->doStreamEndRun_(id, r, c);
142  this->doStreamEndRunSummary_(id, r, c);
143  }
145  LuminosityBlockPrincipal const& lbp,
146  EventSetupImpl const& ci,
147  ModuleCallingContext const* mcc) {
148  LuminosityBlock lb(lbp, moduleDescription_, mcc, false);
149  lb.setConsumer(this);
150  const EventSetup c{ci,
151  static_cast<unsigned int>(Transition::BeginLuminosityBlock),
153  false};
154  this->doStreamBeginLuminosityBlock_(id, lb, c);
155  }
156 
158  LuminosityBlockPrincipal const& lbp,
159  EventSetupImpl const& ci,
160  ModuleCallingContext const* mcc) {
161  LuminosityBlock lb(lbp, moduleDescription_, mcc, true);
162  lb.setConsumer(this);
163  const EventSetup c{ci,
164  static_cast<unsigned int>(Transition::EndLuminosityBlock),
166  false};
167  this->doStreamEndLuminosityBlock_(id, lb, c);
168  this->doStreamEndLuminosityBlockSummary_(id, lb, c);
169  }
170 
172  //respondToOpenInputFile(fb);
173  }
174 
176  //respondToCloseInputFile(fb);
177  }
178 
179  void EDAnalyzerBase::preallocStreams(unsigned int) {}
180  void EDAnalyzerBase::preallocLumis(unsigned int) {}
186  void EDAnalyzerBase::doStreamEndRun_(StreamID id, Run const& rp, EventSetup const& c) {}
191  LuminosityBlock const& lbp,
192  EventSetup const& c) {}
193 
194  void EDAnalyzerBase::doBeginRun_(Run const& rp, EventSetup const& c) {}
195  void EDAnalyzerBase::doEndRun_(Run const& rp, EventSetup const& c) {}
198 
203 
206  desc.setUnknown();
207  descriptions.addDefault(desc);
208  }
209 
211 
215 
217  regService->watchProductAdditions(callWhenNewProductsRegistered_);
218  }
219  }
220  static const std::string kBaseType("EDAnalyzer");
221 
223 
224  } // namespace limited
225 } // namespace edm
void setConsumer(EDConsumerBase const *iConsumer)
virtual void doStreamBeginRun_(StreamID id, Run const &rp, EventSetup const &c)
void doEndLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetupImpl const &c, ModuleCallingContext const *)
virtual void doBeginLuminosityBlockSummary_(LuminosityBlock const &rp, EventSetup const &c)
ModuleDescription moduleDescription_
virtual void preallocLumisSummary(unsigned int)
virtual void doBeginRun_(Run const &rp, EventSetup const &c)
virtual void preallocStreams(unsigned int)
virtual void doEndStream_(StreamID id)
void doStreamEndRun(StreamID id, RunPrincipal const &ep, EventSetupImpl const &c, ModuleCallingContext const *)
void doRespondToCloseInputFile(FileBlock const &fb)
void setConsumer(EDConsumerBase const *iConsumer)
Definition: Event.cc:35
static void fillDescriptions(ConfigurationDescriptions &descriptions)
virtual void doStreamEndRun_(StreamID id, Run const &rp, EventSetup const &c)
virtual void analyze(StreamID, Event const &, EventSetup const &) const =0
void doStreamBeginLuminosityBlock(StreamID id, LuminosityBlockPrincipal const &ep, EventSetupImpl const &c, ModuleCallingContext const *)
virtual void doBeginLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
virtual void doBeginStream_(StreamID id)
void doRespondToOpenInputFile(FileBlock const &fb)
virtual void preallocate(PreallocationConfiguration const &)
virtual void doStreamEndLuminosityBlock_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
virtual void doEndRunSummary_(Run const &rp, EventSetup const &c)
void addDefault(ParameterSetDescription const &psetDescription)
static const std::string kBaseType("EDAnalyzer")
virtual void doStreamBeginLuminosityBlock_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
void registerProductsAndCallbacks(EDAnalyzerBase *module, ProductRegistry *reg)
void edmodule_mightGet_config(ConfigurationDescriptions &iDesc)
void doBeginLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetupImpl const &c, ModuleCallingContext const *)
virtual void doEndLuminosityBlockSummary_(LuminosityBlock const &lb, EventSetup const &c)
virtual void doStreamEndLuminosityBlockSummary_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
void callForEachBranch(T const &iFunc)
void doEndRun(RunPrincipal const &rp, EventSetupImpl const &c, ModuleCallingContext const *)
virtual void doEndLuminosityBlock_(LuminosityBlock const &lb, EventSetup const &c)
static void prevalidate(ConfigurationDescriptions &descriptions)
virtual void doEndRun_(Run const &rp, EventSetup const &c)
EDAnalyzerBase(ParameterSet const &pset)
HLT enums.
StreamID streamID() const
Definition: Event.h:96
virtual void preallocLumis(unsigned int)
virtual void doBeginRunSummary_(Run const &rp, EventSetup const &c)
void doBeginRun(RunPrincipal const &rp, EventSetupImpl const &c, ModuleCallingContext const *)
void doStreamEndLuminosityBlock(StreamID id, LuminosityBlockPrincipal const &ep, EventSetupImpl const &c, ModuleCallingContext const *)
void doBeginStream(StreamID id)
std::function< void(BranchDescription const &)> callWhenNewProductsRegistered_
virtual void doStreamEndRunSummary_(StreamID id, Run const &rp, EventSetup const &c)
void doStreamBeginRun(StreamID id, RunPrincipal const &ep, EventSetupImpl const &c, ModuleCallingContext const *)
void setConsumer(EDConsumerBase const *iConsumer)
Definition: Run.h:51
void doPreallocate(PreallocationConfiguration const &)
static const std::string & baseType()
Definition: Run.h:45
bool doEvent(EventPrincipal const &ep, EventSetupImpl const &c, ActivityRegistry *, ModuleCallingContext const *)
ESProxyIndex const * esGetTokenIndices(edm::Transition iTrans) const