CMS 3D CMS Logo

Public Member Functions | Private Member Functions

AlcaBeamSpotFromDB Class Reference

#include <AlcaBeamSpotFromDB.h>

Inheritance diagram for AlcaBeamSpotFromDB:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 AlcaBeamSpotFromDB (const edm::ParameterSet &)
 ~AlcaBeamSpotFromDB ()

Private Member Functions

virtual void beginJob ()
virtual void beginLuminosityBlock (edm::LuminosityBlock &lumiSeg, const edm::EventSetup &iSetup)
virtual void endJob ()
virtual void endLuminosityBlock (edm::LuminosityBlock &lumiSeg, const edm::EventSetup &iSetup)
virtual void produce (edm::Event &iEvent, const edm::EventSetup &iSetup)

Detailed Description

_________________________________________________________________ class: AlcaBeamSpotFromDB.h package: RecoVertex/TkAlCaRecoProducers

author: Francisco Yumiceva, Fermilab (yumiceva@fnal.gov)

version

Id:
AlcaBeamSpotFromDB.h,v 1.1 2010/06/21 18:02:19 yumiceva Exp

________________________________________________________________

Definition at line 25 of file AlcaBeamSpotFromDB.h.


Constructor & Destructor Documentation

AlcaBeamSpotFromDB::AlcaBeamSpotFromDB ( const edm::ParameterSet iConfig) [explicit]

_________________________________________________________________ class: AlcaBeamSpotFromDB.cc package: RecoVertex/BeamSpotProducer

author: Francisco Yumiceva, Fermilab (yumiceva@fnal.gov)

version

Id:
AlcaBeamSpotFromDB.cc,v 1.3 2010/07/20 02:58:20 wmtan Exp

________________________________________________________________

Definition at line 33 of file AlcaBeamSpotFromDB.cc.

{

  produces<reco::BeamSpot, edm::InLumi>("alcaBeamSpot");  
}
AlcaBeamSpotFromDB::~AlcaBeamSpotFromDB ( )

Definition at line 40 of file AlcaBeamSpotFromDB.cc.

{
        
}

Member Function Documentation

void AlcaBeamSpotFromDB::beginJob ( void  ) [private, virtual]

Reimplemented from edm::EDProducer.

Definition at line 103 of file AlcaBeamSpotFromDB.cc.

{
}
void AlcaBeamSpotFromDB::beginLuminosityBlock ( edm::LuminosityBlock lumiSeg,
const edm::EventSetup iSetup 
) [private, virtual]

Reimplemented from edm::EDProducer.

Definition at line 52 of file AlcaBeamSpotFromDB.cc.

{}
void AlcaBeamSpotFromDB::endJob ( void  ) [private, virtual]

Reimplemented from edm::EDProducer.

Definition at line 108 of file AlcaBeamSpotFromDB.cc.

                           {
}
void AlcaBeamSpotFromDB::endLuminosityBlock ( edm::LuminosityBlock lumiSeg,
const edm::EventSetup iSetup 
) [private, virtual]

Reimplemented from edm::EDProducer.

Definition at line 56 of file AlcaBeamSpotFromDB.cc.

References align::BeamSpot, gather_cfg::cout, reco::BeamSpot::Fake, edm::EventSetup::get(), BeamSpotObjects::GetBeamType(), BeamSpotObjects::GetBeamWidthX(), BeamSpotObjects::GetBeamWidthY(), BeamSpotObjects::GetBetaStar(), BeamSpotObjects::GetCovariance(), BeamSpotObjects::Getdxdz(), BeamSpotObjects::Getdydz(), BeamSpotObjects::GetEmittanceX(), BeamSpotObjects::GetEmittanceY(), BeamSpotObjects::GetSigmaZ(), BeamSpotObjects::GetX(), BeamSpotObjects::GetY(), BeamSpotObjects::GetZ(), i, j, makeMuonMisalignmentScenario::matrix, edm::ESHandle< T >::product(), edm::LuminosityBlock::put(), query::result, reco::BeamSpot::setBeamWidthY(), reco::BeamSpot::setbetaStar(), reco::BeamSpot::setEmittanceX(), reco::BeamSpot::setEmittanceY(), reco::BeamSpot::setType(), AlCaHLTBitMon_QueryRunRegistry::string, and reco::BeamSpot::Tracker.

{
  // read DB object
  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);
    }
  }
  
  reco::BeamSpot aSpot;
  // 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() );

  if ( spotDB->GetBeamType() == 2 ) {
    aSpot.setType( reco::BeamSpot::Tracker );
  } else{
    aSpot.setType( reco::BeamSpot::Fake );
  }

  std::auto_ptr<reco::BeamSpot> result(new reco::BeamSpot);
  *result = aSpot;
  lumiSeg.put(result, std::string("alcaBeamSpot"));

  //std::cout << " for runs: " << iEvent.id().run() << " - " << iEvent.id().run() << std::endl;
  std::cout << aSpot << std::endl;

}
void AlcaBeamSpotFromDB::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
) [private, virtual]

Implements edm::EDProducer.

Definition at line 46 of file AlcaBeamSpotFromDB.cc.

                                                                             {

}