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());
67  preallocRuns(iPrealloc.numberOfRuns());
68  preallocRunsSummary(iPrealloc.numberOfRuns());
71  preallocate(iPrealloc);
72  }
73 
75 
76  void EDAnalyzerBase::doEndJob() { this->endJob(); }
77 
79  ProcessBlock processBlock(pbp, moduleDescription_, mcc, false);
80  processBlock.setConsumer(this);
81  ProcessBlock const& constProcessBlock = processBlock;
82  this->doBeginProcessBlock_(constProcessBlock);
83  }
84 
86  ProcessBlock processBlock(pbp, moduleDescription_, mcc, false);
87  processBlock.setConsumer(this);
88  ProcessBlock const& constProcessBlock = processBlock;
89  this->doAccessInputProcessBlock_(constProcessBlock);
90  }
91 
93  ProcessBlock processBlock(pbp, moduleDescription_, mcc, true);
94  processBlock.setConsumer(this);
95  ProcessBlock const& constProcessBlock = processBlock;
96  this->doEndProcessBlock_(constProcessBlock);
97  }
98 
100  Run r(info, moduleDescription_, mcc, false);
101  r.setConsumer(this);
102  Run const& cnstR = r;
103  ESParentContext parentC(mcc);
104  const EventSetup c{
105  info, static_cast<unsigned int>(Transition::BeginRun), esGetTokenIndices(Transition::BeginRun), parentC};
106  this->doBeginRun_(cnstR, c);
107  this->doBeginRunSummary_(cnstR, c);
108  }
109 
111  Run r(info, moduleDescription_, mcc, true);
112  r.setConsumer(this);
113  Run const& cnstR = r;
114  ESParentContext parentC(mcc);
115  const EventSetup c{
116  info, static_cast<unsigned int>(Transition::EndRun), esGetTokenIndices(Transition::EndRun), parentC};
117  this->doEndRunSummary_(r, c);
118  this->doEndRun_(cnstR, c);
119  }
120 
122  LuminosityBlock lb(info, moduleDescription_, mcc, false);
123  lb.setConsumer(this);
124  LuminosityBlock const& cnstLb = lb;
125  ESParentContext parentC(mcc);
126  const EventSetup c{info,
127  static_cast<unsigned int>(Transition::BeginLuminosityBlock),
129  parentC};
130  this->doBeginLuminosityBlock_(cnstLb, c);
131  this->doBeginLuminosityBlockSummary_(cnstLb, c);
132  }
133 
135  LuminosityBlock lb(info, moduleDescription_, mcc, true);
136  lb.setConsumer(this);
137  LuminosityBlock const& cnstLb = lb;
138  ESParentContext parentC(mcc);
139  const EventSetup c{info,
140  static_cast<unsigned int>(Transition::EndLuminosityBlock),
142  parentC};
143  this->doEndLuminosityBlockSummary_(cnstLb, c);
144  this->doEndLuminosityBlock_(cnstLb, c);
145  }
146 
150  Run r(info, moduleDescription_, mcc, false);
151  r.setConsumer(this);
152  ESParentContext parentC(mcc);
153  const EventSetup c{
154  info, static_cast<unsigned int>(Transition::BeginRun), esGetTokenIndices(Transition::BeginRun), parentC};
155  this->doStreamBeginRun_(id, r, c);
156  }
158  Run r(info, moduleDescription_, mcc, true);
159  r.setConsumer(this);
160  ESParentContext parentC(mcc);
161  const EventSetup c{
162  info, static_cast<unsigned int>(Transition::EndRun), esGetTokenIndices(Transition::EndRun), parentC};
163  this->doStreamEndRun_(id, r, c);
164  this->doStreamEndRunSummary_(id, r, c);
165  }
167  LumiTransitionInfo const& info,
168  ModuleCallingContext const* mcc) {
169  LuminosityBlock lb(info, moduleDescription_, mcc, false);
170  lb.setConsumer(this);
171  ESParentContext parentC(mcc);
172  const EventSetup c{info,
173  static_cast<unsigned int>(Transition::BeginLuminosityBlock),
175  parentC};
176  this->doStreamBeginLuminosityBlock_(id, lb, c);
177  }
178 
180  LumiTransitionInfo const& info,
181  ModuleCallingContext const* mcc) {
182  LuminosityBlock lb(info, moduleDescription_, mcc, true);
183  lb.setConsumer(this);
184  ESParentContext parentC(mcc);
185  const EventSetup c{info,
186  static_cast<unsigned int>(Transition::EndLuminosityBlock),
188  parentC};
189  this->doStreamEndLuminosityBlock_(id, lb, c);
190  this->doStreamEndLuminosityBlockSummary_(id, lb, c);
191  }
192 
193  void EDAnalyzerBase::preallocStreams(unsigned int) {}
194  void EDAnalyzerBase::preallocRuns(unsigned int) {}
196  void EDAnalyzerBase::preallocLumis(unsigned int) {}
202  void EDAnalyzerBase::doStreamEndRun_(StreamID id, Run const& rp, EventSetup const& c) {}
207  LuminosityBlock const& lbp,
208  EventSetup const& c) {}
212  void EDAnalyzerBase::doBeginRun_(Run const& rp, EventSetup const& c) {}
213  void EDAnalyzerBase::doEndRun_(Run const& rp, EventSetup const& c) {}
216 
221 
223 
226  desc.setUnknown();
227  descriptions.addDefault(desc);
228  }
229 
231 
235 
237  regService->watchProductAdditions(callWhenNewProductsRegistered_);
238  }
239  }
240  static const std::string kBaseType("EDAnalyzer");
241 
243 
244  } // namespace global
245 } // 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 preallocRunsSummary(unsigned int)
virtual void doStreamEndLuminosityBlock_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
virtual void doEndStream_(StreamID id)
static void prevalidate(ConfigurationDescriptions &descriptions)
virtual void preallocRuns(unsigned int)
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 *)