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
26 
29 
33 
34 //
35 // constants, enums and typedefs
36 //
37 namespace edm {
38  namespace one {
39  //
40  // static data member definitions
41  //
42 
43  //
44  // constructors and destructor
45  //
46  EDAnalyzerBase::EDAnalyzerBase() : moduleDescription_() {}
47 
49 
52  }
53 
55  ActivityRegistry* act,
56  ModuleCallingContext const* mcc) {
58  e.setConsumer(this);
59  e.setSharedResourcesAcquirer(&resourcesAcquirer_);
60  EventSignalsSentry sentry(act, mcc);
61  ESParentContext parentC(mcc);
62  const EventSetup c{
63  info, static_cast<unsigned int>(Transition::Event), esGetTokenIndices(Transition::Event), parentC};
64  this->analyze(e, c);
65  return true;
66  }
67 
70  std::vector<std::shared_ptr<SerialTaskQueue>>(1, std::make_shared<SerialTaskQueue>())};
71  }
72 
75 
78 
79  this->beginJob();
80  }
81 
82  void EDAnalyzerBase::doEndJob() { this->endJob(); }
83 
86  }
87  void EDAnalyzerBase::preallocLumis(unsigned int){};
88 
90  ProcessBlock processBlock(pbp, moduleDescription_, mcc, false);
91  processBlock.setConsumer(this);
92  ProcessBlock const& constProcessBlock = processBlock;
93  this->doBeginProcessBlock_(constProcessBlock);
94  }
95 
97  ProcessBlock processBlock(pbp, moduleDescription_, mcc, false);
98  processBlock.setConsumer(this);
99  ProcessBlock const& constProcessBlock = processBlock;
100  this->doAccessInputProcessBlock_(constProcessBlock);
101  }
102 
104  ProcessBlock processBlock(pbp, moduleDescription_, mcc, true);
105  processBlock.setConsumer(this);
106  ProcessBlock const& constProcessBlock = processBlock;
107  this->doEndProcessBlock_(constProcessBlock);
108  }
109 
111  Run r(info, moduleDescription_, mcc, false);
112  r.setConsumer(this);
113  Run const& cnstR = r;
114  ESParentContext parentC(mcc);
115  const EventSetup c{
116  info, static_cast<unsigned int>(Transition::BeginRun), esGetTokenIndices(Transition::BeginRun), parentC};
117  this->doBeginRun_(cnstR, c);
118  }
119 
121  Run r(info, moduleDescription_, mcc, true);
122  r.setConsumer(this);
123  Run const& cnstR = r;
124  ESParentContext parentC(mcc);
125  const EventSetup c{
126  info, static_cast<unsigned int>(Transition::EndRun), esGetTokenIndices(Transition::EndRun), parentC};
127  this->doEndRun_(cnstR, c);
128  }
129 
131  LuminosityBlock lb(info, moduleDescription_, mcc, false);
132  lb.setConsumer(this);
133  LuminosityBlock const& cnstLb = lb;
134  ESParentContext parentC(mcc);
135  const EventSetup c{info,
136  static_cast<unsigned int>(Transition::BeginLuminosityBlock),
138  parentC};
139  this->doBeginLuminosityBlock_(cnstLb, c);
140  }
141 
143  LuminosityBlock lb(info, moduleDescription_, mcc, true);
144  lb.setConsumer(this);
145  LuminosityBlock const& cnstLb = lb;
146  ESParentContext parentC(mcc);
147  const EventSetup c{info,
148  static_cast<unsigned int>(Transition::EndLuminosityBlock),
150  parentC};
151  this->doEndLuminosityBlock_(cnstLb, c);
152  }
153 
157 
158  void EDAnalyzerBase::doBeginRun_(Run const& rp, EventSetup const& c) {}
159  void EDAnalyzerBase::doEndRun_(Run const& rp, EventSetup const& c) {}
162 
164 
167  desc.setUnknown();
168  descriptions.addDefault(desc);
169  }
170 
172 
173  static const std::string kBaseType("EDAnalyzer");
174 
176 
180 
182  regService->watchProductAdditions(callWhenNewProductsRegistered_);
183  }
184  }
185 
186  } // namespace one
187 } // namespace edm
static const std::string kBaseType("EDAnalyzer")
void doBeginProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
virtual SerialTaskQueue * globalLuminosityBlocksQueue()
static const TGPicture * info(bool iBackgroundIsBlack)
void setConsumer(EDConsumerBase const *iConsumer)
void doEndProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
virtual void doAccessInputProcessBlock_(ProcessBlock const &)
static const std::string & baseType()
virtual void doEndProcessBlock_(ProcessBlock const &)
void doBeginLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
virtual void preallocLumis(unsigned int)
static void prevalidate(ConfigurationDescriptions &descriptions)
ESProxyIndex const * esGetTokenIndices(edm::Transition iTrans) const
void doPreallocate(PreallocationConfiguration const &)
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)
void setConsumer(EDConsumerBase const *iConsumer)
Definition: ProcessBlock.h:53
std::function< void(BranchDescription const &)> callWhenNewProductsRegistered_
virtual void clearInputProcessBlockCaches()
void edmodule_mightGet_config(ConfigurationDescriptions &iDesc)
void callWhenNewProductsRegistered(std::function< void(BranchDescription const &)> const &func)
void doAccessInputProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
SharedResourcesAcquirer resourcesAcquirer_
void callForEachBranch(T const &iFunc)
virtual void doBeginProcessBlock_(ProcessBlock const &)
ModuleDescription moduleDescription_
virtual SerialTaskQueue * globalRunsQueue()
virtual void doBeginLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
HLT enums.
void doEndLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
bool doEvent(EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)
void doBeginRun(RunTransitionInfo const &, ModuleCallingContext const *)
void doEndRun(RunTransitionInfo const &, ModuleCallingContext const *)
virtual void doBeginRun_(Run const &rp, EventSetup const &c)
Definition: Run.h:45