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 
85  preallocRuns(iPrealloc.numberOfRuns());
87  }
88 
89  void EDAnalyzerBase::preallocRuns(unsigned int) {}
90  void EDAnalyzerBase::preallocLumis(unsigned int) {}
91 
93  ProcessBlock processBlock(pbp, moduleDescription_, mcc, false);
94  processBlock.setConsumer(this);
95  ProcessBlock const& constProcessBlock = processBlock;
96  this->doBeginProcessBlock_(constProcessBlock);
97  }
98 
100  ProcessBlock processBlock(pbp, moduleDescription_, mcc, false);
101  processBlock.setConsumer(this);
102  ProcessBlock const& constProcessBlock = processBlock;
103  this->doAccessInputProcessBlock_(constProcessBlock);
104  }
105 
107  ProcessBlock processBlock(pbp, moduleDescription_, mcc, true);
108  processBlock.setConsumer(this);
109  ProcessBlock const& constProcessBlock = processBlock;
110  this->doEndProcessBlock_(constProcessBlock);
111  }
112 
114  Run r(info, moduleDescription_, mcc, false);
115  r.setConsumer(this);
116  Run const& cnstR = r;
117  ESParentContext parentC(mcc);
118  const EventSetup c{
119  info, static_cast<unsigned int>(Transition::BeginRun), esGetTokenIndices(Transition::BeginRun), parentC};
120  this->doBeginRun_(cnstR, c);
121  }
122 
124  Run r(info, moduleDescription_, mcc, true);
125  r.setConsumer(this);
126  Run const& cnstR = r;
127  ESParentContext parentC(mcc);
128  const EventSetup c{
129  info, static_cast<unsigned int>(Transition::EndRun), esGetTokenIndices(Transition::EndRun), parentC};
130  this->doEndRun_(cnstR, c);
131  }
132 
134  LuminosityBlock lb(info, moduleDescription_, mcc, false);
135  lb.setConsumer(this);
136  LuminosityBlock const& cnstLb = lb;
137  ESParentContext parentC(mcc);
138  const EventSetup c{info,
139  static_cast<unsigned int>(Transition::BeginLuminosityBlock),
141  parentC};
142  this->doBeginLuminosityBlock_(cnstLb, c);
143  }
144 
146  LuminosityBlock lb(info, moduleDescription_, mcc, true);
147  lb.setConsumer(this);
148  LuminosityBlock const& cnstLb = lb;
149  ESParentContext parentC(mcc);
150  const EventSetup c{info,
151  static_cast<unsigned int>(Transition::EndLuminosityBlock),
153  parentC};
154  this->doEndLuminosityBlock_(cnstLb, c);
155  }
156 
160 
161  void EDAnalyzerBase::doBeginRun_(Run const& rp, EventSetup const& c) {}
162  void EDAnalyzerBase::doEndRun_(Run const& rp, EventSetup const& c) {}
165 
167 
170  desc.setUnknown();
171  descriptions.addDefault(desc);
172  }
173 
175 
176  static const std::string kBaseType("EDAnalyzer");
177 
179 
183 
185  regService->watchProductAdditions(callWhenNewProductsRegistered_);
186  }
187  }
188 
189  } // namespace one
190 } // 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)
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)
ESResolverIndex const * esGetTokenIndices(edm::Transition iTrans) const
void setConsumer(EDConsumerBase const *iConsumer)
Definition: ProcessBlock.h:53
std::function< void(BranchDescription const &)> callWhenNewProductsRegistered_
virtual void clearInputProcessBlockCaches()
void edmodule_mightGet_config(ConfigurationDescriptions &iDesc)
virtual void preallocRuns(unsigned int)
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