CMS 3D CMS Logo

TrackerParametersFromDD.cc
Go to the documentation of this file.
8 
10  for (int subdet = 1; subdet <= 6; ++subdet) {
11  std::stringstream sstm;
12  sstm << "Subdetector" << subdet;
13  std::string name = sstm.str();
14 
16  std::vector<int> subdetPars = dbl_to_int(DDVectorGetter::get(name));
17  putOne(subdet, subdetPars, ptp);
18  }
19  }
20 
21  ptp.vpars = dbl_to_int(DDVectorGetter::get("vPars"));
22 
23  return true;
24 }
25 
27  cms::DDVectorsMap vmap = cvp->detector()->vectors();
28  for (int subdet = 1; subdet <= 6; ++subdet) {
29  std::stringstream sstm;
30  sstm << "Subdetector" << subdet;
31  std::string name = sstm.str();
32  for (auto const& it : vmap) {
34  std::vector<int> subdetPars;
35  for (const auto& i : it.second)
36  subdetPars.emplace_back(std::round(i));
37  putOne(subdet, subdetPars, ptp);
38  }
39  }
40  }
41 
42  auto it = vmap.find("vPars");
43  if (it != end(vmap)) {
44  std::vector<int> tmpVec;
45  for (const auto& i : it->second)
46  tmpVec.emplace_back(std::round(i));
47  ptp.vpars = tmpVec;
48  }
49 
50  return true;
51 }
52 
53 void TrackerParametersFromDD::putOne(int subdet, std::vector<int>& vpars, PTrackerParameters& ptp) {
55  item.id = subdet;
56  item.vpars = vpars;
57  ptp.vitems.emplace_back(item);
58 }
DDVectorGetter.h
TrackerParametersFromDD.h
mps_fire.i
i
Definition: mps_fire.py:355
TrackerParametersFromDD::putOne
void putOne(int, std::vector< int > &, PTrackerParameters &)
Definition: TrackerParametersFromDD.cc:53
PTrackerParameters
Definition: PTrackerParameters.h:6
cms::DDVectorsMap
tbb::concurrent_unordered_map< std::string, tbb::concurrent_vector< double > > DDVectorsMap
Definition: DDNamespace.h:14
PTrackerParameters.h
dbl_to_int
std::vector< int > dbl_to_int(const std::vector< double > &vecdbl)
Converts a std::vector of doubles to a std::vector of int.
Definition: DDutils.h:7
DDCompactView.h
DDVectorGetter::get
std::vector< double > get(const std::string &)
Definition: DDVectorGetter.h:28
end
#define end
Definition: vmac.h:39
DDCompactView
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:80
cms::dd::noNamespace
std::string_view noNamespace(std::string_view)
Definition: Filter.cc:63
DDCompactView.h
PTrackerParameters::vitems
std::vector< Item > vitems
Definition: PTrackerParameters.h:18
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DDVectorGetter::check
bool check(const std::string &)
Definition: DDVectorGetter.h:13
PTrackerParameters::vpars
std::vector< int > vpars
Definition: PTrackerParameters.h:19
DDutils.h
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
cms::dd::compareEqual
bool compareEqual(std::string_view, std::string_view)
cms::DDCompactView
Definition: DDCompactView.h:29
TrackerParametersFromDD::build
bool build(const DDCompactView *, PTrackerParameters &)
Definition: TrackerParametersFromDD.cc:9
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
cms::DDDetector::vectors
DDVectorsMap const & vectors() const
Definition: DDDetector.h:22
PTrackerParameters::Item
Definition: PTrackerParameters.h:11
cms::DDCompactView::detector
const cms::DDDetector * detector() const
Definition: DDCompactView.h:32
Filter.h