CMS 3D CMS Logo

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 
38 
40 {
41  public:
43  ~DTCCablingMapTestProducer() override;
44 
45  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
46 
47  private:
48  void beginJob() override;
49  void analyze(const edm::Event&, const edm::EventSetup&) override;
50  void endJob() override;
51 private:
53  std::unique_ptr<TrackerDetToDTCELinkCablingMap> pCablingMap_ ;
55 };
56 
58 {
60  desc.setComment("Stores a dummy TrackerDetToDTCELinkCablingMap database object from a CSV file.");
61  desc.add<long long unsigned int>("iovBeginTime", 1);
62  desc.add<std::string>("record","TrackerDetToDTCELinkCablingMap");
63  descriptions.add("DTCCablingMapTestProducer", desc);
64 }
65 
67  iovBeginTime_(iConfig.getParameter<long long unsigned int>("iovBeginTime")),
69  recordName_ (iConfig.getParameter<std::string>("record"))
70 {
71 
72 }
73 
75 {
76  using namespace edm;
77  using namespace std;
78 
79  pCablingMap_->insert(DTCELinkId(101u,1u,2u), 11111111);
80  pCablingMap_->insert(DTCELinkId(102u,2u,2u), 22222222);
81  pCablingMap_->insert(DTCELinkId(103u,3u,3u), 33333333);
82  pCablingMap_->insert(DTCELinkId(104u,4u,4u), 44444444);
83 
85 
86  if( poolDbService.isAvailable() )
87  poolDbService->writeOne( pCablingMap_.release(), iovBeginTime_, recordName_ );
88  else
89  throw std::runtime_error("PoolDBService required.");
90 }
91 
92 
94 {
95 
96 }
97 
99 {
100 
101 }
102 
104 {
105 
106 }
107 
108 //define this as a plug-in
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
DTCCablingMapTestProducer(const edm::ParameterSet &)
void setComment(std::string const &value)
int iEvent
Definition: GenABIO.cc:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
unsigned long long Time_t
Definition: Time.h:16
bool isAvailable() const
Definition: Service.h:40
void writeOne(T *payload, Time_t time, const std::string &recordName, bool withlogging=false)
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)
HLT enums.
std::unique_ptr< TrackerDetToDTCELinkCablingMap > pCablingMap_