CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions
AlcaBeamSpotFromDB Class Reference

#include <AlcaBeamSpotFromDB.h>

Inheritance diagram for AlcaBeamSpotFromDB:
edm::one::EDProducer< edm::EndLuminosityBlockProducer > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 AlcaBeamSpotFromDB (const edm::ParameterSet &)
 
 ~AlcaBeamSpotFromDB () override
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndLuminosityBlockProducer >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- 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 ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
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, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void beginJob () final
 
void endJob () final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumiSeg, const edm::EventSetup &iSetup) final
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) final
 

Additional Inherited Members

- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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: AlcaBeamSpotFromDB.h package: RecoVertex/TkAlCaRecoProducers

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


Definition at line 23 of file AlcaBeamSpotFromDB.h.

Constructor & Destructor Documentation

AlcaBeamSpotFromDB::AlcaBeamSpotFromDB ( const edm::ParameterSet iConfig)
explicit

class: AlcaBeamSpotFromDB.cc package: RecoVertex/BeamSpotProducer

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


Definition at line 30 of file AlcaBeamSpotFromDB.cc.

30  {
31  produces<reco::BeamSpot, edm::Transition::EndLuminosityBlock>("alcaBeamSpot");
32 }
AlcaBeamSpotFromDB::~AlcaBeamSpotFromDB ( )
override

Definition at line 34 of file AlcaBeamSpotFromDB.cc.

34 {}

Member Function Documentation

void AlcaBeamSpotFromDB::beginJob ( void  )
finalprivatevirtual

Reimplemented from edm::one::EDProducerBase.

Definition at line 80 of file AlcaBeamSpotFromDB.cc.

80 {}
void AlcaBeamSpotFromDB::endJob ( void  )
finalprivatevirtual

Reimplemented from edm::one::EDProducerBase.

Definition at line 82 of file AlcaBeamSpotFromDB.cc.

References DEFINE_FWK_MODULE.

Referenced by o2olib.O2ORunMgr::executeJob().

82 {}
void AlcaBeamSpotFromDB::endLuminosityBlockProduce ( edm::LuminosityBlock lumiSeg,
const edm::EventSetup iSetup 
)
finalprivate

Definition at line 40 of file AlcaBeamSpotFromDB.cc.

References align::BeamSpot, gather_cfg::cout, reco::BeamSpot::Fake, edm::EventSetup::get(), BeamSpotObjects::GetBeamType(), 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, makeMuonMisalignmentScenario::matrix, eostools::move(), edm::ESHandle< T >::product(), edm::LuminosityBlock::put(), mps_fire::result, reco::BeamSpot::setBeamWidthY(), reco::BeamSpot::setbetaStar(), reco::BeamSpot::setEmittanceX(), reco::BeamSpot::setEmittanceY(), reco::BeamSpot::setType(), AlCaHLTBitMon_QueryRunRegistry::string, and reco::BeamSpot::Tracker.

40  {
41  // read DB object
43  iSetup.get<BeamSpotObjectsRcd>().get(beamhandle);
44  const BeamSpotObjects *spotDB = beamhandle.product();
45 
46  // translate from BeamSpotObjects to reco::BeamSpot
47  reco::BeamSpot::Point apoint(spotDB->GetX(), spotDB->GetY(), spotDB->GetZ());
48 
50  for (int i = 0; i < 7; ++i) {
51  for (int j = 0; j < 7; ++j) {
52  matrix(i, j) = spotDB->GetCovariance(i, j);
53  }
54  }
55 
56  reco::BeamSpot aSpot;
57  // this assume beam width same in x and y
58  aSpot = reco::BeamSpot(
59  apoint, spotDB->GetSigmaZ(), spotDB->Getdxdz(), spotDB->Getdydz(), spotDB->GetBeamWidthX(), matrix);
60  aSpot.setBeamWidthY(spotDB->GetBeamWidthY());
61  aSpot.setEmittanceX(spotDB->GetEmittanceX());
62  aSpot.setEmittanceY(spotDB->GetEmittanceY());
63  aSpot.setbetaStar(spotDB->GetBetaStar());
64 
65  if (spotDB->GetBeamType() == 2) {
67  } else {
69  }
70 
71  auto result = std::make_unique<reco::BeamSpot>();
72  *result = aSpot;
73  lumiSeg.put(std::move(result), std::string("alcaBeamSpot"));
74 
75  // std::cout << " for runs: " << iEvent.id().run() << " - " <<
76  // iEvent.id().run() << std::endl;
77  std::cout << aSpot << std::endl;
78 }
double Getdydz() const
get dydz slope, crossing angle in YZ
math::Error< dimension >::type CovarianceMatrix
Definition: BeamSpot.h:31
double GetY() const
get Y beam position
void setbetaStar(double v)
Definition: BeamSpot.h:145
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
void setType(BeamType type)
set beam type
Definition: BeamSpot.h:131
void setBeamWidthY(double v)
Definition: BeamSpot.h:109
void setEmittanceY(double v)
Definition: BeamSpot.h:144
int GetBeamType() const
get beam type
void put(std::unique_ptr< PROD > product)
Put a new product.
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
double GetCovariance(int i, int j) const
get i,j element of the full covariance matrix 7x7
T get() const
Definition: EventSetup.h:71
double GetEmittanceY() const
get emittance
void setEmittanceX(double v)
Definition: BeamSpot.h:143
T const * product() const
Definition: ESHandle.h:86
def move(src, dest)
Definition: eostools.py:511
void AlcaBeamSpotFromDB::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
finalprivate