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::one::EDProducer< edm::EndLuminosityBlockProducer > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 AlcaBeamSpotFromDB (const edm::ParameterSet &)
 
 ~AlcaBeamSpotFromDB ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndLuminosityBlockProducer >
 EDProducer ()=default
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

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

Additional Inherited Members

- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
typedef WorkerT< EDProducerBaseWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::one::EDProducerBase
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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.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 (yumic.nosp@m.eva@.nosp@m.fnal..nosp@m.gov)

version

Id:
AlcaBeamSpotFromDB.cc,v 1.4 2013/05/17 20:25:11 chrjones 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  )
finaloverrideprivatevirtual

Reimplemented from edm::one::EDProducerBase.

Definition at line 98 of file AlcaBeamSpotFromDB.cc.

99 {
100 }
void AlcaBeamSpotFromDB::endJob ( void  )
finaloverrideprivatevirtual

Reimplemented from edm::one::EDProducerBase.

Definition at line 103 of file AlcaBeamSpotFromDB.cc.

103  {
104 }
void AlcaBeamSpotFromDB::endLuminosityBlockProduce ( edm::LuminosityBlock lumiSeg,
const edm::EventSetup iSetup 
)
finaloverrideprivatevirtual

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< class >::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.

52 {
53  // read DB object
55  iSetup.get<BeamSpotObjectsRcd>().get(beamhandle);
56  const BeamSpotObjects *spotDB = beamhandle.product();
57 
58  // translate from BeamSpotObjects to reco::BeamSpot
59  reco::BeamSpot::Point apoint( spotDB->GetX(), spotDB->GetY(), spotDB->GetZ() );
60 
62  for ( int i=0; i<7; ++i ) {
63  for ( int j=0; j<7; ++j ) {
64  matrix(i,j) = spotDB->GetCovariance(i,j);
65  }
66  }
67 
68  reco::BeamSpot aSpot;
69  // this assume beam width same in x and y
70  aSpot = reco::BeamSpot( apoint,
71  spotDB->GetSigmaZ(),
72  spotDB->Getdxdz(),
73  spotDB->Getdydz(),
74  spotDB->GetBeamWidthX(),
75  matrix );
76  aSpot.setBeamWidthY( spotDB->GetBeamWidthY() );
77  aSpot.setEmittanceX( spotDB->GetEmittanceX() );
78  aSpot.setEmittanceY( spotDB->GetEmittanceY() );
79  aSpot.setbetaStar( spotDB->GetBetaStar() );
80 
81  if ( spotDB->GetBeamType() == 2 ) {
83  } else{
85  }
86 
87  std::auto_ptr<reco::BeamSpot> result(new reco::BeamSpot);
88  *result = aSpot;
89  lumiSeg.put(result, std::string("alcaBeamSpot"));
90 
91  //std::cout << " for runs: " << iEvent.id().run() << " - " << iEvent.id().run() << std::endl;
92  std::cout << aSpot << std::endl;
93 
94 }
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 
)
finaloverrideprivatevirtual