CMS 3D CMS Logo

EDAnalyzerBase.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: FWCore/Framework
4 // Class : global::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 
31 
35 
36 //
37 // constants, enums and typedefs
38 //
39 namespace edm {
40  namespace global {
41  //
42  // static data member definitions
43  //
44 
45  //
46  // constructors and destructor
47  //
48  EDAnalyzerBase::EDAnalyzerBase() : moduleDescription_() {}
49 
51 
53  ActivityRegistry* act,
54  ModuleCallingContext const* mcc) {
56  e.setConsumer(this);
57  EventSignalsSentry sentry(act, mcc);
58  ESParentContext parentC(mcc);
59  const EventSetup c{
60  info, static_cast<unsigned int>(Transition::Event), esGetTokenIndices(Transition::Event), parentC};
61  this->analyze(e.streamID(), e, c);
62  return true;
63  }
64 
66  preallocStreams(iPrealloc.numberOfStreams());
69  preallocate(iPrealloc);
70  }
71 
73 
74  void EDAnalyzerBase::doEndJob() { this->endJob(); }
75 
77  ProcessBlock processBlock(pbp, moduleDescription_, mcc, false);
78  processBlock.setConsumer(this);
79  ProcessBlock const& constProcessBlock = processBlock;
80  this->doBeginProcessBlock_(constProcessBlock);
81  }
82 
84  ProcessBlock processBlock(pbp, moduleDescription_, mcc, false);
85  processBlock.setConsumer(this);
86  ProcessBlock const& constProcessBlock = processBlock;
87  this->doAccessInputProcessBlock_(constProcessBlock);
88  }
89 
91  ProcessBlock processBlock(pbp, moduleDescription_, mcc, true);
92  processBlock.setConsumer(this);
93  ProcessBlock const& constProcessBlock = processBlock;
94  this->doEndProcessBlock_(constProcessBlock);
95  }
96 
98  Run r(info, moduleDescription_, mcc, false);
99  r.setConsumer(this);
100  Run const& cnstR = r;
101  ESParentContext parentC(mcc);
102  const EventSetup c{
103  info, static_cast<unsigned int>(Transition::BeginRun), esGetTokenIndices(Transition::BeginRun), parentC};
104  this->doBeginRun_(cnstR, c);
105  this->doBeginRunSummary_(cnstR, c);
106  }
107 
109  Run r(info, moduleDescription_, mcc, true);
110  r.setConsumer(this);
111  Run const& cnstR = r;
112  ESParentContext parentC(mcc);
113  const EventSetup c{
114  info, static_cast<unsigned int>(Transition::EndRun), esGetTokenIndices(Transition::EndRun), parentC};
115  this->doEndRunSummary_(r, c);
116  this->doEndRun_(cnstR, c);
117  }
118 
120  LuminosityBlock lb(info, moduleDescription_, mcc, false);
121  lb.setConsumer(this);
122  LuminosityBlock const& cnstLb = lb;
123  ESParentContext parentC(mcc);
124  const EventSetup c{info,
125  static_cast<unsigned int>(Transition::BeginLuminosityBlock),
127  parentC};
128  this->doBeginLuminosityBlock_(cnstLb, c);
129  this->doBeginLuminosityBlockSummary_(cnstLb, c);
130  }
131 
133  LuminosityBlock lb(info, moduleDescription_, mcc, true);
134  lb.setConsumer(this);
135  LuminosityBlock const& cnstLb = lb;
136  ESParentContext parentC(mcc);
137  const EventSetup c{info,
138  static_cast<unsigned int>(Transition::EndLuminosityBlock),
140  parentC};
141  this->doEndLuminosityBlockSummary_(cnstLb, c);
142  this->doEndLuminosityBlock_(cnstLb, c);
143  }
144 
148  Run r(info, moduleDescription_, mcc, false);
149  r.setConsumer(this);
150  ESParentContext parentC(mcc);
151  const EventSetup c{
152  info, static_cast<unsigned int>(Transition::BeginRun), esGetTokenIndices(Transition::BeginRun), parentC};
153  this->doStreamBeginRun_(id, r, c);
154  }
156  Run r(info, moduleDescription_, mcc, true);
157  r.setConsumer(this);
158  ESParentContext parentC(mcc);
159  const EventSetup c{
160  info, static_cast<unsigned int>(Transition::EndRun), esGetTokenIndices(Transition::EndRun), parentC};
161  this->doStreamEndRun_(id, r, c);
162  this->doStreamEndRunSummary_(id, r, c);
163  }
165  LumiTransitionInfo const& info,
166  ModuleCallingContext const* mcc) {
167  LuminosityBlock lb(info, moduleDescription_, mcc, false);
168  lb.setConsumer(this);
169  ESParentContext parentC(mcc);
170  const EventSetup c{info,
171  static_cast<unsigned int>(Transition::BeginLuminosityBlock),
173  parentC};
174  this->doStreamBeginLuminosityBlock_(id, lb, c);
175  }
176 
178  LumiTransitionInfo const& info,
179  ModuleCallingContext const* mcc) {
180  LuminosityBlock lb(info, moduleDescription_, mcc, true);
181  lb.setConsumer(this);
182  ESParentContext parentC(mcc);
183  const EventSetup c{info,
184  static_cast<unsigned int>(Transition::EndLuminosityBlock),
186  parentC};
187  this->doStreamEndLuminosityBlock_(id, lb, c);
188  this->doStreamEndLuminosityBlockSummary_(id, lb, c);
189  }
190 
191  void EDAnalyzerBase::preallocStreams(unsigned int) {}
192  void EDAnalyzerBase::preallocLumis(unsigned int) {}
198  void EDAnalyzerBase::doStreamEndRun_(StreamID id, Run const& rp, EventSetup const& c) {}
203  LuminosityBlock const& lbp,
204  EventSetup const& c) {}
208  void EDAnalyzerBase::doBeginRun_(Run const& rp, EventSetup const& c) {}
209  void EDAnalyzerBase::doEndRun_(Run const& rp, EventSetup const& c) {}
212 
217 
219 
222  desc.setUnknown();
223  descriptions.addDefault(desc);
224  }
225 
227 
231 
233  regService->watchProductAdditions(callWhenNewProductsRegistered_);
234  }
235  }
236  static const std::string kBaseType("EDAnalyzer");
237 
239 
240  } // namespace global
241 } // namespace edm
static const std::string kBaseType("EDAnalyzer")
virtual void doAccessInputProcessBlock_(ProcessBlock const &)
virtual void doStreamBeginRun_(StreamID id, Run const &rp, EventSetup const &c)
void doEndRun(RunTransitionInfo const &, ModuleCallingContext const *)
static const TGPicture * info(bool iBackgroundIsBlack)
void setConsumer(EDConsumerBase const *iConsumer)
virtual void doEndLuminosityBlock_(LuminosityBlock const &lb, EventSetup const &c)
virtual void analyze(StreamID, Event const &, EventSetup const &) const =0
static const std::string & baseType()
virtual void doStreamBeginLuminosityBlock_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
void doEndProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
bool doEvent(EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)
void doStreamBeginLuminosityBlock(StreamID, LumiTransitionInfo const &, ModuleCallingContext const *)
virtual void doStreamEndRun_(StreamID id, Run const &rp, EventSetup const &c)
void doBeginProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
void doStreamBeginRun(StreamID, RunTransitionInfo const &, ModuleCallingContext const *)
virtual void doBeginRunSummary_(Run const &rp, EventSetup const &c)
ESProxyIndex const * esGetTokenIndices(edm::Transition iTrans) const
virtual void doEndProcessBlock_(ProcessBlock const &)
virtual void doBeginLuminosityBlockSummary_(LuminosityBlock const &rp, EventSetup const &c)
virtual void preallocLumis(unsigned int)
virtual void preallocLumisSummary(unsigned int)
virtual void doStreamEndRunSummary_(StreamID id, Run const &rp, EventSetup const &c)
void doStreamEndLuminosityBlock(StreamID, LumiTransitionInfo const &, ModuleCallingContext const *)
std::function< void(BranchDescription const &)> callWhenNewProductsRegistered_
virtual void doEndRun_(Run const &rp, EventSetup const &c)
void addDefault(ParameterSetDescription const &psetDescription)
virtual void doStreamEndLuminosityBlockSummary_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
virtual void doBeginLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
void setConsumer(EDConsumerBase const *iConsumer)
Definition: ProcessBlock.h:53
ModuleDescription moduleDescription_
void edmodule_mightGet_config(ConfigurationDescriptions &iDesc)
virtual void preallocate(PreallocationConfiguration const &)
void registerProductsAndCallbacks(EDAnalyzerBase *module, ProductRegistry *reg)
virtual void doEndRunSummary_(Run const &rp, EventSetup const &c)
void callForEachBranch(T const &iFunc)
StreamID streamID() const
Definition: Event.h:98
void doAccessInputProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
void doEndStream(StreamID id)
void doPreallocate(PreallocationConfiguration const &)
virtual void doEndLuminosityBlockSummary_(LuminosityBlock const &lb, EventSetup const &c)
virtual void doBeginRun_(Run const &rp, EventSetup const &c)
virtual void doStreamEndLuminosityBlock_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
virtual void doEndStream_(StreamID id)
static void prevalidate(ConfigurationDescriptions &descriptions)
virtual void preallocStreams(unsigned int)
HLT enums.
void doBeginRun(RunTransitionInfo const &, ModuleCallingContext const *)
virtual void clearInputProcessBlockCaches()
void doBeginStream(StreamID id)
virtual void doBeginProcessBlock_(ProcessBlock const &)
void doEndLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
void doBeginLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
virtual void doBeginStream_(StreamID id)
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: Run.h:45
void doStreamEndRun(StreamID, RunTransitionInfo const &, ModuleCallingContext const *)