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), false};
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{
90  ci, static_cast<unsigned int>(Transition::BeginRun), esGetTokenIndices(Transition::BeginRun), false};
91  this->doBeginRun_(cnstR, c);
92  }
93 
95  Run r(rp, moduleDescription_, mcc, true);
96  r.setConsumer(this);
97  Run const& cnstR = r;
98  const EventSetup c{
99  ci, static_cast<unsigned int>(Transition::EndRun), esGetTokenIndices(Transition::EndRun), false};
100  this->doEndRun_(cnstR, c);
101  }
102 
104  EventSetupImpl const& ci,
105  ModuleCallingContext const* mcc) {
106  LuminosityBlock lb(lbp, moduleDescription_, mcc, false);
107  lb.setConsumer(this);
108  LuminosityBlock const& cnstLb = lb;
109  const EventSetup c{ci,
110  static_cast<unsigned int>(Transition::BeginLuminosityBlock),
112  false};
113  this->doBeginLuminosityBlock_(cnstLb, c);
114  }
115 
117  EventSetupImpl const& ci,
118  ModuleCallingContext const* mcc) {
119  LuminosityBlock lb(lbp, moduleDescription_, mcc, true);
120  lb.setConsumer(this);
121  LuminosityBlock const& cnstLb = lb;
122  const EventSetup c{ci,
123  static_cast<unsigned int>(Transition::EndLuminosityBlock),
125  false};
126  this->doEndLuminosityBlock_(cnstLb, c);
127  }
128 
130  //respondToOpenInputFile(fb);
131  }
132 
134  //respondToCloseInputFile(fb);
135  }
136 
137  void EDAnalyzerBase::doBeginRun_(Run const& rp, EventSetup const& c) {}
138  void EDAnalyzerBase::doEndRun_(Run const& rp, EventSetup const& c) {}
141 
144  desc.setUnknown();
145  descriptions.addDefault(desc);
146  }
147 
149 
150  static const std::string kBaseType("EDAnalyzer");
151 
153 
157 
159  regService->watchProductAdditions(callWhenNewProductsRegistered_);
160  }
161  }
162 
163  } // namespace one
164 } // 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:35
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