CMS 3D CMS Logo

Phase2TrackerCablingCfgESSource.cc
Go to the documentation of this file.
9 #include <sstream>
10 #include <vector>
11 #include <map>
12 
13 // -----------------------------------------------------------------------------
14 //
16  : Phase2TrackerCablingESProducer(pset), pset_(pset) {
17  findingRecord<Phase2TrackerCablingRcd>();
18  edm::LogVerbatim("Phase2TrackerCabling") << "[Phase2TrackerCablingCfgESSource::" << __func__ << "]"
19  << " Constructing object...";
20 }
21 
22 // -----------------------------------------------------------------------------
23 //
25  edm::LogVerbatim("Phase2TrackerCabling") << "[Phase2TrackerCablingCfgESSource::" << __func__ << "]"
26  << " Destructing object...";
27 }
28 
29 // -----------------------------------------------------------------------------
30 //
32  edm::LogVerbatim("Phase2TrackerCabling") << "[Phase2TrackerCablingCfgESSource::" << __func__ << "]"
33  << " Building FED cabling map from cfg.";
34 
35  std::vector<Phase2TrackerModule> conns;
36 
37  // iterate through the parameterset and create corresponding Phase2TrackerModule
38  std::vector<edm::ParameterSet> modules = pset_.getParameterSetVector("modules");
39  uint32_t detid, gbtid, fedid, fedch, powerGroup, coolingLoop;
40  for (std::vector<edm::ParameterSet>::const_iterator it = modules.begin(); it < modules.end(); ++it) {
41  detid = it->getParameter<uint32_t>("detid");
42  gbtid = it->getParameter<uint32_t>("gbtid");
43  fedid = it->getParameter<uint32_t>("fedid");
44  fedch = it->getParameter<uint32_t>("fedch");
45  powerGroup = it->getParameter<uint32_t>("powerGroup");
46  coolingLoop = it->getParameter<uint32_t>("coolingLoop");
48  it->getParameter<std::string>("moduleType") == "2S" ? Phase2TrackerModule::SS : Phase2TrackerModule::PS;
49  conns.push_back(Phase2TrackerModule(type, detid, gbtid, fedid, fedch, powerGroup, coolingLoop));
50  }
51 
52  // return the cabling
53  Phase2TrackerCabling* cabling = new Phase2TrackerCabling(conns);
54  return cabling;
55 }
Phase2TrackerCabling * make(const Phase2TrackerCablingRcd &) override
type
Definition: HCALResponse.h:21
VParameterSet const & getParameterSetVector(std::string const &name) const
Phase2TrackerCablingCfgESSource(const edm::ParameterSet &)