CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
BeamSpotFromDB.cc
Go to the documentation of this file.
1 
8 // C++ standard
9 #include <string>
10 
11 // CMS
24 
26 public:
27  explicit BeamSpotFromDB(const edm::ParameterSet&);
28  ~BeamSpotFromDB() override;
29 
30 private:
31  void analyze(const edm::Event&, const edm::EventSetup&) override;
33 };
34 
36  : m_beamToken(esConsumes<BeamSpotObjects, BeamSpotObjectsRcd>()) {}
37 
39 
41  const BeamSpotObjects* mybeamspot = &iSetup.getData(m_beamToken);
42  edm::LogPrint("BeamSpotFromDB") << " for runs: " << iEvent.id().run() << " - " << iEvent.id().run();
43  //edm::LogPrint("BeamSpotFromDB") << iEvent.getRun().beginTime().value();
44  //edm::LogPrint("BeamSpotFromDB") << iEvent.time().value();
45  edm::LogPrint("BeamSpotFromDB") << *mybeamspot;
46 }
47 
48 //define this as a plug-in
void analyze(const edm::Event &, const edm::EventSetup &) override
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
BeamSpotFromDB(const edm::ParameterSet &)
~BeamSpotFromDB() override
int iEvent
Definition: GenABIO.cc:224
edm::ESGetToken< BeamSpotObjects, BeamSpotObjectsRcd > m_beamToken
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
Log< level::Warning, true > LogPrint