CMS 3D CMS Logo

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
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
bool getData(T &iHolder) const
Definition: EventSetup.h:122
Log< level::Warning, true > LogPrint