#include <BeamSpotProducer.h>
Public Types | |
typedef std::vector < edm::ParameterSet > | Parameters |
Public Member Functions | |
BeamSpotProducer (const edm::ParameterSet &iConf) | |
constructor | |
virtual void | produce (edm::Event &iEvent, const edm::EventSetup &iSetup) |
produce a beam spot class | |
~BeamSpotProducer () | |
destructor |
_________________________________________________________________ class: BeamSpotProducer.h package: RecoVertex/BeamSpotProducer
author: Francisco Yumiceva, Fermilab (yumiceva@fnal.gov)
version
________________________________________________________________
Definition at line 23 of file BeamSpotProducer.h.
typedef std::vector<edm::ParameterSet> BeamSpotProducer::Parameters |
Definition at line 26 of file BeamSpotProducer.h.
BeamSpotProducer::BeamSpotProducer | ( | const edm::ParameterSet & | iConf | ) | [explicit] |
constructor
Definition at line 19 of file BeamSpotProducer.cc.
{ edm::LogInfo("RecoVertex/BeamSpotProducer") << "Initializing Beam Spot producer " << "\n"; //fVerbose=conf.getUntrackedParameter<bool>("verbose", false); produces<reco::BeamSpot>(); }
BeamSpotProducer::~BeamSpotProducer | ( | ) |
void BeamSpotProducer::produce | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [virtual] |
produce a beam spot class
Implements edm::EDProducer.
Definition at line 39 of file BeamSpotProducer.cc.
References align::BeamSpot, edm::EventSetup::get(), i, edm::EventBase::id(), j, makeMuonMisalignmentScenario::matrix, edm::Event::put(), and query::result.
{ using namespace edm; std::auto_ptr<reco::BeamSpot> result(new reco::BeamSpot); reco::BeamSpot aSpot; //typedef math::XYZPoint Point; //enum { dimension = 7 }; //typedef math::Error<dimension>::type CovarianceMatrix; //try { edm::LogInfo("RecoVertex/BeamSpotProducer") << "Reconstructing event number: " << iEvent.id() << "\n"; edm::ESHandle< BeamSpotObjects > beamhandle; iSetup.get<BeamSpotObjectsRcd>().get(beamhandle); const BeamSpotObjects *spotDB = beamhandle.product(); // translate from BeamSpotObjects to reco::BeamSpot reco::BeamSpot::Point apoint( spotDB->GetX(), spotDB->GetY(), spotDB->GetZ() ); reco::BeamSpot::CovarianceMatrix matrix; for ( int i=0; i<7; ++i ) { for ( int j=0; j<7; ++j ) { matrix(i,j) = spotDB->GetCovariance(i,j); } } // this assume beam width same in x and y aSpot = reco::BeamSpot( apoint, spotDB->GetSigmaZ(), spotDB->Getdxdz(), spotDB->Getdydz(), spotDB->GetBeamWidthX(), matrix ); aSpot.setBeamWidthY( spotDB->GetBeamWidthY() ); aSpot.setEmittanceX( spotDB->GetEmittanceX() ); aSpot.setEmittanceY( spotDB->GetEmittanceY() ); aSpot.setbetaStar( spotDB->GetBetaStar() ); //} // //catch (std::exception & err) { // edm::LogInfo("RecoVertex/BeamSpotProducer") // << "Exception during event number: " << iEvent.id() // << "\n" << err.what() << "\n"; //} *result = aSpot; iEvent.put(result); }