CMS 3D CMS Logo

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