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 
32 
33 //
34 // constants, enums and typedefs
35 //
36 namespace edm {
37  namespace one {
38  //
39  // static data member definitions
40  //
41 
42  //
43  // constructors and destructor
44  //
45  EDAnalyzerBase::EDAnalyzerBase() : moduleDescription_() {}
46 
48 
51  }
52 
54  ActivityRegistry* act,
55  ModuleCallingContext const* mcc) {
57  e.setConsumer(this);
58  e.setSharedResourcesAcquirer(&resourcesAcquirer_);
59  EventSignalsSentry sentry(act, mcc);
60  const EventSetup c{
61  info, static_cast<unsigned int>(Transition::Event), esGetTokenIndices(Transition::Event), false};
62  this->analyze(e, c);
63  return true;
64  }
65 
68  std::vector<std::shared_ptr<SerialTaskQueue>>(1, std::make_shared<SerialTaskQueue>())};
69  }
70 
73 
76 
77  this->beginJob();
78  }
79 
80  void EDAnalyzerBase::doEndJob() { this->endJob(); }
81 
84  }
85  void EDAnalyzerBase::preallocLumis(unsigned int){};
86 
88  ProcessBlock processBlock(pbp, moduleDescription_, mcc, false);
89  processBlock.setConsumer(this);
90  ProcessBlock const& constProcessBlock = processBlock;
91  this->doBeginProcessBlock_(constProcessBlock);
92  }
93 
95  ProcessBlock processBlock(pbp, moduleDescription_, mcc, false);
96  processBlock.setConsumer(this);
97  ProcessBlock const& constProcessBlock = processBlock;
98  this->doAccessInputProcessBlock_(constProcessBlock);
99  }
100 
102  ProcessBlock processBlock(pbp, moduleDescription_, mcc, true);
103  processBlock.setConsumer(this);
104  ProcessBlock const& constProcessBlock = processBlock;
105  this->doEndProcessBlock_(constProcessBlock);
106  }
107 
109  Run r(info, moduleDescription_, mcc, false);
110  r.setConsumer(this);
111  Run const& cnstR = r;
112  const EventSetup c{
113  info, static_cast<unsigned int>(Transition::BeginRun), esGetTokenIndices(Transition::BeginRun), false};
114  this->doBeginRun_(cnstR, c);
115  }
116 
118  Run r(info, moduleDescription_, mcc, true);
119  r.setConsumer(this);
120  Run const& cnstR = r;
121  const EventSetup c{
122  info, static_cast<unsigned int>(Transition::EndRun), esGetTokenIndices(Transition::EndRun), false};
123  this->doEndRun_(cnstR, c);
124  }
125 
127  LuminosityBlock lb(info, moduleDescription_, mcc, false);
128  lb.setConsumer(this);
129  LuminosityBlock const& cnstLb = lb;
130  const EventSetup c{info,
131  static_cast<unsigned int>(Transition::BeginLuminosityBlock),
133  false};
134  this->doBeginLuminosityBlock_(cnstLb, c);
135  }
136 
138  LuminosityBlock lb(info, moduleDescription_, mcc, true);
139  lb.setConsumer(this);
140  LuminosityBlock const& cnstLb = lb;
141  const EventSetup c{info,
142  static_cast<unsigned int>(Transition::EndLuminosityBlock),
144  false};
145  this->doEndLuminosityBlock_(cnstLb, c);
146  }
147 
149  //respondToOpenInputFile(fb);
150  }
151 
153  //respondToCloseInputFile(fb);
154  }
155 
159 
160  void EDAnalyzerBase::doBeginRun_(Run const& rp, EventSetup const& c) {}
161  void EDAnalyzerBase::doEndRun_(Run const& rp, EventSetup const& c) {}
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
ConfigurationDescriptions.h
edm::EventTransitionInfo
Definition: TransitionInfoTypes.h:26
ConstProductRegistry.h
edm::SharedResourcesAcquirer
Definition: SharedResourcesAcquirer.h:34
edm::ProductRegistry::callForEachBranch
void callForEachBranch(T const &iFunc)
Definition: ProductRegistry.h:100
SiPixelPI::one
Definition: SiPixelPayloadInspectorHelper.h:39
edm::one::EDAnalyzerBase::doEndJob
void doEndJob()
Definition: EDAnalyzerBase.cc:80
edm::one::EDAnalyzerBase::doEndLuminosityBlock
void doEndLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:137
edm::LumiTransitionInfo
Definition: TransitionInfoTypes.h:42
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
edm::Run
Definition: Run.h:45
LuminosityBlock.h
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::Transition::Event
edm::one::EDAnalyzerBase::~EDAnalyzerBase
~EDAnalyzerBase() override
Definition: EDAnalyzerBase.cc:47
edm::one::EDAnalyzerBase::doEvent
bool doEvent(EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:53
edm::one::EDAnalyzerBase::doBeginRun
void doBeginRun(RunTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:108
edm::one::EDAnalyzerBase::registerProductsAndCallbacks
void registerProductsAndCallbacks(EDAnalyzerBase const *module, ProductRegistry *reg)
Definition: EDAnalyzerBase.cc:177
ProcessBlock.h
edmodule_mightGet_config.h
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::one::EDAnalyzerBase::callWhenNewProductsRegistered_
std::function< void(BranchDescription const &)> callWhenNewProductsRegistered_
Definition: EDAnalyzerBase.h:124
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:153
edm::SerialTaskQueue
Definition: SerialTaskQueue.h:67
edm::one::EDAnalyzerBase::doBeginJob
void doBeginJob()
Definition: EDAnalyzerBase.cc:74
edm::one::EDAnalyzerBase::doBeginProcessBlock_
virtual void doBeginProcessBlock_(ProcessBlock const &)
Definition: EDAnalyzerBase.cc:156
PreallocationConfiguration.h
edm::one::EDAnalyzerBase::moduleDescription_
ModuleDescription moduleDescription_
Definition: EDAnalyzerBase.h:123
edm::one::EDAnalyzerBase::callWhenNewProductsRegistered
void callWhenNewProductsRegistered(std::function< void(BranchDescription const &)> const &func)
Definition: EDAnalyzerBase.cc:49
edm::RunTransitionInfo
Definition: TransitionInfoTypes.h:64
EventSignalsSentry.h
edm::ProcessBlockPrincipal
Definition: ProcessBlockPrincipal.h:22
edm::one::EDAnalyzerBase::doBeginProcessBlock
void doBeginProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:87
edm::one::EDAnalyzerBase::resourcesAcquirer_
SharedResourcesAcquirer resourcesAcquirer_
Definition: EDAnalyzerBase.h:126
edm::one::EDAnalyzerBase::doBeginRun_
virtual void doBeginRun_(Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:160
edm::ProductRegistry
Definition: ProductRegistry.h:37
edm::FileBlock
Definition: FileBlock.h:20
edm::one::EDAnalyzerBase::doEndProcessBlock
void doEndProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:101
edm::PreallocationConfiguration::numberOfLuminosityBlocks
unsigned int numberOfLuminosityBlocks() const
Definition: PreallocationConfiguration.h:36
edm::one::EDAnalyzerBase::doRespondToOpenInputFile
void doRespondToOpenInputFile(FileBlock const &fb)
Definition: EDAnalyzerBase.cc:148
edm::one::EDAnalyzerBase::doBeginLuminosityBlock_
virtual void doBeginLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:162
edm::one::EDAnalyzerBase::doRespondToCloseInputFile
void doRespondToCloseInputFile(FileBlock const &fb)
Definition: EDAnalyzerBase.cc:152
edm::ProcessBlock::setConsumer
void setConsumer(EDConsumerBase const *iConsumer)
Definition: ProcessBlock.h:53
Service.h
edm::ActivityRegistry
Definition: ActivityRegistry.h:133
Run.h
edm::one::EDAnalyzerBase::beginJob
virtual void beginJob()
Definition: EDAnalyzerBase.h:106
edm::one::EDAnalyzerBase::doBeginLuminosityBlock
void doBeginLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:126
edm::one::EDAnalyzerBase::EDAnalyzerBase
EDAnalyzerBase()
Definition: EDAnalyzerBase.cc:45
edm::Transition::BeginLuminosityBlock
ParameterSetDescription.h
edm::one::EDAnalyzerBase::doAccessInputProcessBlock_
virtual void doAccessInputProcessBlock_(ProcessBlock const &)
Definition: EDAnalyzerBase.cc:157
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::one::EDAnalyzerBase::doPreallocate
void doPreallocate(PreallocationConfiguration const &)
Definition: EDAnalyzerBase.cc:82
edm::one::EDAnalyzerBase::doEndProcessBlock_
virtual void doEndProcessBlock_(ProcessBlock const &)
Definition: EDAnalyzerBase.cc:158
edm::one::EDAnalyzerBase::doEndRun_
virtual void doEndRun_(Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:161
edm::one::EDAnalyzerBase::endJob
virtual void endJob()
Definition: EDAnalyzerBase.h:107
Event.h
edm::LuminosityBlock::setConsumer
void setConsumer(EDConsumerBase const *iConsumer)
Definition: LuminosityBlock.cc:33
edm::one::EDAnalyzerBase::prevalidate
static void prevalidate(ConfigurationDescriptions &descriptions)
Definition: EDAnalyzerBase.cc:171
edm::Service
Definition: Service.h:30
edm::EventSetup
Definition: EventSetup.h:57
edm::one::EDAnalyzerBase::doEndLuminosityBlock_
virtual void doEndLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:163
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
TrackCollections2monitor_cff.func
func
Definition: TrackCollections2monitor_cff.py:359
edm::one::EDAnalyzerBase::doEndRun
void doEndRun(RunTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:117
edm::one::EDAnalyzerBase::createAcquirer
virtual SharedResourcesAcquirer createAcquirer()
Definition: EDAnalyzerBase.cc:66
alignCSCRings.r
r
Definition: alignCSCRings.py:93
edm::PreallocationConfiguration
Definition: PreallocationConfiguration.h:27
edm::EventSignalsSentry
Definition: EventSignalsSentry.h:29
edm::one::EDAnalyzerBase::analyze
virtual void analyze(Event const &, EventSetup const &)=0
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
edm::Transition::EndLuminosityBlock
edm::one::kBaseType
static const std::string kBaseType("EDAnalyzer")
edm::one::EDAnalyzerBase::globalLuminosityBlocksQueue
virtual SerialTaskQueue * globalLuminosityBlocksQueue()
Definition: EDAnalyzerBase.cc:72
edm::EDConsumerBase::esGetTokenIndices
ESProxyIndex const * esGetTokenIndices(edm::Transition iTrans) const
Definition: EDConsumerBase.h:118
edm::Transition::BeginRun
edm::one::EDAnalyzerBase::baseType
static const std::string & baseType()
Definition: EDAnalyzerBase.cc:175
HiBiasedCentrality_cfi.function
function
Definition: HiBiasedCentrality_cfi.py:4
EventSetup.h
edm::one::EDAnalyzerBase::preallocLumis
virtual void preallocLumis(unsigned int)
Definition: EDAnalyzerBase.cc:85
edm::one::EDAnalyzerBase::globalRunsQueue
virtual SerialTaskQueue * globalRunsQueue()
Definition: EDAnalyzerBase.cc:71
edm::BranchDescription
Definition: BranchDescription.h:32
edm::edmodule_mightGet_config
void edmodule_mightGet_config(ConfigurationDescriptions &iDesc)
Definition: edmodule_mightGet_config.cc:36
TransitionInfoTypes.h
edm::one::EDAnalyzerBase::doAccessInputProcessBlock
void doAccessInputProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:94
edm::Event
Definition: Event.h:73
edm::Transition::EndRun
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
edm::ProcessBlock
Definition: ProcessBlock.h:36
benchmark_cfg.fb
fb
Definition: benchmark_cfg.py:14
EDAnalyzerBase.h
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
edm::one::EDAnalyzerBase::fillDescriptions
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: EDAnalyzerBase.cc:165
edm::one::EDAnalyzerBase
Definition: EDAnalyzerBase.h:46
edm::ModuleCallingContext
Definition: ModuleCallingContext.h:29