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)};
58  this->analyze(e.streamID(), e, c);
59  return true;
60  }
61 
63  preallocStreams(iPrealloc.numberOfStreams());
65  preallocate(iPrealloc);
66  }
67 
69 
70  void EDAnalyzerBase::doEndJob() { this->endJob(); }
71 
73  Run r(rp, moduleDescription_, mcc, false);
74  r.setConsumer(this);
75  Run const& cnstR = r;
76  const EventSetup c{ci, static_cast<unsigned int>(Transition::BeginRun), esGetTokenIndices(Transition::BeginRun)};
77  this->doBeginRun_(cnstR, c);
78  this->doBeginRunSummary_(cnstR, c);
79  }
80 
82  Run r(rp, moduleDescription_, mcc, true);
83  r.setConsumer(this);
84  Run const& cnstR = r;
85  const EventSetup c{ci, static_cast<unsigned int>(Transition::EndRun), esGetTokenIndices(Transition::EndRun)};
86  this->doEndRunSummary_(r, c);
87  this->doEndRun_(cnstR, c);
88  }
89 
91  EventSetupImpl const& ci,
92  ModuleCallingContext const* mcc) {
93  LuminosityBlock lb(lbp, moduleDescription_, mcc, false);
94  lb.setConsumer(this);
95  LuminosityBlock const& cnstLb = lb;
96  const EventSetup c{ci,
97  static_cast<unsigned int>(Transition::BeginLuminosityBlock),
99  this->doBeginLuminosityBlock_(cnstLb, c);
100  this->doBeginLuminosityBlockSummary_(cnstLb, c);
101  }
102 
104  EventSetupImpl const& ci,
105  ModuleCallingContext const* mcc) {
106  LuminosityBlock lb(lbp, moduleDescription_, mcc, true);
107  lb.setConsumer(this);
108  LuminosityBlock const& cnstLb = lb;
109  const EventSetup c{ci,
110  static_cast<unsigned int>(Transition::EndLuminosityBlock),
112  this->doEndLuminosityBlockSummary_(cnstLb, c);
113  this->doEndLuminosityBlock_(cnstLb, c);
114  }
115 
119  RunPrincipal const& rp,
120  EventSetupImpl const& ci,
121  ModuleCallingContext const* mcc) {
122  Run r(rp, moduleDescription_, mcc, false);
123  r.setConsumer(this);
124  const EventSetup c{ci, static_cast<unsigned int>(Transition::BeginRun), esGetTokenIndices(Transition::BeginRun)};
125  this->doStreamBeginRun_(id, r, c);
126  }
128  RunPrincipal const& rp,
129  EventSetupImpl const& ci,
130  ModuleCallingContext const* mcc) {
131  Run r(rp, moduleDescription_, mcc, true);
132  r.setConsumer(this);
133  const EventSetup c{ci, static_cast<unsigned int>(Transition::EndRun), esGetTokenIndices(Transition::EndRun)};
134  this->doStreamEndRun_(id, r, c);
135  this->doStreamEndRunSummary_(id, r, c);
136  }
138  LuminosityBlockPrincipal const& lbp,
139  EventSetupImpl const& ci,
140  ModuleCallingContext const* mcc) {
141  LuminosityBlock lb(lbp, moduleDescription_, mcc, false);
142  lb.setConsumer(this);
143  const EventSetup c{ci,
144  static_cast<unsigned int>(Transition::BeginLuminosityBlock),
146  this->doStreamBeginLuminosityBlock_(id, lb, c);
147  }
148 
150  LuminosityBlockPrincipal const& lbp,
151  EventSetupImpl const& ci,
152  ModuleCallingContext const* mcc) {
153  LuminosityBlock lb(lbp, moduleDescription_, mcc, true);
154  lb.setConsumer(this);
155  const EventSetup c{ci,
156  static_cast<unsigned int>(Transition::EndLuminosityBlock),
158  this->doStreamEndLuminosityBlock_(id, lb, c);
159  this->doStreamEndLuminosityBlockSummary_(id, lb, c);
160  }
161 
163  //respondToOpenInputFile(fb);
164  }
165 
167  //respondToCloseInputFile(fb);
168  }
169 
170  void EDAnalyzerBase::preallocStreams(unsigned int) {}
171  void EDAnalyzerBase::preallocLumis(unsigned int) {}
176  void EDAnalyzerBase::doStreamEndRun_(StreamID id, Run const& rp, EventSetup const& c) {}
181  LuminosityBlock const& lbp,
182  EventSetup const& c) {}
183 
184  void EDAnalyzerBase::doBeginRun_(Run const& rp, EventSetup const& c) {}
185  void EDAnalyzerBase::doEndRun_(Run const& rp, EventSetup const& c) {}
188 
193 
196  desc.setUnknown();
197  descriptions.addDefault(desc);
198  }
199 
201 
205 
207  regService->watchProductAdditions(callWhenNewProductsRegistered_);
208  }
209  }
210  static const std::string kBaseType("EDAnalyzer");
211 
213 
214  } // namespace limited
215 } // 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 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:37
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:95
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