CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/RecoVertex/BeamSpotProducer/plugins/BeamSpotFromDB.cc

Go to the documentation of this file.
00001 
00014 // C++ standard
00015 #include <string>
00016 // CMS
00017 #include "DataFormats/BeamSpot/interface/BeamSpot.h"
00018 #include "RecoVertex/BeamSpotProducer/interface/BeamSpotFromDB.h"
00019 
00020 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00021 
00022 #include "FWCore/Framework/interface/MakerMacros.h"
00023 #include "FWCore/ServiceRegistry/interface/Service.h"
00024 
00025 #include "FWCore/Framework/interface/ESHandle.h"
00026 #include "FWCore/Framework/interface/EventSetup.h"
00027 #include "FWCore/Framework/interface/IOVSyncValue.h"
00028 #include "CondFormats/DataRecord/interface/BeamSpotObjectsRcd.h"
00029 #include "CondFormats/BeamSpotObjects/interface/BeamSpotObjects.h"
00030 
00031 
00032 BeamSpotFromDB::BeamSpotFromDB(const edm::ParameterSet& iConfig)
00033 {
00034   
00035 }
00036 
00037 
00038 BeamSpotFromDB::~BeamSpotFromDB()
00039 {
00040         
00041 }
00042 
00043 
00044 void
00045 BeamSpotFromDB::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
00046 {
00047         
00048         edm::ESHandle< BeamSpotObjects > beamhandle;
00049         iSetup.get<BeamSpotObjectsRcd>().get(beamhandle);
00050         const BeamSpotObjects *mybeamspot = beamhandle.product();
00051 
00052         std::cout << " for runs: " << iEvent.id().run() << " - " << iEvent.id().run() << std::endl;
00053         //std::cout << iEvent.getRun().beginTime().value() << std::endl;
00054         //std::cout << iEvent.time().value() << std::endl;
00055         std::cout << *mybeamspot << std::endl;
00056 
00057 }
00058 
00059 void
00060 BeamSpotFromDB::beginJob()
00061 {
00062 }
00063 
00064 void
00065 BeamSpotFromDB::endJob() {
00066 }
00067 
00068 //define this as a plug-in
00069 DEFINE_FWK_MODULE(BeamSpotFromDB);