CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DTCCablingMapTestProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: CondTools/SiPhase2Tracker
4 // Class: DTCCablingMapTestProducer
5 //
13 //
14 // Original Author: Luigi Calligaris, SPRACE, São Paulo, BR
15 // Created : Wed, 27 Feb 2019 21:41:13 GMT
16 //
17 //
18 
19 #include <memory>
20 
21 #include <unordered_map>
22 #include <utility>
23 
30 
32 
37 
39 public:
41  ~DTCCablingMapTestProducer() override;
42 
43  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
44 
45 private:
46  void beginJob() override;
47  void analyze(const edm::Event&, const edm::EventSetup&) override;
48  void endJob() override;
49 
50 private:
52  std::unique_ptr<TrackerDetToDTCELinkCablingMap> pCablingMap_;
54 };
55 
58  desc.setComment("Stores a dummy TrackerDetToDTCELinkCablingMap database object from a CSV file.");
59  desc.add<long long unsigned int>("iovBeginTime", 1);
60  desc.add<std::string>("record", "TrackerDetToDTCELinkCablingMap");
61  descriptions.add("DTCCablingMapTestProducer", desc);
62 }
63 
65  : iovBeginTime_(iConfig.getParameter<long long unsigned int>("iovBeginTime")),
66  pCablingMap_(std::make_unique<TrackerDetToDTCELinkCablingMap>()),
67  recordName_(iConfig.getParameter<std::string>("record")) {}
68 
70  using namespace edm;
71  using namespace std;
72 
73  pCablingMap_->insert(DTCELinkId(101u, 1u, 2u), 11111111);
74  pCablingMap_->insert(DTCELinkId(102u, 2u, 2u), 22222222);
75  pCablingMap_->insert(DTCELinkId(103u, 3u, 3u), 33333333);
76  pCablingMap_->insert(DTCELinkId(104u, 4u, 4u), 44444444);
77 
79 
80  if (poolDbService.isAvailable())
82  else
83  throw std::runtime_error("PoolDBService required.");
84 }
85 
87 
89 
91 
92 //define this as a plug-in
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
DTCCablingMapTestProducer(const edm::ParameterSet &)
void setComment(std::string const &value)
int iEvent
Definition: GenABIO.cc:224
unsigned long long Time_t
Definition: Time.h:14
Hash writeOneIOV(const T &payload, Time_t time, const std::string &recordName)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void analyze(const edm::Event &, const edm::EventSetup &) override
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::unique_ptr< TrackerDetToDTCELinkCablingMap > pCablingMap_