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<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

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 Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

 BeamSpotProducer (const edm::ParameterSet &iConf)
 constructor More...
 
virtual void produce (edm::Event &iEvent, const edm::EventSetup &iSetup)
 produce a beam spot class More...
 
 ~BeamSpotProducer ()
 destructor More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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: 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 ( )

destructor

Definition at line 31 of file BeamSpotProducer.cc.

31 {}

Member Function Documentation

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

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:122
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
const T & get() const
Definition: EventSetup.h:56
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.
double GetEmittanceY() const
get emittance
T const * product() const
Definition: ESHandle.h:86
def move(src, dest)
Definition: eostools.py:510