18 const std::vector<std::string>& fvec =
val.strings();
20 throw cms::Exception(
"MTDParametersFromDD") <<
"Failed to get " <<
s <<
" tag.";
25 result = static_cast<int>(eparser);
28 throw cms::Exception(
"MTDParametersFromDD") <<
"Failed to get " <<
s <<
" tag.";
34 std::array<std::string, 2> mtdSubdet{{
"BTL",
"ETL"}};
36 for (
const auto&
name : mtdSubdet) {
41 putOne(subdet, subdetPars, ptp);
56 topoMode = getMTDTopologyMode(
"TopologyMode",
sv);
59 throw cms::Exception(
"MTDParametersFromDD") <<
"Not found " << attribute.c_str() <<
" but needed.";
63 std::array<std::string, 8> etlLayout{{
64 "StartCopyNo_Front_Left",
65 "StartCopyNo_Front_Right",
66 "StartCopyNo_Back_Left",
67 "StartCopyNo_Back_Right",
74 for (
const auto&
name : etlLayout) {
79 putOne(sector, ipos, ptp);
92 std::array<std::string, 2> mtdSubdet{{
"BTL",
"ETL"}};
94 for (
const auto&
name : mtdSubdet) {
96 for (
auto const& it : vmap) {
97 if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first),
name)) {
99 std::vector<int> subdetPars;
100 for (
const auto&
i : it.second)
101 subdetPars.emplace_back(std::round(
i));
102 putOne(subdet, subdetPars, ptp);
108 throw cms::Exception(
"MTDParametersFromDD") <<
"Not found " <<
name <<
" but needed.";
112 auto it = vmap.find(
"vPars");
113 if (it !=
end(vmap)) {
114 std::vector<int> tmpVec;
115 for (
const auto&
i : it->second)
116 tmpVec.emplace_back(std::round(
i));
123 mypar.filter(ref, attribute,
"MTD");
125 std::string topoModeS(mypar.specPar(
"mtdNumbering")->strValue(
"TopologyMode"));
127 if (!topoModeS.empty()) {
129 topoMode = static_cast<int>(eparser);
132 throw cms::Exception(
"MTDParametersFromDD") <<
"Not found " << attribute.c_str() <<
" but needed.";
136 std::array<std::string, 8> etlLayout{{
137 "StartCopyNo_Front_Left",
138 "StartCopyNo_Front_Right",
139 "StartCopyNo_Back_Left",
140 "StartCopyNo_Back_Right",
142 "Offset_Front_Right",
147 for (
const auto&
name : etlLayout) {
149 for (
auto const& it : vmap) {
150 if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first),
name)) {
152 std::vector<int> ipos;
153 for (
const auto&
i : it.second)
154 ipos.emplace_back(std::round(
i));
155 putOne(sector, ipos, ptp);
161 throw cms::Exception(
"MTDParametersFromDD") <<
"Not found " <<
name <<
" but needed.";
175 auto print_item = [&]() {
176 std::stringstream
ss;
177 ss <<
item.id_ <<
" with " <<
item.vpars_.size() <<
" elements:";
178 for (
const auto& thePar :
item.vpars_) {
183 edm::LogInfo(
"MTDParametersFromDD") <<
"Adding PMTDParameters item: " << print_item();