CMS 3D CMS Logo

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 hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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 22 of file BeamSpotProducer.h.

Member Typedef Documentation

Definition at line 25 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 
21  edm::LogInfo("RecoVertex/BeamSpotProducer")
22  << "Initializing Beam Spot producer " << "\n";
23 
24  //fVerbose=conf.getUntrackedParameter<bool>("verbose", false);
25 
26  produces<reco::BeamSpot>();
27 
28 }
BeamSpotProducer::~BeamSpotProducer ( )
override

destructor

Definition at line 31 of file BeamSpotProducer.cc.

31 {}

Member Function Documentation

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

produce a beam spot class

Definition at line 39 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(), makeMuonMisalignmentScenario::matrix, eostools::move(), edm::ESHandle< T >::product(), edm::Event::put(), and mps_fire::result.

39  {
40 
41  using namespace edm;
42 
43  auto result = std::make_unique<reco::BeamSpot>();
44 
45  reco::BeamSpot aSpot;
46 
47 
48  //typedef math::XYZPoint Point;
49  //enum { dimension = 7 };
50  //typedef math::Error<dimension>::type CovarianceMatrix;
51 
52 
53  //try {
54  edm::LogInfo("RecoVertex/BeamSpotProducer")
55  << "Reconstructing event number: " << iEvent.id() << "\n";
56 
58  iSetup.get<BeamSpotObjectsRcd>().get(beamhandle);
59  const BeamSpotObjects *spotDB = beamhandle.product();
60 
61  // translate from BeamSpotObjects to reco::BeamSpot
62  reco::BeamSpot::Point apoint( spotDB->GetX(), spotDB->GetY(), spotDB->GetZ() );
63 
65  for ( int i=0; i<7; ++i ) {
66  for ( int j=0; j<7; ++j ) {
67  matrix(i,j) = spotDB->GetCovariance(i,j);
68  }
69  }
70 
71  // this assume beam width same in x and y
72  aSpot = reco::BeamSpot( apoint,
73  spotDB->GetSigmaZ(),
74  spotDB->Getdxdz(),
75  spotDB->Getdydz(),
76  spotDB->GetBeamWidthX(),
77  matrix );
78  aSpot.setBeamWidthY( spotDB->GetBeamWidthY() );
79  aSpot.setEmittanceX( spotDB->GetEmittanceX() );
80  aSpot.setEmittanceY( spotDB->GetEmittanceY() );
81  aSpot.setbetaStar( spotDB->GetBetaStar() );
82 
83  //}
84  //
85  //catch (std::exception & err) {
86  // edm::LogInfo("RecoVertex/BeamSpotProducer")
87  // << "Exception during event number: " << iEvent.id()
88  // << "\n" << err.what() << "\n";
89  //}
90 
91  *result = aSpot;
92 
93  iEvent.put(std::move(result));
94 
95 }
double Getdydz() const
get dydz slope, crossing angle in YZ
math::Error< dimension >::type CovarianceMatrix
Definition: BeamSpot.h:31
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
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:29
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:60
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:62
double GetEmittanceY() const
get emittance
T const * product() const
Definition: ESHandle.h:86
def move(src, dest)
Definition: eostools.py:511