CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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) {
57  Event e(info, moduleDescription_, mcc);
58  e.setConsumer(this);
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, false};
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{info,
116  static_cast<unsigned int>(Transition::BeginRun),
118  parentC,
119  false};
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, false};
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  false};
143  this->doBeginLuminosityBlock_(cnstLb, c);
144  }
145 
147  LuminosityBlock lb(info, moduleDescription_, mcc, true);
148  lb.setConsumer(this);
149  LuminosityBlock const& cnstLb = lb;
150  ESParentContext parentC(mcc);
151  const EventSetup c{info,
152  static_cast<unsigned int>(Transition::EndLuminosityBlock),
154  parentC,
155  false};
156  this->doEndLuminosityBlock_(cnstLb, c);
157  }
158 
162 
163  void EDAnalyzerBase::doBeginRun_(Run const& rp, EventSetup const& c) {}
164  void EDAnalyzerBase::doEndRun_(Run const& rp, EventSetup const& c) {}
167 
169 
172  desc.setUnknown();
173  descriptions.addDefault(desc);
174  }
175 
177 
178  static const std::string kBaseType("EDAnalyzer");
179 
181 
185 
187  regService->watchProductAdditions(callWhenNewProductsRegistered_);
188  }
189  }
190 
191  } // namespace one
192 } // 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)
const edm::EventSetup & c
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)
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t Func __host__ __device__ V int Func func
void doPreallocate(PreallocationConfiguration const &)
void setConsumer(EDConsumerBase const *iConsumer)
Definition: Event.cc:39
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()
string function
Definition: callgraph.py:50
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)
void setSharedResourcesAcquirer(SharedResourcesAcquirer *iResourceAcquirer)
Definition: Event.cc:47
void doEndLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
bool doEvent(EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)
void doBeginRun(RunTransitionInfo const &, ModuleCallingContext const *)
void setConsumer(EDConsumerBase const *iConsumer)
Definition: Run.h:52
void doEndRun(RunTransitionInfo const &, ModuleCallingContext const *)
virtual void doBeginRun_(Run const &rp, EventSetup const &c)
Definition: Run.h:45
ESProxyIndex const * esGetTokenIndices(edm::Transition iTrans) const