CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
BeamSpotProducer Class Reference

#include <BeamSpotProducer.h>

Inheritance diagram for BeamSpotProducer:
edm::stream::EDProducer<>

Public Types

typedef std::vector< edm::ParameterSetParameters
 
- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Public Member Functions

 BeamSpotProducer (const edm::ParameterSet &iConf)
 constructor More...
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 produce a beam spot class More...
 
 ~BeamSpotProducer () override
 destructor More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Attributes

edm::ESGetToken< BeamSpotObjects, BeamSpotObjectsRcdm_beamToken
 

Detailed Description


class: BeamSpotProducer.h package: RecoVertex/BeamSpotProducer

author: Francisco Yumiceva, Fermilab (yumic.nosp@m.eva@.nosp@m.fnal..nosp@m.gov)


Definition at line 25 of file BeamSpotProducer.h.

Member Typedef Documentation

◆ Parameters

Definition at line 27 of file BeamSpotProducer.h.

Constructor & Destructor Documentation

◆ BeamSpotProducer()

BeamSpotProducer::BeamSpotProducer ( const edm::ParameterSet iConf)
explicit

constructor

Definition at line 17 of file BeamSpotProducer.cc.

17  {
18  edm::LogInfo("RecoVertex/BeamSpotProducer") << "Initializing Beam Spot producer "
19  << "\n";
20 
21  //fVerbose=conf.getUntrackedParameter<bool>("verbose", false);
22  m_beamToken = esConsumes<BeamSpotObjects, BeamSpotObjectsRcd>();
23 
24  produces<reco::BeamSpot>();
25 }

References m_beamToken.

◆ ~BeamSpotProducer()

BeamSpotProducer::~BeamSpotProducer ( )
override

destructor

Definition at line 27 of file BeamSpotProducer.cc.

27 {}

Member Function Documentation

◆ produce()

void BeamSpotProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

produce a beam spot class

Definition at line 34 of file BeamSpotProducer.cc.

34  {
35  using namespace edm;
36 
37  auto result = std::make_unique<reco::BeamSpot>();
38 
39  reco::BeamSpot aSpot;
40 
41  //typedef math::XYZPoint Point;
42  //enum { dimension = 7 };
43  //typedef math::Error<dimension>::type CovarianceMatrix;
44 
45  //try {
46  edm::LogInfo("RecoVertex/BeamSpotProducer") << "Reconstructing event number: " << iEvent.id() << "\n";
47 
49  const BeamSpotObjects* spotDB = beamhandle.product();
50 
51  // translate from BeamSpotObjects to reco::BeamSpot
52  reco::BeamSpot::Point apoint(spotDB->GetX(), spotDB->GetY(), spotDB->GetZ());
53 
55  for (int i = 0; i < 7; ++i) {
56  for (int j = 0; j < 7; ++j) {
57  matrix(i, j) = spotDB->GetCovariance(i, j);
58  }
59  }
60 
61  // this assume beam width same in x and y
62  aSpot = reco::BeamSpot(
63  apoint, spotDB->GetSigmaZ(), spotDB->Getdxdz(), spotDB->Getdydz(), spotDB->GetBeamWidthX(), matrix);
64  aSpot.setBeamWidthY(spotDB->GetBeamWidthY());
65  aSpot.setEmittanceX(spotDB->GetEmittanceX());
66  aSpot.setEmittanceY(spotDB->GetEmittanceY());
67  aSpot.setbetaStar(spotDB->GetBetaStar());
68 
69  //}
70  //
71  //catch (std::exception & err) {
72  // edm::LogInfo("RecoVertex/BeamSpotProducer")
73  // << "Exception during event number: " << iEvent.id()
74  // << "\n" << err.what() << "\n";
75  //}
76 
77  *result = aSpot;
78 
79  iEvent.put(std::move(result));
80 }

References align::BeamSpot, BeamSpotObjects::GetBeamWidthX(), BeamSpotObjects::GetBeamWidthY(), BeamSpotObjects::GetBetaStar(), BeamSpotObjects::GetCovariance(), BeamSpotObjects::Getdxdz(), BeamSpotObjects::Getdydz(), BeamSpotObjects::GetEmittanceX(), BeamSpotObjects::GetEmittanceY(), edm::EventSetup::getHandle(), BeamSpotObjects::GetSigmaZ(), BeamSpotObjects::GetX(), BeamSpotObjects::GetY(), BeamSpotObjects::GetZ(), mps_fire::i, iEvent, dqmiolumiharvest::j, m_beamToken, makeMuonMisalignmentScenario::matrix, eostools::move(), edm::ESHandle< T >::product(), mps_fire::result, reco::BeamSpot::setBeamWidthY(), reco::BeamSpot::setbetaStar(), reco::BeamSpot::setEmittanceX(), and reco::BeamSpot::setEmittanceY().

Member Data Documentation

◆ m_beamToken

edm::ESGetToken<BeamSpotObjects, BeamSpotObjectsRcd> BeamSpotProducer::m_beamToken
private

Definition at line 38 of file BeamSpotProducer.h.

Referenced by BeamSpotProducer(), and produce().

edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
BeamSpotObjects::GetBeamWidthY
double GetBeamWidthY() const
get average transverse beam width
Definition: BeamSpotObjects.h:77
BeamSpotObjects::Getdxdz
double Getdxdz() const
get dxdz slope, crossing angle in XZ
Definition: BeamSpotObjects.h:79
mps_fire.i
i
Definition: mps_fire.py:428
reco::BeamSpot::setBeamWidthY
void setBeamWidthY(double v)
Definition: BeamSpot.h:105
makeMuonMisalignmentScenario.matrix
list matrix
Definition: makeMuonMisalignmentScenario.py:141
reco::BeamSpot::setEmittanceY
void setEmittanceY(double v)
Definition: BeamSpot.h:137
align::BeamSpot
Definition: StructureType.h:89
BeamSpotProducer::m_beamToken
edm::ESGetToken< BeamSpotObjects, BeamSpotObjectsRcd > m_beamToken
Definition: BeamSpotProducer.h:38
BeamSpotObjects::GetSigmaZ
double GetSigmaZ() const
get sigma Z, RMS bunch length
Definition: BeamSpotObjects.h:73
edm
HLT enums.
Definition: AlignableModifier.h:19
BeamSpotObjects::GetZ
double GetZ() const
get Z beam position
Definition: BeamSpotObjects.h:71
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
reco::BeamSpot
Definition: BeamSpot.h:21
edm::ESHandle
Definition: DTSurvey.h:22
BeamSpotObjects::GetCovariance
double GetCovariance(int i, int j) const
get i,j element of the full covariance matrix 7x7
Definition: BeamSpotObjects.h:83
reco::BeamSpot::setEmittanceX
void setEmittanceX(double v)
Definition: BeamSpot.h:136
BeamSpotObjects::GetBetaStar
double GetBetaStar() const
get beta star
Definition: BeamSpotObjects.h:107
BeamSpotObjects::GetEmittanceX
double GetEmittanceX() const
get emittance
Definition: BeamSpotObjects.h:103
BeamSpotObjects::GetY
double GetY() const
get Y beam position
Definition: BeamSpotObjects.h:69
reco::BeamSpot::setbetaStar
void setbetaStar(double v)
Definition: BeamSpot.h:138
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:148
BeamSpotObjects
Definition: BeamSpotObjects.h:20
reco::BeamSpot::CovarianceMatrix
math::Error< dimension >::type CovarianceMatrix
Definition: BeamSpot.h:29
BeamSpotObjects::GetBeamWidthX
double GetBeamWidthX() const
get average transverse beam width
Definition: BeamSpotObjects.h:75
eostools.move
def move(src, dest)
Definition: eostools.py:511
BeamSpotObjects::GetEmittanceY
double GetEmittanceY() const
get emittance
Definition: BeamSpotObjects.h:105
BeamSpotObjects::Getdydz
double Getdydz() const
get dydz slope, crossing angle in YZ
Definition: BeamSpotObjects.h:81
mps_fire.result
result
Definition: mps_fire.py:311
reco::BeamSpot::Point
math::XYZPoint Point
point in the space
Definition: BeamSpot.h:27
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
BeamSpotObjects::GetX
double GetX() const
get X beam position
Definition: BeamSpotObjects.h:67