CMS 3D CMS Logo

Public Member Functions | Private Member Functions

AlcaBeamSpotFromDB Class Reference

#include <AlcaBeamSpotFromDB.h>

Inheritance diagram for AlcaBeamSpotFromDB:
edm::one::EDProducer< edm::EndLuminosityBlockProducer > Type edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

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

Private Member Functions

virtual void beginJob () override final
virtual void endJob () override final
virtual void endLuminosityBlockProduce (edm::LuminosityBlock &lumiSeg, const edm::EventSetup &iSetup) override final
virtual void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override final

Detailed Description

_________________________________________________________________ class: AlcaBeamSpotFromDB.h package: RecoVertex/TkAlCaRecoProducers

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

version

Id:
AlcaBeamSpotFromDB.h,v 1.2 2013/05/17 20:25:10 chrjones 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.4 2013/05/17 20:25:11 chrjones 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  ) [override, private, virtual]

Reimplemented from edm::one::EDProducerBase.

Definition at line 98 of file AlcaBeamSpotFromDB.cc.

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

Reimplemented from edm::one::EDProducerBase.

Definition at line 103 of file AlcaBeamSpotFromDB.cc.

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

Definition at line 51 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 
) [override, private, virtual]

Implements edm::one::EDProducerBase.

Definition at line 46 of file AlcaBeamSpotFromDB.cc.

                                                                             {

}