RecoVertex
BeamSpotProducer
plugins
BeamSpotFromDB.cc
Go to the documentation of this file.
1
12
// C++ standard
13
#include <string>
14
// CMS
15
#include "
DataFormats/BeamSpot/interface/BeamSpot.h
"
16
#include "
RecoVertex/BeamSpotProducer/interface/BeamSpotFromDB.h
"
17
18
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
19
20
#include "
FWCore/Framework/interface/MakerMacros.h
"
21
#include "
FWCore/ServiceRegistry/interface/Service.h
"
22
23
#include "
FWCore/Framework/interface/ESHandle.h
"
24
#include "
FWCore/Framework/interface/EventSetup.h
"
25
#include "
FWCore/Framework/interface/IOVSyncValue.h
"
26
27
BeamSpotFromDB::BeamSpotFromDB
(
const
edm::ParameterSet
& iConfig)
28
: m_beamToken(
esConsumes
<
BeamSpotObjects
,
BeamSpotObjectsRcd
>()) {}
29
30
BeamSpotFromDB::~BeamSpotFromDB
() {}
31
32
void
BeamSpotFromDB::analyze
(
const
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup) {
33
edm::ESHandle<BeamSpotObjects>
beamhandle = iSetup.
getHandle
(
m_beamToken
);
34
const
BeamSpotObjects
* mybeamspot = beamhandle.
product
();
35
36
std::cout
<<
" for runs: "
<<
iEvent
.id().run() <<
" - "
<<
iEvent
.id().run() << std::endl;
37
//std::cout << iEvent.getRun().beginTime().value() << std::endl;
38
//std::cout << iEvent.time().value() << std::endl;
39
std::cout
<< *mybeamspot << std::endl;
40
}
41
42
void
BeamSpotFromDB::beginJob
() {}
43
44
void
BeamSpotFromDB::endJob
() {}
45
46
//define this as a plug-in
47
DEFINE_FWK_MODULE
(
BeamSpotFromDB
);
edm::ESHandle::product
T const * product() const
Definition:
ESHandle.h:86
BeamSpotFromDB::m_beamToken
edm::ESGetToken< BeamSpotObjects, BeamSpotObjectsRcd > m_beamToken
Definition:
BeamSpotFromDB.h:36
MessageLogger.h
ESHandle.h
BeamSpotFromDB.h
gather_cfg.cout
cout
Definition:
gather_cfg.py:144
BeamSpotFromDB
Definition:
BeamSpotFromDB.h:27
BeamSpotFromDB::BeamSpotFromDB
BeamSpotFromDB(const edm::ParameterSet &)
Definition:
BeamSpotFromDB.cc:27
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
BeamSpot.h
BeamSpotFromDB::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition:
BeamSpotFromDB.cc:32
Service.h
edm::ESHandle
Definition:
DTSurvey.h:22
edm::ParameterSet
Definition:
ParameterSet.h:47
BeamSpotFromDB::endJob
void endJob() override
Definition:
BeamSpotFromDB.cc:44
iEvent
int iEvent
Definition:
GenABIO.cc:224
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition:
EventSetup.h:155
BeamSpotObjectsRcd
Definition:
BeamSpotObjectsRcd.h:24
BeamSpotObjects
Definition:
BeamSpotObjects.h:20
edm::EventSetup
Definition:
EventSetup.h:58
BeamSpotFromDB::beginJob
void beginJob() override
Definition:
BeamSpotFromDB.cc:42
BeamSpotFromDB::~BeamSpotFromDB
~BeamSpotFromDB() override
Definition:
BeamSpotFromDB.cc:30
EventSetup.h
DeDxTools::esConsumes
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition:
DeDxTools.cc:283
edm::Event
Definition:
Event.h:73
IOVSyncValue.h
Generated for CMSSW Reference Manual by
1.8.16