Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run3 hcx249 Test and verify HcalParameter correctly extracted in the dd4hep scenario #28868

Merged
merged 5 commits into from Feb 7, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
5 changes: 3 additions & 2 deletions Geometry/HcalCommonData/src/HcalSimParametersFromDD.cc
Expand Up @@ -146,10 +146,11 @@ 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();
int idet = (copy.size() > 1) ? (copy[1] / 1000) : 0;
if (((idet == 3) || (idet == 4)) &&
bsunanda marked this conversation as resolved.
Show resolved Hide resolved
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