CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions
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 hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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 21 of file BeamSpotProducer.h.

Member Typedef Documentation

Definition at line 23 of file BeamSpotProducer.h.

Constructor & Destructor Documentation

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

constructor

Definition at line 19 of file BeamSpotProducer.cc.

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

destructor

Definition at line 28 of file BeamSpotProducer.cc.

28 {}

Member Function Documentation

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

produce a beam spot class

Definition at line 35 of file BeamSpotProducer.cc.

References align::BeamSpot, DEFINE_FWK_MODULE, edm::EventSetup::get(), BeamSpotObjects::GetBeamWidthX(), BeamSpotObjects::GetBeamWidthY(), BeamSpotObjects::GetBetaStar(), BeamSpotObjects::GetCovariance(), BeamSpotObjects::Getdxdz(), BeamSpotObjects::Getdydz(), BeamSpotObjects::GetEmittanceX(), BeamSpotObjects::GetEmittanceY(), BeamSpotObjects::GetSigmaZ(), BeamSpotObjects::GetX(), BeamSpotObjects::GetY(), BeamSpotObjects::GetZ(), mps_fire::i, edm::EventBase::id(), dqmiolumiharvest::j, makeMuonMisalignmentScenario::matrix, eostools::move(), edm::ESHandle< T >::product(), edm::Event::put(), and mps_fire::result.

35  {
36  using namespace edm;
37 
38  auto result = std::make_unique<reco::BeamSpot>();
39 
40  reco::BeamSpot aSpot;
41 
42  //typedef math::XYZPoint Point;
43  //enum { dimension = 7 };
44  //typedef math::Error<dimension>::type CovarianceMatrix;
45 
46  //try {
47  edm::LogInfo("RecoVertex/BeamSpotProducer") << "Reconstructing event number: " << iEvent.id() << "\n";
48 
50  iSetup.get<BeamSpotObjectsRcd>().get(beamhandle);
51  const BeamSpotObjects* spotDB = beamhandle.product();
52 
53  // translate from BeamSpotObjects to reco::BeamSpot
54  reco::BeamSpot::Point apoint(spotDB->GetX(), spotDB->GetY(), spotDB->GetZ());
55 
57  for (int i = 0; i < 7; ++i) {
58  for (int j = 0; j < 7; ++j) {
59  matrix(i, j) = spotDB->GetCovariance(i, j);
60  }
61  }
62 
63  // this assume beam width same in x and y
64  aSpot = reco::BeamSpot(
65  apoint, spotDB->GetSigmaZ(), spotDB->Getdxdz(), spotDB->Getdydz(), spotDB->GetBeamWidthX(), matrix);
66  aSpot.setBeamWidthY(spotDB->GetBeamWidthY());
67  aSpot.setEmittanceX(spotDB->GetEmittanceX());
68  aSpot.setEmittanceY(spotDB->GetEmittanceY());
69  aSpot.setbetaStar(spotDB->GetBetaStar());
70 
71  //}
72  //
73  //catch (std::exception & err) {
74  // edm::LogInfo("RecoVertex/BeamSpotProducer")
75  // << "Exception during event number: " << iEvent.id()
76  // << "\n" << err.what() << "\n";
77  //}
78 
79  *result = aSpot;
80 
81  iEvent.put(std::move(result));
82 }
double Getdydz() const
get dydz slope, crossing angle in YZ
math::Error< dimension >::type CovarianceMatrix
Definition: BeamSpot.h:29
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
double GetY() const
get Y beam position
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:27
double GetBeamWidthY() const
get average transverse beam width
double GetEmittanceX() const
get emittance
double GetZ() const
get Z beam position
double Getdxdz() const
get dxdz slope, crossing angle in XZ
double GetX() const
get X beam position
double GetBetaStar() const
get beta star
edm::EventID id() const
Definition: EventBase.h:59
double GetCovariance(int i, int j) const
get i,j element of the full covariance matrix 7x7
HLT enums.
T get() const
Definition: EventSetup.h:73
double GetEmittanceY() const
get emittance
T const * product() const
Definition: ESHandle.h:86
def move(src, dest)
Definition: eostools.py:511