CMS 3D CMS Logo

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

Public Member Functions

 OnlineBeamSpotESProducer (const edm::ParameterSet &p)
 
std::shared_ptr< const BeamSpotObjectsproduce (const BeamSpotTransientObjectsRcd &)
 
- 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 &desc)
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 

Private Member Functions

const BeamSpotOnlineObjectscompareBS (const BeamSpotOnlineObjects *bs1, const BeamSpotOnlineObjects *bs2)
 

Private Attributes

edm::ESGetToken< BeamSpotOnlineObjects, BeamSpotOnlineHLTObjectsRcdbsHLTToken_
 
edm::ESGetToken< BeamSpotOnlineObjects, BeamSpotOnlineLegacyObjectsRcdbsLegacyToken_
 
const edm::ESGetToken< BeamSpotObjects, BeamSpotTransientObjectsRcdbsToken_
 
BeamSpotObjects fakeBS_
 

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 OnlineBeamSpotESProducer.cc.

Constructor & Destructor Documentation

◆ OnlineBeamSpotESProducer()

OnlineBeamSpotESProducer::OnlineBeamSpotESProducer ( const edm::ParameterSet p)

Definition at line 39 of file OnlineBeamSpotESProducer.cc.

39  {
40  auto cc = setWhatProduced(this);
41 
44  fakeBS_.SetSigmaZ(15.);
45  fakeBS_.SetPosition(0., 0., 0.);
46  fakeBS_.SetType(-1);
47 
50 }

Member Function Documentation

◆ compareBS()

const BeamSpotOnlineObjects * OnlineBeamSpotESProducer::compareBS ( const BeamSpotOnlineObjects bs1,
const BeamSpotOnlineObjects bs2 
)
private

Definition at line 57 of file OnlineBeamSpotESProducer.cc.

58  {
59  //Random logic so far ...
60  if (bs1->GetSigmaZ() - 0.0001 < bs2->GetSigmaZ()) { //just temporary for debugging
61  if (bs1->GetSigmaZ() > 5.) {
62  return bs1;
63  } else {
64  return bs2;
65  }
66 
67  } else {
68  if (bs2->GetSigmaZ() > 5.) {
69  return bs2;
70  } else {
71  return bs1;
72  }
73  }
74 }

References BeamSpotObjects::GetSigmaZ().

◆ fillDescriptions()

void OnlineBeamSpotESProducer::fillDescriptions ( edm::ConfigurationDescriptions desc)
static

Definition at line 52 of file OnlineBeamSpotESProducer.cc.

52  {
54  desc.addWithDefaultLabel(dsc);
55 }

References submitPVResolutionJobs::desc.

◆ produce()

std::shared_ptr< const BeamSpotObjects > OnlineBeamSpotESProducer::produce ( const BeamSpotTransientObjectsRcd iRecord)

Definition at line 76 of file OnlineBeamSpotESProducer.cc.

76  {
77  auto legacyRec = iRecord.tryToGetRecord<BeamSpotOnlineLegacyObjectsRcd>();
78  auto hltRec = iRecord.tryToGetRecord<BeamSpotOnlineHLTObjectsRcd>();
79  if (not legacyRec and not hltRec) {
80  return std::shared_ptr<const BeamSpotObjects>(&fakeBS_, edm::do_nothing_deleter());
81  }
82 
83  const BeamSpotOnlineObjects* best;
84  if (legacyRec and hltRec) {
85  best = compareBS(&legacyRec->get(bsLegacyToken_), &hltRec->get(bsHLTToken_));
86  } else if (legacyRec) {
87  best = &legacyRec->get(bsLegacyToken_);
88  } else {
89  best = &hltRec->get(bsHLTToken_);
90  }
91  return std::shared_ptr<const BeamSpotObjects>(best, edm::do_nothing_deleter());
92 };

References edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::tryToGetRecord().

Member Data Documentation

◆ bsHLTToken_

edm::ESGetToken<BeamSpotOnlineObjects, BeamSpotOnlineHLTObjectsRcd> OnlineBeamSpotESProducer::bsHLTToken_
private

Definition at line 36 of file OnlineBeamSpotESProducer.cc.

◆ bsLegacyToken_

edm::ESGetToken<BeamSpotOnlineObjects, BeamSpotOnlineLegacyObjectsRcd> OnlineBeamSpotESProducer::bsLegacyToken_
private

Definition at line 37 of file OnlineBeamSpotESProducer.cc.

◆ bsToken_

const edm::ESGetToken<BeamSpotObjects, BeamSpotTransientObjectsRcd> OnlineBeamSpotESProducer::bsToken_
private

Definition at line 35 of file OnlineBeamSpotESProducer.cc.

◆ fakeBS_

BeamSpotObjects OnlineBeamSpotESProducer::fakeBS_
private

Definition at line 33 of file OnlineBeamSpotESProducer.cc.

BeamSpotOnlineHLTObjectsRcd
Definition: BeamSpotOnlineHLTObjectsRcd.h:24
OnlineBeamSpotESProducer::bsLegacyToken_
edm::ESGetToken< BeamSpotOnlineObjects, BeamSpotOnlineLegacyObjectsRcd > bsLegacyToken_
Definition: OnlineBeamSpotESProducer.cc:37
BeamSpotObjects::GetSigmaZ
double GetSigmaZ() const
get sigma Z, RMS bunch length
Definition: BeamSpotObjects.h:73
edm::do_nothing_deleter
Definition: do_nothing_deleter.h:34
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
BeamSpotObjects::SetBeamWidthY
void SetBeamWidthY(double val)
set average transverse beam width Y
Definition: BeamSpotObjects.h:50
BeamSpotObjects::SetSigmaZ
void SetSigmaZ(double val)
set sigma Z, RMS bunch length
Definition: BeamSpotObjects.h:42
cc
OnlineBeamSpotESProducer::fakeBS_
BeamSpotObjects fakeBS_
Definition: OnlineBeamSpotESProducer.cc:33
BeamSpotOnlineLegacyObjectsRcd
Definition: BeamSpotOnlineLegacyObjectsRcd.h:24
BeamSpotObjects::SetPosition
void SetPosition(double x, double y, double z)
set XYZ position
Definition: BeamSpotObjects.h:36
BeamSpotObjects::SetType
void SetType(int type)
set beam type
Definition: BeamSpotObjects.h:58
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
edm::eventsetup::DependentRecordImplementation::tryToGetRecord
std::optional< DepRecordT > tryToGetRecord() const
Definition: DependentRecordImplementation.h:68
BeamSpotOnlineObjects
Definition: BeamSpotOnlineObjects.h:25
BeamSpotObjects::SetBeamWidthX
void SetBeamWidthX(double val)
set average transverse beam width X
Definition: BeamSpotObjects.h:48
OnlineBeamSpotESProducer::bsHLTToken_
edm::ESGetToken< BeamSpotOnlineObjects, BeamSpotOnlineHLTObjectsRcd > bsHLTToken_
Definition: OnlineBeamSpotESProducer.cc:36
OnlineBeamSpotESProducer::compareBS
const BeamSpotOnlineObjects * compareBS(const BeamSpotOnlineObjects *bs1, const BeamSpotOnlineObjects *bs2)
Definition: OnlineBeamSpotESProducer.cc:57