CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
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
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () 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
 
std::vector< bool > const & recordProvenanceList () 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)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
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
 

Private Attributes

const edm::ESGetToken< BeamSpotObjects, BeamSpotObjectsRcdbeamSpotToken_
 

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::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (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 25 of file AlcaBeamSpotFromDB.h.

Constructor & Destructor Documentation

◆ AlcaBeamSpotFromDB()

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 26 of file AlcaBeamSpotFromDB.cc.

27  : beamSpotToken_(esConsumes<BeamSpotObjects, BeamSpotObjectsRcd, edm::Transition::EndLuminosityBlock>()) {
28  produces<reco::BeamSpot, edm::Transition::EndLuminosityBlock>("alcaBeamSpot");
29 }

◆ ~AlcaBeamSpotFromDB()

AlcaBeamSpotFromDB::~AlcaBeamSpotFromDB ( )
override

Definition at line 31 of file AlcaBeamSpotFromDB.cc.

31 {}

Member Function Documentation

◆ beginJob()

void AlcaBeamSpotFromDB::beginJob ( void  )
finalprivatevirtual

Reimplemented from edm::one::EDProducerBase.

Definition at line 75 of file AlcaBeamSpotFromDB.cc.

75 {}

◆ endJob()

void AlcaBeamSpotFromDB::endJob ( void  )
finalprivatevirtual

Reimplemented from edm::one::EDProducerBase.

Definition at line 77 of file AlcaBeamSpotFromDB.cc.

77 {}

Referenced by o2olib.O2ORunMgr::executeJob().

◆ endLuminosityBlockProduce()

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

Definition at line 37 of file AlcaBeamSpotFromDB.cc.

37  {
38  // read DB object
39  const BeamSpotObjects *spotDB = &iSetup.getData(beamSpotToken_);
40 
41  // translate from BeamSpotObjects to reco::BeamSpot
42  reco::BeamSpot::Point apoint(spotDB->GetX(), spotDB->GetY(), spotDB->GetZ());
43 
45  for (int i = 0; i < 7; ++i) {
46  for (int j = 0; j < 7; ++j) {
47  matrix(i, j) = spotDB->GetCovariance(i, j);
48  }
49  }
50 
51  reco::BeamSpot aSpot;
52  // this assume beam width same in x and y
53  aSpot = reco::BeamSpot(
54  apoint, spotDB->GetSigmaZ(), spotDB->Getdxdz(), spotDB->Getdydz(), spotDB->GetBeamWidthX(), matrix);
55  aSpot.setBeamWidthY(spotDB->GetBeamWidthY());
56  aSpot.setEmittanceX(spotDB->GetEmittanceX());
57  aSpot.setEmittanceY(spotDB->GetEmittanceY());
58  aSpot.setbetaStar(spotDB->GetBetaStar());
59 
60  if (spotDB->GetBeamType() == 2) {
62  } else {
64  }
65 
66  auto result = std::make_unique<reco::BeamSpot>();
67  *result = aSpot;
68  lumiSeg.put(std::move(result), std::string("alcaBeamSpot"));
69 
70  // std::cout << " for runs: " << iEvent.id().run() << " - " <<
71  // iEvent.id().run() << std::endl;
72  std::cout << aSpot << std::endl;
73 }

References align::BeamSpot, beamSpotToken_, gather_cfg::cout, reco::BeamSpot::Fake, BeamSpotObjects::GetBeamType(), BeamSpotObjects::GetBeamWidthX(), BeamSpotObjects::GetBeamWidthY(), BeamSpotObjects::GetBetaStar(), BeamSpotObjects::GetCovariance(), edm::EventSetup::getData(), BeamSpotObjects::Getdxdz(), BeamSpotObjects::Getdydz(), BeamSpotObjects::GetEmittanceX(), BeamSpotObjects::GetEmittanceY(), BeamSpotObjects::GetSigmaZ(), BeamSpotObjects::GetX(), BeamSpotObjects::GetY(), BeamSpotObjects::GetZ(), mps_fire::i, dqmiolumiharvest::j, makeMuonMisalignmentScenario::matrix, eostools::move(), 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.

◆ produce()

void AlcaBeamSpotFromDB::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
finalprivatevirtual

Implements edm::one::EDProducerBase.

Definition at line 34 of file AlcaBeamSpotFromDB.cc.

34 {}

Member Data Documentation

◆ beamSpotToken_

const edm::ESGetToken<BeamSpotObjects, BeamSpotObjectsRcd> AlcaBeamSpotFromDB::beamSpotToken_
private

Definition at line 31 of file AlcaBeamSpotFromDB.h.

Referenced by endLuminosityBlockProduce().

BeamSpotObjects::GetBeamWidthY
double GetBeamWidthY() const
get average transverse beam width
Definition: BeamSpotObjects.h:77
BeamSpotObjects::Getdxdz
double Getdxdz() const
get dxdz slope, crossing angle in XZ
Definition: BeamSpotObjects.h:79
mps_fire.i
i
Definition: mps_fire.py:428
reco::BeamSpot::setBeamWidthY
void setBeamWidthY(double v)
Definition: BeamSpot.h:105
makeMuonMisalignmentScenario.matrix
list matrix
Definition: makeMuonMisalignmentScenario.py:141
reco::BeamSpot::setEmittanceY
void setEmittanceY(double v)
Definition: BeamSpot.h:137
align::BeamSpot
Definition: StructureType.h:95
BeamSpotObjects::GetSigmaZ
double GetSigmaZ() const
get sigma Z, RMS bunch length
Definition: BeamSpotObjects.h:73
gather_cfg.cout
cout
Definition: gather_cfg.py:144
BeamSpotObjects::GetBeamType
int GetBeamType() const
get beam type
Definition: BeamSpotObjects.h:101
BeamSpotObjects::GetZ
double GetZ() const
get Z beam position
Definition: BeamSpotObjects.h:71
reco::BeamSpot
Definition: BeamSpot.h:21
reco::BeamSpot::Tracker
Definition: BeamSpot.h:24
BeamSpotObjects::GetCovariance
double GetCovariance(int i, int j) const
get i,j element of the full covariance matrix 7x7
Definition: BeamSpotObjects.h:83
reco::BeamSpot::Fake
Definition: BeamSpot.h:24
reco::BeamSpot::setEmittanceX
void setEmittanceX(double v)
Definition: BeamSpot.h:136
BeamSpotObjects::GetBetaStar
double GetBetaStar() const
get beta star
Definition: BeamSpotObjects.h:107
BeamSpotObjects::GetEmittanceX
double GetEmittanceX() const
get emittance
Definition: BeamSpotObjects.h:103
BeamSpotObjects::GetY
double GetY() const
get Y beam position
Definition: BeamSpotObjects.h:69
reco::BeamSpot::setbetaStar
void setbetaStar(double v)
Definition: BeamSpot.h:138
BeamSpotObjects
Definition: BeamSpotObjects.h:20
reco::BeamSpot::CovarianceMatrix
math::Error< dimension >::type CovarianceMatrix
Definition: BeamSpot.h:29
edm::LuminosityBlock::put
void put(std::unique_ptr< PROD > product)
Put a new product.
Definition: LuminosityBlock.h:116
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
BeamSpotObjects::GetBeamWidthX
double GetBeamWidthX() const
get average transverse beam width
Definition: BeamSpotObjects.h:75
eostools.move
def move(src, dest)
Definition: eostools.py:511
BeamSpotObjects::GetEmittanceY
double GetEmittanceY() const
get emittance
Definition: BeamSpotObjects.h:105
BeamSpotObjects::Getdydz
double Getdydz() const
get dydz slope, crossing angle in YZ
Definition: BeamSpotObjects.h:81
mps_fire.result
result
Definition: mps_fire.py:311
reco::BeamSpot::Point
math::XYZPoint Point
point in the space
Definition: BeamSpot.h:27
reco::BeamSpot::setType
void setType(BeamType type)
set beam type
Definition: BeamSpot.h:124
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
AlcaBeamSpotFromDB::beamSpotToken_
const edm::ESGetToken< BeamSpotObjects, BeamSpotObjectsRcd > beamSpotToken_
Definition: AlcaBeamSpotFromDB.h:31
BeamSpotObjects::GetX
double GetX() const
get X beam position
Definition: BeamSpotObjects.h:67