CMS 3D CMS Logo

EDAnalyzerBase.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: FWCore/Framework
4 // Class : one::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 
30 
31 //
32 // constants, enums and typedefs
33 //
34 namespace edm {
35  namespace one {
36  //
37  // static data member definitions
38  //
39 
40  //
41  // constructors and destructor
42  //
43  EDAnalyzerBase::EDAnalyzerBase() : moduleDescription_() {}
44 
46 
49  }
50 
52  EventSetupImpl const& ci,
53  ActivityRegistry* act,
54  ModuleCallingContext const* mcc) {
55  Event e(ep, moduleDescription_, mcc);
56  e.setConsumer(this);
58  EventSignalsSentry sentry(act, mcc);
59  const EventSetup c{ci, static_cast<unsigned int>(Transition::Event), esGetTokenIndices(Transition::Event)};
60  this->analyze(e, c);
61  return true;
62  }
63 
66  std::vector<std::shared_ptr<SerialTaskQueue>>(1, std::make_shared<SerialTaskQueue>())};
67  }
68 
71 
74 
75  this->beginJob();
76  }
77 
78  void EDAnalyzerBase::doEndJob() { this->endJob(); }
79 
82  }
83  void EDAnalyzerBase::preallocLumis(unsigned int){};
84 
86  Run r(rp, moduleDescription_, mcc, false);
87  r.setConsumer(this);
88  Run const& cnstR = r;
89  const EventSetup c{ci, static_cast<unsigned int>(Transition::BeginRun), esGetTokenIndices(Transition::BeginRun)};
90  this->doBeginRun_(cnstR, c);
91  }
92 
94  Run r(rp, moduleDescription_, mcc, true);
95  r.setConsumer(this);
96  Run const& cnstR = r;
97  const EventSetup c{ci, static_cast<unsigned int>(Transition::EndRun), esGetTokenIndices(Transition::EndRun)};
98  this->doEndRun_(cnstR, c);
99  }
100 
102  EventSetupImpl const& ci,
103  ModuleCallingContext const* mcc) {
104  LuminosityBlock lb(lbp, moduleDescription_, mcc, false);
105  lb.setConsumer(this);
106  LuminosityBlock const& cnstLb = lb;
107  const EventSetup c{ci,
108  static_cast<unsigned int>(Transition::BeginLuminosityBlock),
110  this->doBeginLuminosityBlock_(cnstLb, c);
111  }
112 
114  EventSetupImpl const& ci,
115  ModuleCallingContext const* mcc) {
116  LuminosityBlock lb(lbp, moduleDescription_, mcc, true);
117  lb.setConsumer(this);
118  LuminosityBlock const& cnstLb = lb;
119  const EventSetup c{ci,
120  static_cast<unsigned int>(Transition::EndLuminosityBlock),
122  this->doEndLuminosityBlock_(cnstLb, c);
123  }
124 
126  //respondToOpenInputFile(fb);
127  }
128 
130  //respondToCloseInputFile(fb);
131  }
132 
133  void EDAnalyzerBase::doBeginRun_(Run const& rp, EventSetup const& c) {}
134  void EDAnalyzerBase::doEndRun_(Run const& rp, EventSetup const& c) {}
137 
140  desc.setUnknown();
141  descriptions.addDefault(desc);
142  }
143 
145 
146  static const std::string kBaseType("EDAnalyzer");
147 
149 
153 
155  regService->watchProductAdditions(callWhenNewProductsRegistered_);
156  }
157  }
158 
159  } // namespace one
160 } // namespace edm
static const std::string kBaseType("EDAnalyzer")
void doRespondToCloseInputFile(FileBlock const &fb)
virtual SerialTaskQueue * globalLuminosityBlocksQueue()
void doBeginRun(RunPrincipal const &rp, EventSetupImpl const &c, ModuleCallingContext const *)
void setConsumer(EDConsumerBase const *iConsumer)
void doEndLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetupImpl const &c, ModuleCallingContext const *)
bool doEvent(EventPrincipal const &ep, EventSetupImpl const &c, ActivityRegistry *, ModuleCallingContext const *)
static const std::string & baseType()
virtual void preallocLumis(unsigned int)
static void prevalidate(ConfigurationDescriptions &descriptions)
void doPreallocate(PreallocationConfiguration const &)
void setConsumer(EDConsumerBase const *iConsumer)
Definition: Event.cc:37
static void fillDescriptions(ConfigurationDescriptions &descriptions)
virtual void doEndRun_(Run const &rp, EventSetup const &c)
virtual void doEndLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
virtual SharedResourcesAcquirer createAcquirer()
virtual void analyze(Event const &, EventSetup const &)=0
void addDefault(ParameterSetDescription const &psetDescription)
void registerProductsAndCallbacks(EDAnalyzerBase const *module, ProductRegistry *reg)
std::function< void(BranchDescription const &)> callWhenNewProductsRegistered_
void edmodule_mightGet_config(ConfigurationDescriptions &iDesc)
void callWhenNewProductsRegistered(std::function< void(BranchDescription const &)> const &func)
SharedResourcesAcquirer resourcesAcquirer_
void callForEachBranch(T const &iFunc)
void doBeginLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetupImpl const &c, ModuleCallingContext const *)
ModuleDescription moduleDescription_
virtual SerialTaskQueue * globalRunsQueue()
void doEndRun(RunPrincipal const &rp, EventSetupImpl const &c, ModuleCallingContext const *)
void doRespondToOpenInputFile(FileBlock const &fb)
virtual void doBeginLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
void setSharedResourcesAcquirer(SharedResourcesAcquirer *iResourceAcquirer)
Definition: Event.cc:43
HLT enums.
void setConsumer(EDConsumerBase const *iConsumer)
Definition: Run.h:51
virtual void doBeginRun_(Run const &rp, EventSetup const &c)
Definition: Run.h:45
ESProxyIndex const * esGetTokenIndices(edm::Transition iTrans) const