CMS 3D CMS Logo

SiPixelTemplateStoreESProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: RecoLocalTracker/SiPixelRecHits
4 // Class : SiPixelTemplateStoreESProducer
5 //
6 // Implementation:
7 // [Notes on implementation]
8 //
9 // Original Author: Christopher Jones
10 // Created: Tue, 08 Aug 2023 14:21:50 GMT
11 //
12 
13 // system include files
14 
15 // user include files
18 
21 
23 
25 public:
28 
29  std::unique_ptr<std::vector<SiPixelTemplateStore>> produce(const SiPixelTemplateDBObjectESProducerRcd&);
30 
31 private:
33 };
34 
35 //
36 // constants, enums and typedefs
37 //
38 
39 //
40 // static data member definitions
41 //
42 
43 //
44 // constructors and destructor
45 //
47  token_ = setWhatProduced(this).consumes();
48 }
49 
50 //
51 // member functions
52 //
53 std::unique_ptr<std::vector<SiPixelTemplateStore>> SiPixelTemplateStoreESProducer::produce(
54  const SiPixelTemplateDBObjectESProducerRcd& iRecord) {
55  auto returnValue = std::make_unique<std::vector<SiPixelTemplateStore>>();
56 
57  if (not SiPixelTemplate::pushfile(iRecord.get(token_), *returnValue)) {
58  throw cms::Exception("SiPixelTemplateDBObjectFailure")
59  << "Templates not filled correctly. Check the DB. Using SiPixelTemplateDBObject version "
60  << iRecord.get(token_).version();
61  }
62 
63  return returnValue;
64 }
65 
66 //
67 // const member functions
68 //
69 
70 //
71 // static member functions
72 //
75  iDesc.addDefault(iPSet);
76  iDesc.add("SiPixelTemplateStoreESProducer", iPSet);
77 }
78 
80 ;
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
static void fillDescriptions(edm::ConfigurationDescriptions &)
SiPixelTemplateStoreESProducer(edm::ParameterSet const &)
void addDefault(ParameterSetDescription const &psetDescription)
edm::ESGetToken< SiPixelTemplateDBObject, SiPixelTemplateDBObjectESProducerRcd > token_
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:61
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static bool pushfile(int filenum, std::vector< SiPixelTemplateStore > &pixelTemp, std::string dir="CalibTracker/SiPixelESProducers/data/")
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
std::unique_ptr< std::vector< SiPixelTemplateStore > > produce(const SiPixelTemplateDBObjectESProducerRcd &)