CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
CTPPSBeamParametersFromLHCInfoESSource Class Reference
Inheritance diagram for CTPPSBeamParametersFromLHCInfoESSource:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Member Functions

 CTPPSBeamParametersFromLHCInfoESSource (const edm::ParameterSet &)
 
std::unique_ptr< CTPPSBeamParametersproduce (const CTPPSBeamParametersRcd &)
 
 ~CTPPSBeamParametersFromLHCInfoESSource () override=default
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProducer const & operator= (const ESProducer &)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESProxyIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
 ESProxyFactoryProducer (const ESProxyFactoryProducer &)=delete
 
const ESProxyFactoryProduceroperator= (const ESProxyFactoryProducer &)=delete
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
void createKeyedProxies (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
 DataProxyProvider ()
 
 DataProxyProvider (const DataProxyProvider &)=delete
 
const ComponentDescriptiondescription () const
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const DataProxyProvideroperator= (const DataProxyProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 

Private Attributes

CTPPSBeamParameters defaultParameters_
 
const edm::ESGetToken< LHCInfo, LHCInfoRcdlhcInfoToken_
 

Additional Inherited Members

- Protected Types inherited from edm::ESProxyFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::DataProxyProvider
using KeyedProxiesVector = std::vector< std::pair< DataKey, std::shared_ptr< DataProxy > >>
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
ESConsumesCollectorT< TRecord > setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel={})
 
void usesResources (std::vector< std::string > const &)
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedProxiesVector registerProxies (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 

Detailed Description

Definition at line 25 of file CTPPSBeamParametersFromLHCInfoESSource.cc.

Constructor & Destructor Documentation

◆ CTPPSBeamParametersFromLHCInfoESSource()

CTPPSBeamParametersFromLHCInfoESSource::CTPPSBeamParametersFromLHCInfoESSource ( const edm::ParameterSet iConfig)

Definition at line 41 of file CTPPSBeamParametersFromLHCInfoESSource.cc.

42  : lhcInfoToken_(
43  setWhatProduced(this).consumes(edm::ESInputTag("", iConfig.getParameter<std::string>("lhcInfoLabel")))) {
44  defaultParameters_.setBeamDivergenceX45(iConfig.getParameter<double>("beamDivX45"));
45  defaultParameters_.setBeamDivergenceY45(iConfig.getParameter<double>("beamDivX56"));
46  defaultParameters_.setBeamDivergenceX56(iConfig.getParameter<double>("beamDivY45"));
47  defaultParameters_.setBeamDivergenceY56(iConfig.getParameter<double>("beamDivY56"));
48 
49  defaultParameters_.setVtxOffsetX45(iConfig.getParameter<double>("vtxOffsetX45"));
50  defaultParameters_.setVtxOffsetY45(iConfig.getParameter<double>("vtxOffsetY45"));
51  defaultParameters_.setVtxOffsetZ45(iConfig.getParameter<double>("vtxOffsetZ45"));
52  defaultParameters_.setVtxOffsetX56(iConfig.getParameter<double>("vtxOffsetX56"));
53  defaultParameters_.setVtxOffsetY56(iConfig.getParameter<double>("vtxOffsetY56"));
54  defaultParameters_.setVtxOffsetZ56(iConfig.getParameter<double>("vtxOffsetZ56"));
55 
56  defaultParameters_.setVtxStddevX(iConfig.getParameter<double>("vtxStddevX"));
57  defaultParameters_.setVtxStddevY(iConfig.getParameter<double>("vtxStddevY"));
58  defaultParameters_.setVtxStddevZ(iConfig.getParameter<double>("vtxStddevZ"));
59 }

References defaultParameters_, edm::ParameterSet::getParameter(), CTPPSBeamParameters::setBeamDivergenceX45(), CTPPSBeamParameters::setBeamDivergenceX56(), CTPPSBeamParameters::setBeamDivergenceY45(), CTPPSBeamParameters::setBeamDivergenceY56(), CTPPSBeamParameters::setVtxOffsetX45(), CTPPSBeamParameters::setVtxOffsetX56(), CTPPSBeamParameters::setVtxOffsetY45(), CTPPSBeamParameters::setVtxOffsetY56(), CTPPSBeamParameters::setVtxOffsetZ45(), CTPPSBeamParameters::setVtxOffsetZ56(), CTPPSBeamParameters::setVtxStddevX(), CTPPSBeamParameters::setVtxStddevY(), and CTPPSBeamParameters::setVtxStddevZ().

◆ ~CTPPSBeamParametersFromLHCInfoESSource()

CTPPSBeamParametersFromLHCInfoESSource::~CTPPSBeamParametersFromLHCInfoESSource ( )
overridedefault

Member Function Documentation

◆ fillDescriptions()

void CTPPSBeamParametersFromLHCInfoESSource::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 91 of file CTPPSBeamParametersFromLHCInfoESSource.cc.

91  {
93 
94  desc.add<std::string>("lhcInfoLabel", "");
95 
96  // beam divergence (rad)
97  desc.add<double>("beamDivX45", 0.1);
98  desc.add<double>("beamDivY45", 0.1);
99  desc.add<double>("beamDivX56", 0.1);
100  desc.add<double>("beamDivY56", 0.1);
101 
102  // vertex offset (cm)
103  desc.add<double>("vtxOffsetX45", 1.e-2);
104  desc.add<double>("vtxOffsetY45", 1.e-2);
105  desc.add<double>("vtxOffsetZ45", 1.e-2);
106  desc.add<double>("vtxOffsetX56", 1.e-2);
107  desc.add<double>("vtxOffsetY56", 1.e-2);
108  desc.add<double>("vtxOffsetZ56", 1.e-2);
109 
110  // vertex sigma (cm)
111  desc.add<double>("vtxStddevX", 2.e-2);
112  desc.add<double>("vtxStddevY", 2.e-2);
113  desc.add<double>("vtxStddevZ", 2.e-2);
114 
115  descriptions.add("ctppsBeamParametersFromLHCInfoESSource", desc);
116 }

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ produce()

std::unique_ptr< CTPPSBeamParameters > CTPPSBeamParametersFromLHCInfoESSource::produce ( const CTPPSBeamParametersRcd iRecord)

Definition at line 63 of file CTPPSBeamParametersFromLHCInfoESSource.cc.

64  {
65  LHCInfo const& lhcInfo = iRecord.get(lhcInfoToken_);
66 
67  auto bp = std::make_unique<CTPPSBeamParameters>(defaultParameters_);
68 
69  const auto beamMom = lhcInfo.energy();
70  const auto betaStar = lhcInfo.betaStar() * 1E2; // conversion m --> cm
71  const auto xangle = lhcInfo.crossingAngle() * 1E-6; // conversion mu rad --> rad
72 
73  bp->setBeamMom45(beamMom);
74  bp->setBeamMom56(beamMom);
75 
76  bp->setBetaStarX45(betaStar);
77  bp->setBetaStarX56(betaStar);
78  bp->setBetaStarY45(betaStar);
79  bp->setBetaStarY56(betaStar);
80 
81  bp->setHalfXangleX45(xangle);
82  bp->setHalfXangleX56(xangle);
83  bp->setHalfXangleY45(xangle);
84  bp->setHalfXangleY56(xangle);
85 
86  return bp;
87 }

References BeamSpotFakeParameters_cfi::betaStar, LHCInfo::betaStar(), LHCInfo::crossingAngle(), defaultParameters_, LHCInfo::energy(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::get(), lhcInfoToken_, and OpticalFunctionsConfig_cfi::xangle.

Member Data Documentation

◆ defaultParameters_

CTPPSBeamParameters CTPPSBeamParametersFromLHCInfoESSource::defaultParameters_
private

◆ lhcInfoToken_

const edm::ESGetToken<LHCInfo, LHCInfoRcd> CTPPSBeamParametersFromLHCInfoESSource::lhcInfoToken_
private

Definition at line 37 of file CTPPSBeamParametersFromLHCInfoESSource.cc.

Referenced by produce().

LHCInfo::energy
const float energy() const
Definition: LHCInfo.cc:190
CTPPSBeamParameters::setVtxOffsetY56
void setVtxOffsetY56(double offset)
Definition: CTPPSBeamParameters.cc:112
edm::ESInputTag
Definition: ESInputTag.h:87
CTPPSBeamParameters::setVtxStddevX
void setVtxStddevX(double stddev)
Definition: CTPPSBeamParameters.cc:116
BeamSpotFakeParameters_cfi.betaStar
betaStar
Definition: BeamSpotFakeParameters_cfi.py:19
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
CTPPSBeamParameters::setVtxOffsetZ45
void setVtxOffsetZ45(double offset)
Definition: CTPPSBeamParameters.cc:109
LHCInfo
Definition: LHCInfo.h:12
CTPPSBeamParameters::setVtxOffsetY45
void setVtxOffsetY45(double offset)
Definition: CTPPSBeamParameters.cc:108
CTPPSBeamParameters::setVtxStddevY
void setVtxStddevY(double stddev)
Definition: CTPPSBeamParameters.cc:117
CTPPSBeamParameters::setBeamDivergenceY56
void setBeamDivergenceY56(double div)
Definition: CTPPSBeamParameters.cc:100
LHCInfo::crossingAngle
const float crossingAngle() const
Definition: LHCInfo.cc:182
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:109
OpticalFunctionsConfig_cfi.xangle
xangle
Definition: OpticalFunctionsConfig_cfi.py:17
CTPPSBeamParameters::setBeamDivergenceX56
void setBeamDivergenceX56(double div)
Definition: CTPPSBeamParameters.cc:99
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CTPPSBeamParameters::setVtxOffsetX56
void setVtxOffsetX56(double offset)
Definition: CTPPSBeamParameters.cc:111
CTPPSBeamParameters::setBeamDivergenceY45
void setBeamDivergenceY45(double div)
Definition: CTPPSBeamParameters.cc:98
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
CTPPSBeamParameters::setVtxOffsetZ56
void setVtxOffsetZ56(double offset)
Definition: CTPPSBeamParameters.cc:113
CTPPSBeamParameters::setVtxOffsetX45
void setVtxOffsetX45(double offset)
Definition: CTPPSBeamParameters.cc:107
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
LHCInfo::betaStar
const float betaStar() const
Definition: LHCInfo.cc:184
CTPPSBeamParameters::setBeamDivergenceX45
void setBeamDivergenceX45(double div)
Definition: CTPPSBeamParameters.cc:97
CTPPSBeamParametersFromLHCInfoESSource::lhcInfoToken_
const edm::ESGetToken< LHCInfo, LHCInfoRcd > lhcInfoToken_
Definition: CTPPSBeamParametersFromLHCInfoESSource.cc:37
CTPPSBeamParameters::setVtxStddevZ
void setVtxStddevZ(double stddev)
Definition: CTPPSBeamParameters.cc:118
CTPPSBeamParametersFromLHCInfoESSource::defaultParameters_
CTPPSBeamParameters defaultParameters_
Definition: CTPPSBeamParametersFromLHCInfoESSource.cc:39