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());
68  preallocRuns(iPrealloc.numberOfRuns());
69  preallocRunsSummary(iPrealloc.numberOfRuns());
72  preallocate(iPrealloc);
73  }
74 
76 
77  void EDAnalyzerBase::doEndJob() { this->endJob(); }
78 
80  ProcessBlock processBlock(pbp, moduleDescription_, mcc, false);
81  processBlock.setConsumer(this);
82  ProcessBlock const& constProcessBlock = processBlock;
83  this->doBeginProcessBlock_(constProcessBlock);
84  }
85 
87  ProcessBlock processBlock(pbp, moduleDescription_, mcc, false);
88  processBlock.setConsumer(this);
89  ProcessBlock const& constProcessBlock = processBlock;
90  this->doAccessInputProcessBlock_(constProcessBlock);
91  }
92 
94  ProcessBlock processBlock(pbp, moduleDescription_, mcc, true);
95  processBlock.setConsumer(this);
96  ProcessBlock const& constProcessBlock = processBlock;
97  this->doEndProcessBlock_(constProcessBlock);
98  }
99 
101  Run r(info, moduleDescription_, mcc, false);
102  r.setConsumer(this);
103  Run const& cnstR = r;
104  ESParentContext parentC(mcc);
105  const EventSetup c{
106  info, static_cast<unsigned int>(Transition::BeginRun), esGetTokenIndices(Transition::BeginRun), parentC};
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};
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  this->doBeginLuminosityBlock_(cnstLb, c);
132  this->doBeginLuminosityBlockSummary_(cnstLb, c);
133  }
134 
136  LuminosityBlock lb(info, moduleDescription_, mcc, true);
137  lb.setConsumer(this);
138  LuminosityBlock const& cnstLb = lb;
139  ESParentContext parentC(mcc);
140  const EventSetup c{info,
141  static_cast<unsigned int>(Transition::EndLuminosityBlock),
143  parentC};
144  this->doEndLuminosityBlockSummary_(cnstLb, c);
145  this->doEndLuminosityBlock_(cnstLb, c);
146  }
147 
151  Run r(info, moduleDescription_, mcc, false);
152  r.setConsumer(this);
153  ESParentContext parentC(mcc);
154  const EventSetup c{
155  info, static_cast<unsigned int>(Transition::BeginRun), esGetTokenIndices(Transition::BeginRun), parentC};
156  this->doStreamBeginRun_(id, r, c);
157  }
159  Run r(info, moduleDescription_, mcc, true);
160  r.setConsumer(this);
161  ESParentContext parentC(mcc);
162  const EventSetup c{
163  info, static_cast<unsigned int>(Transition::EndRun), esGetTokenIndices(Transition::EndRun), parentC};
164  this->doStreamEndRun_(id, r, c);
165  this->doStreamEndRunSummary_(id, r, c);
166  }
168  LumiTransitionInfo const& info,
169  ModuleCallingContext const* mcc) {
170  LuminosityBlock lb(info, moduleDescription_, mcc, false);
171  lb.setConsumer(this);
172  ESParentContext parentC(mcc);
173  const EventSetup c{info,
174  static_cast<unsigned int>(Transition::BeginLuminosityBlock),
176  parentC};
177  this->doStreamBeginLuminosityBlock_(id, lb, c);
178  }
179 
181  LumiTransitionInfo const& info,
182  ModuleCallingContext const* mcc) {
183  LuminosityBlock lb(info, moduleDescription_, mcc, true);
184  lb.setConsumer(this);
185  ESParentContext parentC(mcc);
186  const EventSetup c{info,
187  static_cast<unsigned int>(Transition::EndLuminosityBlock),
189  parentC};
190  this->doStreamEndLuminosityBlock_(id, lb, c);
191  this->doStreamEndLuminosityBlockSummary_(id, lb, c);
192  }
193 
194  void EDAnalyzerBase::preallocStreams(unsigned int) {}
195  void EDAnalyzerBase::preallocRuns(unsigned int) {}
197  void EDAnalyzerBase::preallocLumis(unsigned int) {}
203  void EDAnalyzerBase::doStreamEndRun_(StreamID id, Run const& rp, EventSetup const& c) {}
208  LuminosityBlock const& lbp,
209  EventSetup const& c) {}
210 
214  void EDAnalyzerBase::doBeginRun_(Run const& rp, EventSetup const& c) {}
215  void EDAnalyzerBase::doEndRun_(Run const& rp, EventSetup const& c) {}
218 
223 
225 
228  desc.setUnknown();
229  descriptions.addDefault(desc);
230  }
231 
233 
237 
239  regService->watchProductAdditions(callWhenNewProductsRegistered_);
240  }
241  }
242  static const std::string kBaseType("EDAnalyzer");
243 
245 
246  } // namespace limited
247 } // 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 preallocRunsSummary(unsigned int)
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 preallocRuns(unsigned int)
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