CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions
AlcaBeamSpotFromDB Class Reference

#include <AlcaBeamSpotFromDB.h>

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

Public Member Functions

 AlcaBeamSpotFromDB (const edm::ParameterSet &)
 
 ~AlcaBeamSpotFromDB ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

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)
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description


class: AlcaBeamSpotFromDB.h package: RecoVertex/TkAlCaRecoProducers

author: Francisco Yumiceva, Fermilab (yumic.nosp@m.eva@.nosp@m.fnal..nosp@m.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 (yumic.nosp@m.eva@.nosp@m.fnal..nosp@m.gov)

version

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

Definition at line 33 of file AlcaBeamSpotFromDB.cc.

34 {
35 
36  produces<reco::BeamSpot, edm::InLumi>("alcaBeamSpot");
37 }
AlcaBeamSpotFromDB::~AlcaBeamSpotFromDB ( )

Definition at line 40 of file AlcaBeamSpotFromDB.cc.

41 {
42 
43 }

Member Function Documentation

void AlcaBeamSpotFromDB::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 103 of file AlcaBeamSpotFromDB.cc.

104 {
105 }
void AlcaBeamSpotFromDB::beginLuminosityBlock ( edm::LuminosityBlock lumiSeg,
const edm::EventSetup iSetup 
)
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 52 of file AlcaBeamSpotFromDB.cc.

53 {}
void AlcaBeamSpotFromDB::endJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 108 of file AlcaBeamSpotFromDB.cc.

108  {
109 }
void AlcaBeamSpotFromDB::endLuminosityBlock ( edm::LuminosityBlock lumiSeg,
const edm::EventSetup iSetup 
)
privatevirtual

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< class >::product(), edm::LuminosityBlock::put(), query::result, reco::BeamSpot::setBeamWidthY(), reco::BeamSpot::setbetaStar(), reco::BeamSpot::setEmittanceX(), reco::BeamSpot::setEmittanceY(), reco::BeamSpot::setType(), and reco::BeamSpot::Tracker.

57 {
58  // read DB object
60  iSetup.get<BeamSpotObjectsRcd>().get(beamhandle);
61  const BeamSpotObjects *spotDB = beamhandle.product();
62 
63  // translate from BeamSpotObjects to reco::BeamSpot
64  reco::BeamSpot::Point apoint( spotDB->GetX(), spotDB->GetY(), spotDB->GetZ() );
65 
67  for ( int i=0; i<7; ++i ) {
68  for ( int j=0; j<7; ++j ) {
69  matrix(i,j) = spotDB->GetCovariance(i,j);
70  }
71  }
72 
73  reco::BeamSpot aSpot;
74  // this assume beam width same in x and y
75  aSpot = reco::BeamSpot( apoint,
76  spotDB->GetSigmaZ(),
77  spotDB->Getdxdz(),
78  spotDB->Getdydz(),
79  spotDB->GetBeamWidthX(),
80  matrix );
81  aSpot.setBeamWidthY( spotDB->GetBeamWidthY() );
82  aSpot.setEmittanceX( spotDB->GetEmittanceX() );
83  aSpot.setEmittanceY( spotDB->GetEmittanceY() );
84  aSpot.setbetaStar( spotDB->GetBetaStar() );
85 
86  if ( spotDB->GetBeamType() == 2 ) {
88  } else{
90  }
91 
92  std::auto_ptr<reco::BeamSpot> result(new reco::BeamSpot);
93  *result = aSpot;
94  lumiSeg.put(result, std::string("alcaBeamSpot"));
95 
96  //std::cout << " for runs: " << iEvent.id().run() << " - " << iEvent.id().run() << std::endl;
97  std::cout << aSpot << std::endl;
98 
99 }
double Getdydz() const
get dydz slope, crossing angle in YZ
math::Error< dimension >::type CovarianceMatrix
Definition: BeamSpot.h:32
int i
Definition: DBlmapReader.cc:9
double GetY() const
get Y beam position
void setbetaStar(double v)
Definition: BeamSpot.h:146
double GetSigmaZ() const
get sigma Z, RMS bunch length
double GetBeamWidthX() const
get average transverse beam width
math::XYZPoint Point
point in the space
Definition: BeamSpot.h:30
double GetBeamWidthY() const
get average transverse beam width
double GetEmittanceX() const
get emittance
void setType(BeamType type)
set beam type
Definition: BeamSpot.h:132
void setBeamWidthY(double v)
Definition: BeamSpot.h:110
void setEmittanceY(double v)
Definition: BeamSpot.h:145
int GetBeamType() const
get beam type
tuple result
Definition: query.py:137
int j
Definition: DBlmapReader.cc:9
double GetZ() const
get Z beam position
double Getdxdz() const
get dxdz slope, crossing angle in XZ
double GetX() const
get X beam position
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
double GetBetaStar() const
get beta star
double GetCovariance(int i, int j) const
get i,j element of the full covariance matrix 7x7
tuple cout
Definition: gather_cfg.py:121
double GetEmittanceY() const
get emittance
void setEmittanceX(double v)
Definition: BeamSpot.h:144
void put(std::auto_ptr< PROD > product)
Put a new product.
void AlcaBeamSpotFromDB::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual