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

Public Types

typedef std::vector
< edm::ParameterSet
Parameters
 
- 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, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
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)
 
 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
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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

Implements edm::stream::EDProducerBase.

Definition at line 39 of file BeamSpotProducer.cc.

References align::BeamSpot, edm::EventSetup::get(), i, edm::EventBase::id(), j, makeMuonMisalignmentScenario::matrix, edm::Event::put(), and mps_fire::result.

39  {
40 
41  using namespace edm;
42 
43  std::auto_ptr<reco::BeamSpot> result(new 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(result);
94 
95 }
math::Error< dimension >::type CovarianceMatrix
Definition: BeamSpot.h:31
int i
Definition: DBlmapReader.cc:9
math::XYZPoint Point
point in the space
Definition: BeamSpot.h:29
tuple result
Definition: mps_fire.py:84
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
int j
Definition: DBlmapReader.cc:9
const T & get() const
Definition: EventSetup.h:56
edm::EventID id() const
Definition: EventBase.h:59