CMS 3D CMS Logo

OfflineToTransientBeamSpotESProducer.cc
Go to the documentation of this file.
9 
16 
17 #include <iostream>
18 #include <memory>
19 #include <string>
20 
21 using namespace edm;
23 public:
25  std::shared_ptr<const BeamSpotObjects> produce(const BeamSpotTransientObjectsRcd&);
27 
28 private:
32 };
33 
35  auto cc = setWhatProduced(this);
36 
37  bsOfflineToken_ = cc.consumesFrom<BeamSpotObjects, BeamSpotObjectsRcd>();
38 }
39 
42  desc.addWithDefaultLabel(dsc);
43 }
44 std::shared_ptr<const BeamSpotObjects> OfflineToTransientBeamSpotESProducer::produce(
45  const BeamSpotTransientObjectsRcd& iRecord) {
46  auto optionalRec = iRecord.tryToGetRecord<BeamSpotObjectsRcd>();
47  if (not optionalRec) {
48  return std::shared_ptr<const BeamSpotObjects>(&dummyBS_, edm::do_nothing_deleter());
49  }
50  return std::shared_ptr<const BeamSpotObjects>(&optionalRec->get(bsOfflineToken_), edm::do_nothing_deleter());
51 };
52 
ConfigurationDescriptions.h
ESHandle.h
BeamSpotTransientObjectsRcd
Definition: BeamSpotTransientObjectsRcd.h:27
OfflineToTransientBeamSpotESProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &desc)
Definition: OfflineToTransientBeamSpotESProducer.cc:40
edm
HLT enums.
Definition: AlignableModifier.h:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
edm::do_nothing_deleter
Definition: do_nothing_deleter.h:34
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
ESProducer.h
OfflineToTransientBeamSpotESProducer::bsToken_
const edm::ESGetToken< BeamSpotObjects, BeamSpotTransientObjectsRcd > bsToken_
Definition: OfflineToTransientBeamSpotESProducer.cc:30
OfflineToTransientBeamSpotESProducer::produce
std::shared_ptr< const BeamSpotObjects > produce(const BeamSpotTransientObjectsRcd &)
Definition: OfflineToTransientBeamSpotESProducer.cc:44
cc
BeamSpotObjects.h
OfflineToTransientBeamSpotESProducer
Definition: OfflineToTransientBeamSpotESProducer.cc:22
ReusableObjectHolder.h
BeamSpotObjectsRcd.h
fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
ParameterSetDescription.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
OfflineToTransientBeamSpotESProducer::OfflineToTransientBeamSpotESProducer
OfflineToTransientBeamSpotESProducer(const edm::ParameterSet &p)
Definition: OfflineToTransientBeamSpotESProducer.cc:34
edm::ParameterSet
Definition: ParameterSet.h:47
OfflineToTransientBeamSpotESProducer::dummyBS_
const BeamSpotObjects dummyBS_
Definition: OfflineToTransientBeamSpotESProducer.cc:29
OfflineToTransientBeamSpotESProducer::bsOfflineToken_
edm::ESGetToken< BeamSpotObjects, BeamSpotObjectsRcd > bsOfflineToken_
Definition: OfflineToTransientBeamSpotESProducer.cc:31
BeamSpotTransientObjectsRcd.h
BeamSpotObjectsRcd
Definition: BeamSpotObjectsRcd.h:24
BeamSpotObjects
Definition: BeamSpotObjects.h:20
edm::ESGetToken< BeamSpotObjects, BeamSpotTransientObjectsRcd >
ModuleFactory.h
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
edm::eventsetup::DependentRecordImplementation::tryToGetRecord
std::optional< DepRecordT > tryToGetRecord() const
Definition: DependentRecordImplementation.h:68
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
EventSetup.h
edm::ESProducer
Definition: ESProducer.h:104
ESProductHost.h
ParameterSet.h
do_nothing_deleter.h