116 : geometryFileName_(iConfig.getParameter<
edm::FileInPath>(
"GeometryFileName")) {
117 viewToken_ = esConsumes<DDCompactView, IdealGeometryRecord>();
134 std::stringstream
ss;
135 ss <<
"(" << std::get<0>(coord) <<
"," << std::get<1>(coord) <<
"," << std::get<2>(coord) <<
")";
141 if (walker.
current().first.name().name() == targetName) {
158 if (walker.
current().first.name().fullname().rfind(
"hgcalwafer:", 0) == 0) {
177 if (walker.
current().first.name().fullname().rfind(
"hgcalwafer:", 0) == 0) {
180 const int copyNo = wafer.second->copyno();
189 waferInfo.
x = wafer.second->translation().x();
190 waferInfo.
y = wafer.second->translation().y();
192 std::regex_replace(waferName,
193 std::regex(
"(HGCal[EH]E)(Wafer[01])(Fine|Coarse[12])([a-z]*)([0-9]*)"),
195 std::regex_constants::format_no_copy);
196 std::stringstream
ss(waferNameData);
201 ss >> EEorHE >> typeStr >> shapeStr >> rotStr;
203 if (shapeStr.empty())
207 const int rotCode(std::stoi(rotStr));
225 if (!viewH.isValid()) {
234 auto eeWalker = viewH->walker();
235 const bool eeFound =
DDFindHGCal(eeWalker,
"HGCalEE");
246 auto hesilWalker = viewH->walker();
247 const bool hesilFound =
DDFindHGCal(hesilWalker,
"HGCalHEsil");
258 auto hemixWalker = viewH->walker();
259 const bool hemixFound =
DDFindHGCal(hemixWalker,
"HGCalHEmix");
270 if (!(eeFound || hesilFound || hemixFound)) {
301 int nTotalProcessed = 0;
305 int nThicknessError = 0;
310 int nUnaccounted = 0;
315 while (std::getline(geoTxtFile,
buf)) {
316 std::stringstream
ss(
buf);
317 std::vector<std::string> tokens;
320 tokens.push_back(
buf);
321 if (tokens.size() != 8)
329 const int waferThickness(std::stoi(tokens[2]));
330 const double waferX(std::stod(tokens[3]));
331 const double waferY(std::stod(tokens[4]));
332 const int waferRotCode(std::stoi(tokens[5]));
333 const int waferU(std::stoi(tokens[6]));
334 const int waferV(std::stoi(tokens[7]));
350 if ((waferInfo.
thickClass == 0 && waferThickness != 120) || (waferInfo.
thickClass == 1 && waferThickness != 200) ||
351 (waferInfo.
thickClass == 2 && waferThickness != 300)) {
357 if (fabs(-waferInfo.
x - waferX) > 0.015) {
362 if (fabs(waferInfo.
y - waferY) > 0.015) {
367 if (waferInfo.
shapeCode != waferShapeCode) {
372 if ((waferShapeCode !=
'F' && waferInfo.
rotCode != waferRotCode) ||
373 (waferShapeCode ==
'F' && (waferInfo.
rotCode % 2 != waferRotCode % 2))) {
376 <<
" != " << waferRotCode <<
" )";
384 if (!accounted.second) {
405 if (nMissing > 0 || nThicknessError > 0 || nPosXError > 0 || nPosYError > 0 || nShapeError > 0 || nRotError > 0 ||
427 edm::FileInPath(
"Validation/HGCalValidation/data/geomnew_corrected_360.txt"));
428 descriptions.
add(
"hgcalWaferValidation",
desc);