CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
CTPPSBeamParametersESSource Class Reference

Loads CTPPSBeamParameters from a config file. More...

Inheritance diagram for CTPPSBeamParametersESSource:
edm::ESProducer edm::EventSetupRecordIntervalFinder edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Member Functions

 CTPPSBeamParametersESSource (const edm::ParameterSet &)
 
std::unique_ptr< CTPPSBeamParametersproduce (const CTPPSBeamParametersRcd &)
 
 ~CTPPSBeamParametersESSource () override=default
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
ESProducer const & operator= (const ESProducer &)=delete
 
template<typename Record >
void updateFromMayConsumes (unsigned int iIndex, const Record &iRecord)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer ()(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)
 
- Public Member Functions inherited from edm::EventSetupRecordIntervalFinder
bool concurrentFinder () const
 
const eventsetup::ComponentDescriptiondescriptionForFinder () const
 
 EventSetupRecordIntervalFinder ()
 
 EventSetupRecordIntervalFinder (const EventSetupRecordIntervalFinder &)=delete
 
std::set< eventsetup::EventSetupRecordKeyfindingForRecords () const
 
const ValidityIntervalfindIntervalFor (const eventsetup::EventSetupRecordKey &, const IOVSyncValue &)
 
bool nonconcurrentAndIOVNeedsUpdate (const eventsetup::EventSetupRecordKey &key, const IOVSyncValue &syncValue) const
 
const EventSetupRecordIntervalFinderoperator= (const EventSetupRecordIntervalFinder &)=delete
 
void resetInterval (const eventsetup::EventSetupRecordKey &)
 
void setDescriptionForFinder (const eventsetup::ComponentDescription &iDescription)
 
virtual ~EventSetupRecordIntervalFinder () noexcept(false)
 

Static Public Member Functions

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

Protected Member Functions

void setIntervalFor (const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
 sets infinite validity of this data More...
 
- Protected Member Functions inherited from edm::ESProducer
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 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)
 
- Protected Member Functions inherited from edm::EventSetupRecordIntervalFinder
template<class T >
void findingRecord ()
 
void findingRecordWithKey (const eventsetup::EventSetupRecordKey &)
 

Private Member Functions

std::unique_ptr< CTPPSBeamParametersfillBeamParameters ()
 Fill CTPPSBeamParameters object with BP. More...
 
void setBeamParameters (const edm::ParameterSet &)
 Set BP to their values from config. More...
 

Private Attributes

double beamDivX45_
 
double beamDivX56_
 
double beamDivY45_
 
double beamDivY56_
 
double beamMom45_
 
double beamMom56_
 
double betaStarX45_
 
double betaStarX56_
 
double betaStarY45_
 
double betaStarY56_
 
double halfXangleX45_
 
double halfXangleX56_
 
double halfXangleY45_
 
double halfXangleY56_
 
bool setBeamPars_
 
double vtxOffsetX45_
 
double vtxOffsetX56_
 
double vtxOffsetY45_
 
double vtxOffsetY56_
 
double vtxOffsetZ45_
 
double vtxOffsetZ56_
 
double vtxStddevX_
 
double vtxStddevY_
 
double vtxStddevZ_
 

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 >>>
 

Detailed Description

Loads CTPPSBeamParameters from a config file.

Definition at line 42 of file CTPPSBeamParametersESSource.cc.

Constructor & Destructor Documentation

CTPPSBeamParametersESSource::CTPPSBeamParametersESSource ( const edm::ParameterSet iConfig)

Definition at line 77 of file CTPPSBeamParametersESSource.cc.

References setBeamParameters(), setBeamPars_, and edm::ESProducer::setWhatProduced().

78  : setBeamPars_(iConfig.getParameter<bool>("setBeamPars")),
79  beamMom45_(0.),
80  beamMom56_(0.),
81  betaStarX45_(0.),
82  betaStarY45_(0.),
83  betaStarX56_(0.),
84  betaStarY56_(0.),
85  beamDivX45_(0.),
86  beamDivY45_(0.),
87  beamDivX56_(0.),
88  beamDivY56_(0.),
89  halfXangleX45_(0.),
90  halfXangleY45_(0.),
91  halfXangleX56_(0.),
92  halfXangleY56_(0.),
93  vtxOffsetX45_(0.),
94  vtxOffsetY45_(0.),
95  vtxOffsetZ45_(0.),
96  vtxOffsetX56_(0.),
97  vtxOffsetY56_(0.),
98  vtxOffsetZ56_(0.),
99  vtxStddevX_(0.),
100  vtxStddevY_(0.),
101  vtxStddevZ_(0.) {
102  if (setBeamPars_)
103  setBeamParameters(iConfig);
104 
105  setWhatProduced(this);
106  findingRecord<CTPPSBeamParametersRcd>();
107 }
T getParameter(std::string const &) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
void setBeamParameters(const edm::ParameterSet &)
Set BP to their values from config.
CTPPSBeamParametersESSource::~CTPPSBeamParametersESSource ( )
overridedefault

Member Function Documentation

std::unique_ptr< CTPPSBeamParameters > CTPPSBeamParametersESSource::fillBeamParameters ( )
private

Fill CTPPSBeamParameters object with BP.

Definition at line 150 of file CTPPSBeamParametersESSource.cc.

References beamDivX45_, beamDivX56_, beamDivY45_, beamDivY56_, beamMom45_, beamMom56_, betaStarX45_, betaStarX56_, betaStarY45_, betaStarY56_, halfXangleX45_, halfXangleX56_, halfXangleY45_, halfXangleY56_, AlCaHLTBitMon_ParallelJobs::p, vtxOffsetX45_, vtxOffsetX56_, vtxOffsetY45_, vtxOffsetY56_, vtxOffsetZ45_, vtxOffsetZ56_, vtxStddevX_, vtxStddevY_, and vtxStddevZ_.

Referenced by produce().

150  {
151  auto p = std::make_unique<CTPPSBeamParameters>();
152 
153  p->setBeamMom45(beamMom45_);
154  p->setBeamMom56(beamMom56_);
155 
156  p->setBetaStarX45(betaStarX45_);
157  p->setBetaStarY45(betaStarY45_);
158  p->setBetaStarX56(betaStarX56_);
159  p->setBetaStarY56(betaStarY56_);
160 
161  p->setBeamDivergenceX45(beamDivX45_);
162  p->setBeamDivergenceY45(beamDivY45_);
163  p->setBeamDivergenceX56(beamDivX56_);
164  p->setBeamDivergenceY56(beamDivY56_);
165 
166  p->setHalfXangleX45(halfXangleX45_);
167  p->setHalfXangleY45(halfXangleY45_);
168  p->setHalfXangleX56(halfXangleX56_);
169  p->setHalfXangleY56(halfXangleY56_);
170 
171  p->setVtxOffsetX45(vtxOffsetX45_);
172  p->setVtxOffsetY45(vtxOffsetY45_);
173  p->setVtxOffsetZ45(vtxOffsetZ45_);
174  p->setVtxOffsetX56(vtxOffsetX56_);
175  p->setVtxOffsetY56(vtxOffsetY56_);
176  p->setVtxOffsetZ56(vtxOffsetZ56_);
177 
178  p->setVtxStddevX(vtxStddevX_);
179  p->setVtxStddevY(vtxStddevY_);
180  p->setVtxStddevZ(vtxStddevZ_);
181 
182  return p;
183 }
void CTPPSBeamParametersESSource::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 200 of file CTPPSBeamParametersESSource.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and DEFINE_FWK_EVENTSETUP_SOURCE.

200  {
202  desc.add<bool>("setBeamPars", true);
203  // beam momentum (GeV)
204  desc.add<double>("beamMom45", 6500.);
205  desc.add<double>("beamMom56", 6500.);
206  // beta* (cm)
207  desc.add<double>("betaStarX45", 30.);
208  desc.add<double>("betaStarY45", 30.);
209  desc.add<double>("betaStarX56", 30.);
210  desc.add<double>("betaStarY56", 30.);
211  // beam divergence (rad)
212  desc.add<double>("beamDivX45", 0.1);
213  desc.add<double>("beamDivY45", 0.1);
214  desc.add<double>("beamDivX56", 0.1);
215  desc.add<double>("beamDivY56", 0.1);
216  // half crossing angle (rad)
217  desc.add<double>("halfXangleX45", 80.e-6);
218  desc.add<double>("halfXangleY45", 80.e-6);
219  desc.add<double>("halfXangleX56", 80.e-6);
220  desc.add<double>("halfXangleY56", 80.e-6);
221  // vertex offset (cm)
222  desc.add<double>("vtxOffsetX45", 1.e-2);
223  desc.add<double>("vtxOffsetY45", 1.e-2);
224  desc.add<double>("vtxOffsetZ45", 1.e-2);
225  desc.add<double>("vtxOffsetX56", 1.e-2);
226  desc.add<double>("vtxOffsetY56", 1.e-2);
227  desc.add<double>("vtxOffsetZ56", 1.e-2);
228  // vertex sigma (cm)
229  desc.add<double>("vtxStddevX", 2.e-2);
230  desc.add<double>("vtxStddevY", 2.e-2);
231  desc.add<double>("vtxStddevZ", 2.e-2);
232 
233  descriptions.add("ctppsBeamParametersESSource", desc);
234 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::unique_ptr< CTPPSBeamParameters > CTPPSBeamParametersESSource::produce ( const CTPPSBeamParametersRcd )

Definition at line 111 of file CTPPSBeamParametersESSource.cc.

References fillBeamParameters(), and setBeamPars_.

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

111  {
112  // If beam parameters are available from the config file, fill their values into CTPPSBeamParameters object
113  auto bp = (setBeamPars_) ? fillBeamParameters() : std::make_unique<CTPPSBeamParameters>();
114 
115  edm::LogInfo("CTPPSBeamParametersESSource::produce") << "\n" << *bp;
116 
117  return bp;
118 }
std::unique_ptr< CTPPSBeamParameters > fillBeamParameters()
Fill CTPPSBeamParameters object with BP.
void CTPPSBeamParametersESSource::setBeamParameters ( const edm::ParameterSet iConfig)
private

Set BP to their values from config.

Definition at line 122 of file CTPPSBeamParametersESSource.cc.

References beamDivX45_, beamDivX56_, beamDivY45_, beamDivY56_, beamMom45_, beamMom56_, betaStarX45_, betaStarX56_, betaStarY45_, betaStarY56_, edm::ParameterSet::getParameter(), halfXangleX45_, halfXangleX56_, halfXangleY45_, halfXangleY56_, vtxOffsetX45_, vtxOffsetX56_, vtxOffsetY45_, vtxOffsetY56_, vtxOffsetZ45_, vtxOffsetZ56_, vtxStddevX_, vtxStddevY_, and vtxStddevZ_.

Referenced by CTPPSBeamParametersESSource().

122  {
123  beamMom45_ = iConfig.getParameter<double>("beamMom45");
124  beamMom56_ = iConfig.getParameter<double>("beamMom56");
125  betaStarX45_ = iConfig.getParameter<double>("betaStarX45");
126  betaStarX56_ = iConfig.getParameter<double>("betaStarX56");
127  betaStarY45_ = iConfig.getParameter<double>("betaStarY45");
128  betaStarY56_ = iConfig.getParameter<double>("betaStarY56");
129  beamDivX45_ = iConfig.getParameter<double>("beamDivX45");
130  beamDivX56_ = iConfig.getParameter<double>("beamDivX56");
131  beamDivY45_ = iConfig.getParameter<double>("beamDivY45");
132  beamDivY56_ = iConfig.getParameter<double>("beamDivY56");
133  halfXangleX45_ = iConfig.getParameter<double>("halfXangleX45");
134  halfXangleX56_ = iConfig.getParameter<double>("halfXangleX56");
135  halfXangleY45_ = iConfig.getParameter<double>("halfXangleY45");
136  halfXangleY56_ = iConfig.getParameter<double>("halfXangleY56");
137  vtxOffsetX45_ = iConfig.getParameter<double>("vtxOffsetX45");
138  vtxOffsetY45_ = iConfig.getParameter<double>("vtxOffsetY45");
139  vtxOffsetZ45_ = iConfig.getParameter<double>("vtxOffsetZ45");
140  vtxOffsetX56_ = iConfig.getParameter<double>("vtxOffsetX56");
141  vtxOffsetY56_ = iConfig.getParameter<double>("vtxOffsetY56");
142  vtxOffsetZ56_ = iConfig.getParameter<double>("vtxOffsetZ56");
143  vtxStddevX_ = iConfig.getParameter<double>("vtxStddevX");
144  vtxStddevY_ = iConfig.getParameter<double>("vtxStddevY");
145  vtxStddevZ_ = iConfig.getParameter<double>("vtxStddevZ");
146 }
T getParameter(std::string const &) const
void CTPPSBeamParametersESSource::setIntervalFor ( const edm::eventsetup::EventSetupRecordKey key,
const edm::IOVSyncValue iosv,
edm::ValidityInterval oValidity 
)
overrideprotectedvirtual

sets infinite validity of this data

Implements edm::EventSetupRecordIntervalFinder.

Definition at line 187 of file CTPPSBeamParametersESSource.cc.

References edm::IOVSyncValue::beginOfTime(), edm::IOVSyncValue::endOfTime(), edm::EventID::event(), edm::IOVSyncValue::eventID(), infinity, edm::eventsetup::EventSetupRecordKey::name(), and edm::EventID::run().

189  {
190  edm::LogInfo("CTPPSBeamParametersESSource")
191  << ">> CTPPSBeamParametersESSource::setIntervalFor(" << key.name() << ")\n"
192  << " run=" << iosv.eventID().run() << ", event=" << iosv.eventID().event();
193 
195  oValidity = infinity;
196 }
RunNumber_t run() const
Definition: EventID.h:38
EventNumber_t event() const
Definition: EventID.h:40
const EventID & eventID() const
Definition: IOVSyncValue.h:40
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:82
static const IOVSyncValue & beginOfTime()
Definition: IOVSyncValue.cc:88
const double infinity

Member Data Documentation

double CTPPSBeamParametersESSource::beamDivX45_
private

Definition at line 61 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::beamDivX56_
private

Definition at line 61 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::beamDivY45_
private

Definition at line 61 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::beamDivY56_
private

Definition at line 61 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::beamMom45_
private

Definition at line 59 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::beamMom56_
private

Definition at line 59 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::betaStarX45_
private

Definition at line 60 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::betaStarX56_
private

Definition at line 60 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::betaStarY45_
private

Definition at line 60 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::betaStarY56_
private

Definition at line 60 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::halfXangleX45_
private

Definition at line 62 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::halfXangleX56_
private

Definition at line 63 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::halfXangleY45_
private

Definition at line 62 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::halfXangleY56_
private

Definition at line 63 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

bool CTPPSBeamParametersESSource::setBeamPars_
private

Definition at line 51 of file CTPPSBeamParametersESSource.cc.

Referenced by CTPPSBeamParametersESSource(), and produce().

double CTPPSBeamParametersESSource::vtxOffsetX45_
private

Definition at line 64 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::vtxOffsetX56_
private

Definition at line 65 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::vtxOffsetY45_
private

Definition at line 64 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::vtxOffsetY56_
private

Definition at line 65 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::vtxOffsetZ45_
private

Definition at line 64 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::vtxOffsetZ56_
private

Definition at line 65 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::vtxStddevX_
private

Definition at line 66 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::vtxStddevY_
private

Definition at line 66 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().

double CTPPSBeamParametersESSource::vtxStddevZ_
private

Definition at line 66 of file CTPPSBeamParametersESSource.cc.

Referenced by fillBeamParameters(), and setBeamParameters().