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 {
18  findingRecord<Phase2TrackerCablingRcd>();
19  edm::LogVerbatim("Phase2TrackerCabling")
20  << "[Phase2TrackerCablingCfgESSource::" << __func__ << "]"
21  << " Constructing object...";
22 }
23 
24 // -----------------------------------------------------------------------------
25 //
27  edm::LogVerbatim("Phase2TrackerCabling")
28  << "[Phase2TrackerCablingCfgESSource::" << __func__ << "]"
29  << " Destructing object...";
30 }
31 
32 // -----------------------------------------------------------------------------
33 //
35  edm::LogVerbatim("Phase2TrackerCabling")
36  << "[Phase2TrackerCablingCfgESSource::" << __func__ << "]"
37  << " Building FED cabling map from cfg.";
38 
39  std::vector<Phase2TrackerModule> conns;
40 
41  // iterate through the parameterset and create corresponding Phase2TrackerModule
42  std::vector<edm::ParameterSet> modules = pset_.getParameterSetVector("modules");
43  uint32_t detid,gbtid,fedid,fedch,powerGroup,coolingLoop;
44  for(std::vector<edm::ParameterSet>::const_iterator it = modules.begin();it<modules.end();++it) {
45  detid = it->getParameter<uint32_t>("detid");
46  gbtid = it->getParameter<uint32_t>("gbtid");
47  fedid = it->getParameter<uint32_t>("fedid");
48  fedch = it->getParameter<uint32_t>("fedch");
49  powerGroup = it->getParameter<uint32_t>("powerGroup");
50  coolingLoop = it->getParameter<uint32_t>("coolingLoop");
52  conns.push_back(Phase2TrackerModule(type,detid,gbtid,fedid,fedch,powerGroup,coolingLoop));
53  }
54 
55  // return the cabling
56  Phase2TrackerCabling* cabling = new Phase2TrackerCabling( conns );
57  return cabling;
58 
59 }
60 
Phase2TrackerCabling * make(const Phase2TrackerCablingRcd &) override
type
Definition: HCALResponse.h:21
VParameterSet const & getParameterSetVector(std::string const &name) const
Phase2TrackerCablingCfgESSource(const edm::ParameterSet &)