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 ()
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer ()(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval) override
 overrides DataProxyProvider method More...
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
 DataProxyProvider ()
 
const ComponentDescriptiondescription () const
 
bool isUsingRecord (const EventSetupRecordKey &) const
 
const KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey) const
 
void resetProxies (const EventSetupRecordKey &iRecordType)
 
void resetProxiesIfTransient (const EventSetupRecordKey &iRecordType)
 
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_
 
edm::ESGetToken< LHCInfo, LHCInfoRcdlhcInfoToken_
 

Additional Inherited Members

- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair< DataKey, edm::propagate_const< std::shared_ptr< DataProxy > > > > KeyedProxies
 
typedef std::vector< EventSetupRecordKeyKeys
 
typedef std::map< EventSetupRecordKey, KeyedProxiesRecordProxies
 
- Protected Member Functions inherited from edm::ESProducer
 ESProducer (const ESProducer &)=delete
 
ESProducer const & operator= (const ESProducer &)=delete
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const char *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={})
 
- 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 eventsetup::EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList) override
 override DataProxyProvider method More...
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
void eraseAll (const EventSetupRecordKey &iRecordKey)
 deletes all the Proxies in aStream More...
 
void invalidateProxies (const EventSetupRecordKey &iRecordKey)
 
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &)
 

Detailed Description

Definition at line 25 of file CTPPSBeamParametersFromLHCInfoESSource.cc.

Constructor & Destructor Documentation

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

Definition at line 41 of file CTPPSBeamParametersFromLHCInfoESSource.cc.

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

41  {
42  defaultParameters_.setBeamDivergenceX45(iConfig.getParameter<double>("beamDivX45"));
43  defaultParameters_.setBeamDivergenceY45(iConfig.getParameter<double>("beamDivX56"));
44  defaultParameters_.setBeamDivergenceX56(iConfig.getParameter<double>("beamDivY45"));
45  defaultParameters_.setBeamDivergenceY56(iConfig.getParameter<double>("beamDivY56"));
46 
47  defaultParameters_.setVtxOffsetX45(iConfig.getParameter<double>("vtxOffsetX45"));
48  defaultParameters_.setVtxOffsetY45(iConfig.getParameter<double>("vtxOffsetY45"));
49  defaultParameters_.setVtxOffsetZ45(iConfig.getParameter<double>("vtxOffsetZ45"));
50  defaultParameters_.setVtxOffsetX56(iConfig.getParameter<double>("vtxOffsetX56"));
51  defaultParameters_.setVtxOffsetY56(iConfig.getParameter<double>("vtxOffsetY56"));
52  defaultParameters_.setVtxOffsetZ56(iConfig.getParameter<double>("vtxOffsetZ56"));
53 
54  defaultParameters_.setVtxStddevX(iConfig.getParameter<double>("vtxStddevX"));
55  defaultParameters_.setVtxStddevY(iConfig.getParameter<double>("vtxStddevY"));
56  defaultParameters_.setVtxStddevZ(iConfig.getParameter<double>("vtxStddevZ"));
57 
58  auto cc = setWhatProduced(this);
59  lhcInfoToken_ = cc.consumesFrom<LHCInfo, LHCInfoRcd>(edm::ESInputTag("", iConfig.getParameter<std::string>("lhcInfoLabel")));
60 }
T getParameter(std::string const &) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:124
void setBeamDivergenceY45(double div)
void setVtxStddevX(double stddev)
void setVtxStddevZ(double stddev)
void setVtxOffsetY56(double offset)
void setBeamDivergenceX56(double div)
void setBeamDivergenceX45(double div)
void setVtxOffsetZ56(double offset)
void setVtxStddevY(double stddev)
void setVtxOffsetX45(double offset)
void setBeamDivergenceY56(double div)
void setVtxOffsetY45(double offset)
void setVtxOffsetZ45(double offset)
void setVtxOffsetX56(double offset)
CTPPSBeamParametersFromLHCInfoESSource::~CTPPSBeamParametersFromLHCInfoESSource ( )
overridedefault

Member Function Documentation

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

Definition at line 92 of file CTPPSBeamParametersFromLHCInfoESSource.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), DEFINE_FWK_EVENTSETUP_MODULE, and AlCaHLTBitMon_QueryRunRegistry::string.

92  {
94 
95  desc.add<std::string>("lhcInfoLabel", "");
96 
97  // beam divergence (rad)
98  desc.add<double>("beamDivX45", 0.1);
99  desc.add<double>("beamDivY45", 0.1);
100  desc.add<double>("beamDivX56", 0.1);
101  desc.add<double>("beamDivY56", 0.1);
102 
103  // vertex offset (cm)
104  desc.add<double>("vtxOffsetX45", 1.e-2);
105  desc.add<double>("vtxOffsetY45", 1.e-2);
106  desc.add<double>("vtxOffsetZ45", 1.e-2);
107  desc.add<double>("vtxOffsetX56", 1.e-2);
108  desc.add<double>("vtxOffsetY56", 1.e-2);
109  desc.add<double>("vtxOffsetZ56", 1.e-2);
110 
111  // vertex sigma (cm)
112  desc.add<double>("vtxStddevX", 2.e-2);
113  desc.add<double>("vtxStddevY", 2.e-2);
114  desc.add<double>("vtxStddevZ", 2.e-2);
115 
116  descriptions.add("ctppsBeamParametersFromLHCInfoESSource", desc);
117 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::unique_ptr< CTPPSBeamParameters > CTPPSBeamParametersFromLHCInfoESSource::produce ( const CTPPSBeamParametersRcd iRecord)

Definition at line 64 of file CTPPSBeamParametersFromLHCInfoESSource.cc.

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

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

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

Member Data Documentation

CTPPSBeamParameters CTPPSBeamParametersFromLHCInfoESSource::defaultParameters_
private
edm::ESGetToken<LHCInfo, LHCInfoRcd> CTPPSBeamParametersFromLHCInfoESSource::lhcInfoToken_
private