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
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) {
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};
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{
104  info, static_cast<unsigned int>(Transition::BeginRun), esGetTokenIndices(Transition::BeginRun), parentC};
105  this->doBeginRun_(cnstR, c);
106  this->doBeginRunSummary_(cnstR, c);
107  }
108 
110  Run r(info, moduleDescription_, mcc, true);
111  r.setConsumer(this);
112  Run const& cnstR = r;
113  ESParentContext parentC(mcc);
114  const EventSetup c{
115  info, static_cast<unsigned int>(Transition::EndRun), esGetTokenIndices(Transition::EndRun), parentC};
116  this->doEndRunSummary_(r, c);
117  this->doEndRun_(cnstR, c);
118  }
119 
121  LuminosityBlock lb(info, moduleDescription_, mcc, false);
122  lb.setConsumer(this);
123  LuminosityBlock const& cnstLb = lb;
124  ESParentContext parentC(mcc);
125  const EventSetup c{info,
126  static_cast<unsigned int>(Transition::BeginLuminosityBlock),
128  parentC};
129  this->doBeginLuminosityBlock_(cnstLb, c);
130  this->doBeginLuminosityBlockSummary_(cnstLb, c);
131  }
132 
134  LuminosityBlock lb(info, moduleDescription_, mcc, true);
135  lb.setConsumer(this);
136  LuminosityBlock const& cnstLb = lb;
137  ESParentContext parentC(mcc);
138  const EventSetup c{info,
139  static_cast<unsigned int>(Transition::EndLuminosityBlock),
141  parentC};
142  this->doEndLuminosityBlockSummary_(cnstLb, c);
143  this->doEndLuminosityBlock_(cnstLb, c);
144  }
145 
149  Run r(info, moduleDescription_, mcc, false);
150  r.setConsumer(this);
151  ESParentContext parentC(mcc);
152  const EventSetup c{
153  info, static_cast<unsigned int>(Transition::BeginRun), esGetTokenIndices(Transition::BeginRun), parentC};
154  this->doStreamBeginRun_(id, r, c);
155  }
157  Run r(info, moduleDescription_, mcc, true);
158  r.setConsumer(this);
159  ESParentContext parentC(mcc);
160  const EventSetup c{
161  info, static_cast<unsigned int>(Transition::EndRun), esGetTokenIndices(Transition::EndRun), parentC};
162  this->doStreamEndRun_(id, r, c);
163  this->doStreamEndRunSummary_(id, r, c);
164  }
166  LumiTransitionInfo const& info,
167  ModuleCallingContext const* mcc) {
168  LuminosityBlock lb(info, moduleDescription_, mcc, false);
169  lb.setConsumer(this);
170  ESParentContext parentC(mcc);
171  const EventSetup c{info,
172  static_cast<unsigned int>(Transition::BeginLuminosityBlock),
174  parentC};
175  this->doStreamBeginLuminosityBlock_(id, lb, c);
176  }
177 
179  LumiTransitionInfo const& info,
180  ModuleCallingContext const* mcc) {
181  LuminosityBlock lb(info, moduleDescription_, mcc, true);
182  lb.setConsumer(this);
183  ESParentContext parentC(mcc);
184  const EventSetup c{info,
185  static_cast<unsigned int>(Transition::EndLuminosityBlock),
187  parentC};
188  this->doStreamEndLuminosityBlock_(id, lb, c);
189  this->doStreamEndLuminosityBlockSummary_(id, lb, c);
190  }
191 
192  void EDAnalyzerBase::preallocStreams(unsigned int) {}
193  void EDAnalyzerBase::preallocLumis(unsigned int) {}
199  void EDAnalyzerBase::doStreamEndRun_(StreamID id, Run const& rp, EventSetup const& c) {}
204  LuminosityBlock const& lbp,
205  EventSetup const& c) {}
206 
210  void EDAnalyzerBase::doBeginRun_(Run const& rp, EventSetup const& c) {}
211  void EDAnalyzerBase::doEndRun_(Run const& rp, EventSetup const& c) {}
214 
219 
221 
224  desc.setUnknown();
225  descriptions.addDefault(desc);
226  }
227 
229 
233 
235  regService->watchProductAdditions(callWhenNewProductsRegistered_);
236  }
237  }
238  static const std::string kBaseType("EDAnalyzer");
239 
241 
242  } // namespace limited
243 } // namespace edm
void doStreamEndLuminosityBlock(StreamID, LumiTransitionInfo const &, ModuleCallingContext const *)
static const TGPicture * info(bool iBackgroundIsBlack)
void setConsumer(EDConsumerBase const *iConsumer)
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 *)
ESProxyIndex const * esGetTokenIndices(edm::Transition iTrans) const
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)
StreamID streamID() const
Definition: Event.h:98
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)
HLT enums.
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 doPreallocate(PreallocationConfiguration const &)
static const std::string & baseType()
Definition: Run.h:45