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) {
56  e.setConsumer(this);
57  e.setSharedResourcesAcquirer(&resourcesAcquirer_);
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
ConfigurationDescriptions.h
ConstProductRegistry.h
edm::SharedResourcesAcquirer
Definition: SharedResourcesAcquirer.h:34
edm::ProductRegistry::callForEachBranch
void callForEachBranch(T const &iFunc)
Definition: ProductRegistry.h:97
edm::one::EDAnalyzerBase::doEndJob
void doEndJob()
Definition: EDAnalyzerBase.cc:78
edm::EventSetupImpl
Definition: EventSetupImpl.h:44
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:45
edm::one::EDAnalyzerBase::registerProductsAndCallbacks
void registerProductsAndCallbacks(EDAnalyzerBase const *module, ProductRegistry *reg)
Definition: EDAnalyzerBase.cc:154
edmodule_mightGet_config.h
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::LuminosityBlockPrincipal
Definition: LuminosityBlockPrincipal.h:31
edm::one::EDAnalyzerBase::callWhenNewProductsRegistered_
std::function< void(BranchDescription const &)> callWhenNewProductsRegistered_
Definition: EDAnalyzerBase.h:122
edm::SerialTaskQueue
Definition: SerialTaskQueue.h:67
edm::one::EDAnalyzerBase::doBeginJob
void doBeginJob()
Definition: EDAnalyzerBase.cc:72
PreallocationConfiguration.h
edm::one::EDAnalyzerBase::moduleDescription_
ModuleDescription moduleDescription_
Definition: EDAnalyzerBase.h:121
edm::one::EDAnalyzerBase::callWhenNewProductsRegistered
void callWhenNewProductsRegistered(std::function< void(BranchDescription const &)> const &func)
Definition: EDAnalyzerBase.cc:47
EventSignalsSentry.h
edm::one::EDAnalyzerBase::doEndRun
void doEndRun(RunPrincipal const &rp, EventSetupImpl const &c, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:94
edm::one::EDAnalyzerBase::resourcesAcquirer_
SharedResourcesAcquirer resourcesAcquirer_
Definition: EDAnalyzerBase.h:124
edm::one::EDAnalyzerBase::doBeginRun_
virtual void doBeginRun_(Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:137
edm::ProductRegistry
Definition: ProductRegistry.h:34
edm::FileBlock
Definition: FileBlock.h:20
edm::PreallocationConfiguration::numberOfLuminosityBlocks
unsigned int numberOfLuminosityBlocks() const
Definition: PreallocationConfiguration.h:36
edm::one::EDAnalyzerBase::doRespondToOpenInputFile
void doRespondToOpenInputFile(FileBlock const &fb)
Definition: EDAnalyzerBase.cc:129
edm::one::EDAnalyzerBase::doBeginLuminosityBlock_
virtual void doBeginLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:139
edm::EventPrincipal
Definition: EventPrincipal.h:46
edm::one::EDAnalyzerBase::doRespondToCloseInputFile
void doRespondToCloseInputFile(FileBlock const &fb)
Definition: EDAnalyzerBase.cc:133
Service.h
edm::ActivityRegistry
Definition: ActivityRegistry.h:132
Run.h
edm::one::EDAnalyzerBase::beginJob
virtual void beginJob()
Definition: EDAnalyzerBase.h:107
edm::one::EDAnalyzerBase::EDAnalyzerBase
EDAnalyzerBase()
Definition: EDAnalyzerBase.cc:43
edm::Transition::BeginLuminosityBlock
ParameterSetDescription.h
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:80
edm::one::EDAnalyzerBase::doEndRun_
virtual void doEndRun_(Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:138
edm::one::EDAnalyzerBase::endJob
virtual void endJob()
Definition: EDAnalyzerBase.h:108
Event.h
edm::LuminosityBlock::setConsumer
void setConsumer(EDConsumerBase const *iConsumer)
Definition: LuminosityBlock.cc:26
edm::one::EDAnalyzerBase::prevalidate
static void prevalidate(ConfigurationDescriptions &descriptions)
Definition: EDAnalyzerBase.cc:148
edm::Service
Definition: Service.h:30
edm::ParameterSetDescription::setUnknown
void setUnknown()
Definition: ParameterSetDescription.cc:39
edm::EventSetup
Definition: EventSetup.h:57
edm::one::EDAnalyzerBase::doEndLuminosityBlock_
virtual void doEndLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:140
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
TrackCollections2monitor_cff.func
func
Definition: TrackCollections2monitor_cff.py:359
edm::one::EDAnalyzerBase::createAcquirer
virtual SharedResourcesAcquirer createAcquirer()
Definition: EDAnalyzerBase.cc:64
alignCSCRings.r
r
Definition: alignCSCRings.py:93
edm::one::EDAnalyzerBase::doEndLuminosityBlock
void doEndLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetupImpl const &c, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:116
edm::PreallocationConfiguration
Definition: PreallocationConfiguration.h:27
edm::EventSignalsSentry
Definition: EventSignalsSentry.h:29
edm::one::EDAnalyzerBase::analyze
virtual void analyze(Event const &, EventSetup const &)=0
edm::one::EDAnalyzerBase::doEvent
bool doEvent(EventPrincipal const &ep, EventSetupImpl const &c, ActivityRegistry *, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:51
edm::Transition::EndLuminosityBlock
edm::one::kBaseType
static const std::string kBaseType("EDAnalyzer")
edm::one::EDAnalyzerBase::globalLuminosityBlocksQueue
virtual SerialTaskQueue * globalLuminosityBlocksQueue()
Definition: EDAnalyzerBase.cc:70
edm::EDConsumerBase::esGetTokenIndices
ESProxyIndex const * esGetTokenIndices(edm::Transition iTrans) const
Definition: EDConsumerBase.h:110
edm::one::EDAnalyzerBase::doBeginRun
void doBeginRun(RunPrincipal const &rp, EventSetupImpl const &c, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:85
edm::Transition::BeginRun
edm::one::EDAnalyzerBase::baseType
static const std::string & baseType()
Definition: EDAnalyzerBase.cc:152
HiBiasedCentrality_cfi.function
function
Definition: HiBiasedCentrality_cfi.py:4
EventSetup.h
edm::one::EDAnalyzerBase::preallocLumis
virtual void preallocLumis(unsigned int)
Definition: EDAnalyzerBase.cc:83
edm::one::EDAnalyzerBase::globalRunsQueue
virtual SerialTaskQueue * globalRunsQueue()
Definition: EDAnalyzerBase.cc:69
edm::BranchDescription
Definition: BranchDescription.h:32
edm::edmodule_mightGet_config
void edmodule_mightGet_config(ConfigurationDescriptions &iDesc)
Definition: edmodule_mightGet_config.cc:36
edm::RunPrincipal
Definition: RunPrincipal.h:34
edm::Event
Definition: Event.h:73
edm::Transition::EndRun
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
edm::one::EDAnalyzerBase::doBeginLuminosityBlock
void doBeginLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetupImpl const &c, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:103
SiStripBadComponentsDQMServiceTemplate_cfg.ep
ep
Definition: SiStripBadComponentsDQMServiceTemplate_cfg.py:86
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:142
edm::one::EDAnalyzerBase
Definition: EDAnalyzerBase.h:47
edm::ModuleCallingContext
Definition: ModuleCallingContext.h:29