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 
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:61
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::ESGetToken< BeamSpotObjects, BeamSpotTransientObjectsRcd > const bsToken_
edm::ESGetToken< BeamSpotObjects, BeamSpotObjectsRcd > bsOfflineToken_
HLT enums.
static void fillDescriptions(edm::ConfigurationDescriptions &desc)
std::shared_ptr< const BeamSpotObjects > produce(const BeamSpotTransientObjectsRcd &)