CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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) {
55  Event e(info, moduleDescription_, 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, false};
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{info,
103  static_cast<unsigned int>(Transition::BeginRun),
105  parentC,
106  false};
107  this->doBeginRun_(cnstR, c);
108  this->doBeginRunSummary_(cnstR, c);
109  }
110 
112  Run r(info, moduleDescription_, mcc, true);
113  r.setConsumer(this);
114  Run const& cnstR = r;
115  ESParentContext parentC(mcc);
116  const EventSetup c{
117  info, static_cast<unsigned int>(Transition::EndRun), esGetTokenIndices(Transition::EndRun), parentC, false};
118  this->doEndRunSummary_(r, c);
119  this->doEndRun_(cnstR, c);
120  }
121 
123  LuminosityBlock lb(info, moduleDescription_, mcc, false);
124  lb.setConsumer(this);
125  LuminosityBlock const& cnstLb = lb;
126  ESParentContext parentC(mcc);
127  const EventSetup c{info,
128  static_cast<unsigned int>(Transition::BeginLuminosityBlock),
130  parentC,
131  false};
132  this->doBeginLuminosityBlock_(cnstLb, c);
133  this->doBeginLuminosityBlockSummary_(cnstLb, c);
134  }
135 
137  LuminosityBlock lb(info, moduleDescription_, mcc, true);
138  lb.setConsumer(this);
139  LuminosityBlock const& cnstLb = lb;
140  ESParentContext parentC(mcc);
141  const EventSetup c{info,
142  static_cast<unsigned int>(Transition::EndLuminosityBlock),
144  parentC,
145  false};
146  this->doEndLuminosityBlockSummary_(cnstLb, c);
147  this->doEndLuminosityBlock_(cnstLb, c);
148  }
149 
153  Run r(info, moduleDescription_, mcc, false);
154  r.setConsumer(this);
155  ESParentContext parentC(mcc);
156  const EventSetup c{info,
157  static_cast<unsigned int>(Transition::BeginRun),
159  parentC,
160  false};
161  this->doStreamBeginRun_(id, r, c);
162  }
164  Run r(info, moduleDescription_, mcc, true);
165  r.setConsumer(this);
166  ESParentContext parentC(mcc);
167  const EventSetup c{
168  info, static_cast<unsigned int>(Transition::EndRun), esGetTokenIndices(Transition::EndRun), parentC, false};
169  this->doStreamEndRun_(id, r, c);
170  this->doStreamEndRunSummary_(id, r, c);
171  }
173  LumiTransitionInfo const& info,
174  ModuleCallingContext const* mcc) {
175  LuminosityBlock lb(info, moduleDescription_, mcc, false);
176  lb.setConsumer(this);
177  ESParentContext parentC(mcc);
178  const EventSetup c{info,
179  static_cast<unsigned int>(Transition::BeginLuminosityBlock),
181  parentC,
182  false};
183  this->doStreamBeginLuminosityBlock_(id, lb, c);
184  }
185 
187  LumiTransitionInfo const& info,
188  ModuleCallingContext const* mcc) {
189  LuminosityBlock lb(info, moduleDescription_, mcc, true);
190  lb.setConsumer(this);
191  ESParentContext parentC(mcc);
192  const EventSetup c{info,
193  static_cast<unsigned int>(Transition::EndLuminosityBlock),
195  parentC,
196  false};
197  this->doStreamEndLuminosityBlock_(id, lb, c);
198  this->doStreamEndLuminosityBlockSummary_(id, lb, c);
199  }
200 
201  void EDAnalyzerBase::preallocStreams(unsigned int) {}
202  void EDAnalyzerBase::preallocLumis(unsigned int) {}
208  void EDAnalyzerBase::doStreamEndRun_(StreamID id, Run const& rp, EventSetup const& c) {}
213  LuminosityBlock const& lbp,
214  EventSetup const& c) {}
218  void EDAnalyzerBase::doBeginRun_(Run const& rp, EventSetup const& c) {}
219  void EDAnalyzerBase::doEndRun_(Run const& rp, EventSetup const& c) {}
222 
227 
229 
232  desc.setUnknown();
233  descriptions.addDefault(desc);
234  }
235 
237 
241 
243  regService->watchProductAdditions(callWhenNewProductsRegistered_);
244  }
245  }
246  static const std::string kBaseType("EDAnalyzer");
247 
249 
250  } // namespace global
251 } // 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)
const edm::EventSetup & c
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)
virtual void doEndProcessBlock_(ProcessBlock const &)
void setConsumer(EDConsumerBase const *iConsumer)
Definition: Event.cc:39
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)
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)
void doBeginRun(RunTransitionInfo const &, ModuleCallingContext const *)
StreamID streamID() const
Definition: Event.h:98
virtual void clearInputProcessBlockCaches()
void doBeginStream(StreamID id)
virtual void doBeginProcessBlock_(ProcessBlock const &)
void doEndLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
void doBeginLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
void setConsumer(EDConsumerBase const *iConsumer)
Definition: Run.h:52
virtual void doBeginStream_(StreamID id)
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: Run.h:45
void doStreamEndRun(StreamID, RunTransitionInfo const &, ModuleCallingContext const *)
ESProxyIndex const * esGetTokenIndices(edm::Transition iTrans) const