Skip to content

Commit

Permalink
Merge pull request #28868 from bsunanda/Run3-hcx249
Browse files Browse the repository at this point in the history
Run3 hcx249 Test and verify HcalParameter correctly extracted in the dd4hep scenario
  • Loading branch information
cmsbuild committed Feb 7, 2020
2 parents 736475d + 95e65b1 commit 67c2c38
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 0 additions & 2 deletions DetectorDescription/DDCMS/src/Filter.cc
Expand Up @@ -12,8 +12,6 @@ namespace cms {
if (!isRegex(name)) {
return (name == node);
} else {
if (name.front() != node.front())
return false;
regex pattern({name.data(), name.size()});
return regex_match(begin(node), end(node), pattern);
}
Expand Down
7 changes: 4 additions & 3 deletions Geometry/HcalCommonData/src/HcalGeomParameters.cc
Expand Up @@ -52,6 +52,9 @@ void HcalGeomParameters::loadGeometry(const DDFilteredView& _fv, HcalParameters&
lay = copy[nsiz - 1] / 10;
if (nsiz > 1)
idet = copy[nsiz - 2] / 1000;
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HCalGeom") << "Name " << fv.logicalPart().solid().name() << " Copy " << copy.size();
#endif
double dx = 0, dy = 0, dz = 0, dx1 = 0, dx2 = 0;
double alp(0);
if (sol.shape() == DDSolidShape::ddbox) {
Expand Down Expand Up @@ -241,9 +244,8 @@ void HcalGeomParameters::loadGeometry(const cms::DDCompactView* cpv, HcalParamet
mypar.filter(ref, attribute, "HCAL");
fv.mergedSpecifics(ref);
clear(php);
bool dodet = fv.firstChild();
bool hf(false);
while (dodet) {
while (fv.firstChild()) {
auto t = fv.translation();
std::vector<double> paras = fv.parameters();
std::vector<int> copy = fv.copyNos();
Expand Down Expand Up @@ -436,7 +438,6 @@ void HcalGeomParameters::loadGeometry(const cms::DDCompactView* cpv, HcalParamet
<< (HcalGeomParameters::k_ScaleFromDD4HepToG4 * t.z());
#endif
}
dodet = fv.firstChild();
}
loadfinal(php);
}
Expand Down
6 changes: 4 additions & 2 deletions Geometry/HcalCommonData/src/HcalSimParametersFromDD.cc
Expand Up @@ -146,10 +146,12 @@ bool HcalSimParametersFromDD::build(const cms::DDCompactView* cpv, HcalSimulatio
fv2.mergedSpecifics(ref2);

while (fv2.firstChild()) {
const std::string name{fv2.name().data(), fv2.name().size()};
const std::string matName{cms::dd::noNamespace(fv2.materialName()).data(),
cms::dd::noNamespace(fv2.materialName()).size()};
if (!isItHF(name, php) &&
std::vector<int> copy = fv2.copyNos();
// idet = 3 for HB and 4 for HE (convention in the ddalgo code for HB/HE)
int idet = (copy.size() > 1) ? (copy[1] / 1000) : 0;
if (((idet == 3) || (idet == 4)) &&
std::find(std::begin(php.hcalMaterialNames_), std::end(php.hcalMaterialNames_), matName) ==
std::end(php.hcalMaterialNames_)) {
php.hcalMaterialNames_.emplace_back(matName);
Expand Down
Expand Up @@ -7,6 +7,7 @@

if hasattr(process,'MessageLogger'):
process.MessageLogger.categories.append('HCalGeom')
process.MessageLogger.categories.append('Geometry')

process.source = cms.Source("EmptySource")
process.maxEvents = cms.untracked.PSet(
Expand Down

0 comments on commit 67c2c38

Please sign in to comment.