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::ESProductResolverFactoryProducer edm::eventsetup::ESProductResolverProvider

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
 
 ESProducer (ESProducer &&)=delete
 
ESResolverIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProduceroperator= (const ESProducer &)=delete
 
ESProduceroperator= (ESProducer &&)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESResolverIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProductResolverFactoryProducer
 ESProductResolverFactoryProducer ()
 
 ESProductResolverFactoryProducer (const ESProductResolverFactoryProducer &)=delete
 
const ESProductResolverFactoryProduceroperator= (const ESProductResolverFactoryProducer &)=delete
 
 ~ESProductResolverFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
void createKeyedResolvers (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
const ComponentDescriptiondescription () const
 
 ESProductResolverProvider ()
 
 ESProductResolverProvider (const ESProductResolverProvider &)=delete
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedResolverskeyedResolvers (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const ESProductResolverProvideroperator= (const ESProductResolverProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~ESProductResolverProvider () noexcept(false)
 

Static Public Member Functions

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

Private Attributes

CTPPSBeamParameters defaultParameters_
 
edm::ESGetToken< LHCInfoPerFill, LHCInfoPerFillRcdlhcInfoPerFillToken_
 
edm::ESGetToken< LHCInfoPerLS, LHCInfoPerLSRcdlhcInfoPerLSToken_
 
edm::ESGetToken< LHCInfo, LHCInfoRcdlhcInfoToken_
 
const bool useNewLHCInfo_
 

Additional Inherited Members

- Protected Types inherited from edm::ESProductResolverFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::ESProductResolverProvider
using KeyedResolversVector = std::vector< std::pair< DataKey, std::shared_ptr< ESProductResolver > >>
 
- Protected Member Functions inherited from edm::ESProducer
ESConsumesInfoconsumesInfoPushBackNew ()
 
unsigned int consumesInfoSize () const
 
template<typename CallbackT , typename TList , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>> iCallback, const TList *, const TRecord *iRecord, const es::Label &iLabel)
 
template<typename CallbackT , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>>, const eventsetup::produce::Null *, const TRecord *, const es::Label &)
 
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 TDecorator >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename TFunc >
auto setWhatProduced (TFunc &&func, const es::Label &iLabel={})
 
template<typename TReturn , typename TRecord , typename TFunc , typename TDecorator >
ESConsumesCollectorT< TRecord > setWhatProduced (TFunc &&func, TDecorator &&iDec, const es::Label &iLabel={})
 
void usesResources (std::vector< std::string > const &)
 
- Protected Member Functions inherited from edm::ESProductResolverFactoryProducer
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::ESProductResolverFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedResolversVector registerResolvers (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::ESProductResolverProvider
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 44 of file CTPPSBeamParametersFromLHCInfoESSource.cc.

References gpuPixelDoublets::cc, defaultParameters_, edm::ParameterSet::getParameter(), lhcInfoPerFillToken_, lhcInfoPerLSToken_, 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.

45  : useNewLHCInfo_(iConfig.getParameter<bool>("useNewLHCInfo")) {
46  auto cc = setWhatProduced(this);
47  lhcInfoToken_ = cc.consumes(edm::ESInputTag("", iConfig.getParameter<std::string>("lhcInfoLabel")));
48  lhcInfoPerLSToken_ = cc.consumes(edm::ESInputTag("", iConfig.getParameter<std::string>("lhcInfoPerLSLabel")));
49  lhcInfoPerFillToken_ = cc.consumes(edm::ESInputTag("", iConfig.getParameter<std::string>("lhcInfoPerFillLabel")));
50 
51  defaultParameters_.setBeamDivergenceX45(iConfig.getParameter<double>("beamDivX45"));
52  defaultParameters_.setBeamDivergenceY45(iConfig.getParameter<double>("beamDivX56"));
53  defaultParameters_.setBeamDivergenceX56(iConfig.getParameter<double>("beamDivY45"));
54  defaultParameters_.setBeamDivergenceY56(iConfig.getParameter<double>("beamDivY56"));
55 
56  defaultParameters_.setVtxOffsetX45(iConfig.getParameter<double>("vtxOffsetX45"));
57  defaultParameters_.setVtxOffsetY45(iConfig.getParameter<double>("vtxOffsetY45"));
58  defaultParameters_.setVtxOffsetZ45(iConfig.getParameter<double>("vtxOffsetZ45"));
59  defaultParameters_.setVtxOffsetX56(iConfig.getParameter<double>("vtxOffsetX56"));
60  defaultParameters_.setVtxOffsetY56(iConfig.getParameter<double>("vtxOffsetY56"));
61  defaultParameters_.setVtxOffsetZ56(iConfig.getParameter<double>("vtxOffsetZ56"));
62 
63  defaultParameters_.setVtxStddevX(iConfig.getParameter<double>("vtxStddevX"));
64  defaultParameters_.setVtxStddevY(iConfig.getParameter<double>("vtxStddevY"));
65  defaultParameters_.setVtxStddevZ(iConfig.getParameter<double>("vtxStddevZ"));
66 }
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:166
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::ESGetToken< LHCInfoPerFill, LHCInfoPerFillRcd > lhcInfoPerFillToken_
edm::ESGetToken< LHCInfoPerLS, LHCInfoPerLSRcd > lhcInfoPerLSToken_
void setBeamDivergenceY45(double div)
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
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::~CTPPSBeamParametersFromLHCInfoESSource ( )
overridedefault

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 101 of file CTPPSBeamParametersFromLHCInfoESSource.cc.

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

101  {
103 
104  desc.add<std::string>("lhcInfoLabel", "");
105  desc.add<std::string>("lhcInfoPerLSLabel", "");
106  desc.add<std::string>("lhcInfoPerFillLabel", "");
107  desc.add<bool>("useNewLHCInfo", false);
108 
109  // beam divergence (rad)
110  desc.add<double>("beamDivX45", 0.1);
111  desc.add<double>("beamDivY45", 0.1);
112  desc.add<double>("beamDivX56", 0.1);
113  desc.add<double>("beamDivY56", 0.1);
114 
115  // vertex offset (cm)
116  desc.add<double>("vtxOffsetX45", 1.e-2);
117  desc.add<double>("vtxOffsetY45", 1.e-2);
118  desc.add<double>("vtxOffsetZ45", 1.e-2);
119  desc.add<double>("vtxOffsetX56", 1.e-2);
120  desc.add<double>("vtxOffsetY56", 1.e-2);
121  desc.add<double>("vtxOffsetZ56", 1.e-2);
122 
123  // vertex sigma (cm)
124  desc.add<double>("vtxStddevX", 2.e-2);
125  desc.add<double>("vtxStddevY", 2.e-2);
126  desc.add<double>("vtxStddevZ", 2.e-2);
127 
128  descriptions.add("ctppsBeamParametersFromLHCInfoESSourceDefault", desc);
129 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

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

Definition at line 70 of file CTPPSBeamParametersFromLHCInfoESSource.cc.

References simBeamSpotPI::betaStar, LHCInfoCombined::createLHCInfoCombined(), defaultParameters_, lhcInfoPerFillToken_, lhcInfoPerLSToken_, lhcInfoToken_, useNewLHCInfo_, and profile_base_cff::xangle.

71  {
72  auto lhcInfoCombined =
76 
77  auto bp = std::make_unique<CTPPSBeamParameters>(defaultParameters_);
78 
79  const auto beamMom = lhcInfoCombined.energy;
80  const auto betaStar = lhcInfoCombined.betaStarX * 1E2; // conversion m --> cm
81  const auto xangle = lhcInfoCombined.crossingAngle() * 1E-6; // conversion mu rad --> rad
82 
83  bp->setBeamMom45(beamMom);
84  bp->setBeamMom56(beamMom);
85 
86  bp->setBetaStarX45(betaStar);
87  bp->setBetaStarX56(betaStar);
88  bp->setBetaStarY45(betaStar);
89  bp->setBetaStarY56(betaStar);
90 
91  bp->setHalfXangleX45(xangle);
92  bp->setHalfXangleX56(xangle);
93  bp->setHalfXangleY45(xangle);
94  bp->setHalfXangleY56(xangle);
95 
96  return bp;
97 }
edm::ESGetToken< LHCInfoPerFill, LHCInfoPerFillRcd > lhcInfoPerFillToken_
edm::ESGetToken< LHCInfoPerLS, LHCInfoPerLSRcd > lhcInfoPerLSToken_
static LHCInfoCombined createLHCInfoCombined(const edm::eventsetup::DependentRecordImplementation< RecordT, ListT > &iRecord, const edm::ESGetToken< LHCInfoPerLS, LHCInfoPerLSRcd > &tokenInfoPerLS, const edm::ESGetToken< LHCInfoPerFill, LHCInfoPerFillRcd > &tokenInfoPerFill, const edm::ESGetToken< LHCInfo, LHCInfoRcd > &tokenInfo, bool useNewLHCInfo)

Member Data Documentation

◆ defaultParameters_

CTPPSBeamParameters CTPPSBeamParametersFromLHCInfoESSource::defaultParameters_
private

◆ lhcInfoPerFillToken_

edm::ESGetToken<LHCInfoPerFill, LHCInfoPerFillRcd> CTPPSBeamParametersFromLHCInfoESSource::lhcInfoPerFillToken_
private

◆ lhcInfoPerLSToken_

edm::ESGetToken<LHCInfoPerLS, LHCInfoPerLSRcd> CTPPSBeamParametersFromLHCInfoESSource::lhcInfoPerLSToken_
private

◆ lhcInfoToken_

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

◆ useNewLHCInfo_

const bool CTPPSBeamParametersFromLHCInfoESSource::useNewLHCInfo_
private

Definition at line 37 of file CTPPSBeamParametersFromLHCInfoESSource.cc.

Referenced by produce().