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 : 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
26 
29 
31 
35 
36 //
37 // constants, enums and typedefs
38 //
39 namespace edm {
40  namespace limited {
41  //
42  // static data member definitions
43  //
44 
45  //
46  // constructors and destructor
47  //
49  : moduleDescription_(), queue_(pset.getUntrackedParameter<unsigned int>("concurrencyLimit")) {}
50 
52 
54  ActivityRegistry* act,
55  ModuleCallingContext const* mcc) {
56  Event e(info, moduleDescription_, mcc);
57  e.setConsumer(this);
58  EventSignalsSentry sentry(act, mcc);
59  ESParentContext parentC(mcc);
60  const EventSetup c{
61  info, static_cast<unsigned int>(Transition::Event), esGetTokenIndices(Transition::Event), parentC, false};
62  this->analyze(e.streamID(), e, c);
63  return true;
64  }
65 
67  preallocStreams(iPrealloc.numberOfStreams());
70  preallocate(iPrealloc);
71  }
72 
74 
75  void EDAnalyzerBase::doEndJob() { this->endJob(); }
76 
78  ProcessBlock processBlock(pbp, moduleDescription_, mcc, false);
79  processBlock.setConsumer(this);
80  ProcessBlock const& constProcessBlock = processBlock;
81  this->doBeginProcessBlock_(constProcessBlock);
82  }
83 
85  ProcessBlock processBlock(pbp, moduleDescription_, mcc, false);
86  processBlock.setConsumer(this);
87  ProcessBlock const& constProcessBlock = processBlock;
88  this->doAccessInputProcessBlock_(constProcessBlock);
89  }
90 
92  ProcessBlock processBlock(pbp, moduleDescription_, mcc, true);
93  processBlock.setConsumer(this);
94  ProcessBlock const& constProcessBlock = processBlock;
95  this->doEndProcessBlock_(constProcessBlock);
96  }
97 
99  Run r(info, moduleDescription_, mcc, false);
100  r.setConsumer(this);
101  Run const& cnstR = r;
102  ESParentContext parentC(mcc);
103  const EventSetup c{info,
104  static_cast<unsigned int>(Transition::BeginRun),
106  parentC,
107  false};
108  this->doBeginRun_(cnstR, c);
109  this->doBeginRunSummary_(cnstR, c);
110  }
111 
113  Run r(info, moduleDescription_, mcc, true);
114  r.setConsumer(this);
115  Run const& cnstR = r;
116  ESParentContext parentC(mcc);
117  const EventSetup c{
118  info, static_cast<unsigned int>(Transition::EndRun), esGetTokenIndices(Transition::EndRun), parentC, false};
119  this->doEndRunSummary_(r, c);
120  this->doEndRun_(cnstR, c);
121  }
122 
124  LuminosityBlock lb(info, moduleDescription_, mcc, false);
125  lb.setConsumer(this);
126  LuminosityBlock const& cnstLb = lb;
127  ESParentContext parentC(mcc);
128  const EventSetup c{info,
129  static_cast<unsigned int>(Transition::BeginLuminosityBlock),
131  parentC,
132  false};
133  this->doBeginLuminosityBlock_(cnstLb, c);
134  this->doBeginLuminosityBlockSummary_(cnstLb, c);
135  }
136 
138  LuminosityBlock lb(info, moduleDescription_, mcc, true);
139  lb.setConsumer(this);
140  LuminosityBlock const& cnstLb = lb;
141  ESParentContext parentC(mcc);
142  const EventSetup c{info,
143  static_cast<unsigned int>(Transition::EndLuminosityBlock),
145  parentC,
146  false};
147  this->doEndLuminosityBlockSummary_(cnstLb, c);
148  this->doEndLuminosityBlock_(cnstLb, c);
149  }
150 
154  Run r(info, moduleDescription_, mcc, false);
155  r.setConsumer(this);
156  ESParentContext parentC(mcc);
157  const EventSetup c{info,
158  static_cast<unsigned int>(Transition::BeginRun),
160  parentC,
161  false};
162  this->doStreamBeginRun_(id, r, c);
163  }
165  Run r(info, moduleDescription_, mcc, true);
166  r.setConsumer(this);
167  ESParentContext parentC(mcc);
168  const EventSetup c{
169  info, static_cast<unsigned int>(Transition::EndRun), esGetTokenIndices(Transition::EndRun), parentC, false};
170  this->doStreamEndRun_(id, r, c);
171  this->doStreamEndRunSummary_(id, r, c);
172  }
174  LumiTransitionInfo const& info,
175  ModuleCallingContext const* mcc) {
176  LuminosityBlock lb(info, moduleDescription_, mcc, false);
177  lb.setConsumer(this);
178  ESParentContext parentC(mcc);
179  const EventSetup c{info,
180  static_cast<unsigned int>(Transition::BeginLuminosityBlock),
182  parentC,
183  false};
184  this->doStreamBeginLuminosityBlock_(id, lb, c);
185  }
186 
188  LumiTransitionInfo const& info,
189  ModuleCallingContext const* mcc) {
190  LuminosityBlock lb(info, moduleDescription_, mcc, true);
191  lb.setConsumer(this);
192  ESParentContext parentC(mcc);
193  const EventSetup c{info,
194  static_cast<unsigned int>(Transition::EndLuminosityBlock),
196  parentC,
197  false};
198  this->doStreamEndLuminosityBlock_(id, lb, c);
199  this->doStreamEndLuminosityBlockSummary_(id, lb, c);
200  }
201 
202  void EDAnalyzerBase::preallocStreams(unsigned int) {}
203  void EDAnalyzerBase::preallocLumis(unsigned int) {}
209  void EDAnalyzerBase::doStreamEndRun_(StreamID id, Run const& rp, EventSetup const& c) {}
214  LuminosityBlock const& lbp,
215  EventSetup const& c) {}
216 
220  void EDAnalyzerBase::doBeginRun_(Run const& rp, EventSetup const& c) {}
221  void EDAnalyzerBase::doEndRun_(Run const& rp, EventSetup const& c) {}
224 
229 
231 
234  desc.setUnknown();
235  descriptions.addDefault(desc);
236  }
237 
239 
243 
245  regService->watchProductAdditions(callWhenNewProductsRegistered_);
246  }
247  }
248  static const std::string kBaseType("EDAnalyzer");
249 
251 
252  } // namespace limited
253 } // namespace edm
void doStreamEndLuminosityBlock(StreamID, LumiTransitionInfo const &, ModuleCallingContext const *)
static const TGPicture * info(bool iBackgroundIsBlack)
void setConsumer(EDConsumerBase const *iConsumer)
const edm::EventSetup & c
virtual void doStreamBeginRun_(StreamID id, Run const &rp, EventSetup const &c)
virtual void doBeginLuminosityBlockSummary_(LuminosityBlock const &rp, EventSetup const &c)
ModuleDescription moduleDescription_
virtual void analyze(StreamID, Event const &, EventSetup const &) const =0
virtual void preallocLumisSummary(unsigned int)
void doStreamBeginRun(StreamID, RunTransitionInfo const &, ModuleCallingContext const *)
virtual void doBeginRun_(Run const &rp, EventSetup const &c)
virtual void preallocStreams(unsigned int)
virtual void doEndStream_(StreamID id)
virtual void doEndProcessBlock_(ProcessBlock const &)
void doEndProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
void setConsumer(EDConsumerBase const *iConsumer)
Definition: Event.cc:39
static void fillDescriptions(ConfigurationDescriptions &descriptions)
virtual void doStreamEndRun_(StreamID id, Run const &rp, EventSetup const &c)
bool doEvent(EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)
virtual void doBeginLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
virtual void doBeginStream_(StreamID id)
virtual void preallocate(PreallocationConfiguration const &)
virtual void doStreamEndLuminosityBlock_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
virtual void clearInputProcessBlockCaches()
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 setConsumer(EDConsumerBase const *iConsumer)
Definition: ProcessBlock.h:53
void edmodule_mightGet_config(ConfigurationDescriptions &iDesc)
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 doBeginProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
void doAccessInputProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
void doStreamEndRun(StreamID, RunTransitionInfo const &, ModuleCallingContext const *)
virtual void doEndLuminosityBlock_(LuminosityBlock const &lb, EventSetup const &c)
void doEndRun(RunTransitionInfo const &, ModuleCallingContext const *)
static void prevalidate(ConfigurationDescriptions &descriptions)
virtual void doEndRun_(Run const &rp, EventSetup const &c)
virtual void doAccessInputProcessBlock_(ProcessBlock const &)
EDAnalyzerBase(ParameterSet const &pset)
StreamID streamID() const
Definition: Event.h:98
virtual void preallocLumis(unsigned int)
void doBeginLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
virtual void doBeginProcessBlock_(ProcessBlock const &)
void doEndLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
virtual void doBeginRunSummary_(Run const &rp, EventSetup const &c)
void doStreamBeginLuminosityBlock(StreamID, LumiTransitionInfo const &, ModuleCallingContext const *)
void doBeginStream(StreamID id)
std::function< void(BranchDescription const &)> callWhenNewProductsRegistered_
virtual void doStreamEndRunSummary_(StreamID id, Run const &rp, EventSetup const &c)
void doBeginRun(RunTransitionInfo const &, ModuleCallingContext const *)
void setConsumer(EDConsumerBase const *iConsumer)
Definition: Run.h:52
void doPreallocate(PreallocationConfiguration const &)
static const std::string & baseType()
Definition: Run.h:45
ESProxyIndex const * esGetTokenIndices(edm::Transition iTrans) const