Skip to content

Commit

Permalink
Merge pull request cms-sw#36765 from watson-ij/gem-demo-chamber-warni…
Browse files Browse the repository at this point in the history
…ngs-off

Turn off warnings for missing chamber in GEM GE2/1 demonstrator geometry
  • Loading branch information
cmsbuild authored Jan 21, 2022
2 parents a0ee157 + 8e4ae64 commit 9c3a5ca
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions Geometry/GEMGeometryBuilder/src/GEMGeometryBuilder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ void GEMGeometryBuilder::build(GEMGeometry& theGeometry,
}
}

buildRegions(theGeometry, superChambers);
buildRegions(theGeometry, superChambers, demonstratorGeometry);
}

GEMSuperChamber* GEMGeometryBuilder::buildSuperChamber(DDFilteredView& fv, GEMDetId detId) const {
Expand Down Expand Up @@ -437,7 +437,7 @@ void GEMGeometryBuilder::build(GEMGeometry& theGeometry,
theGeometry.add(gemChamber);
}

buildRegions(theGeometry, superChambers);
buildRegions(theGeometry, superChambers, demonstratorGeometry);
}

GEMSuperChamber* GEMGeometryBuilder::buildSuperChamber(cms::DDFilteredView& fv, GEMDetId detId) const {
Expand Down Expand Up @@ -555,7 +555,9 @@ GEMGeometryBuilder::RCPBoundPlane GEMGeometryBuilder::boundPlane(const cms::DDFi
return RCPBoundPlane(new BoundPlane(posResult, rotResult, bounds));
}

void GEMGeometryBuilder::buildRegions(GEMGeometry& theGeometry, const std::vector<GEMSuperChamber*>& superChambers) {
void GEMGeometryBuilder::buildRegions(GEMGeometry& theGeometry,
const std::vector<GEMSuperChamber*>& superChambers,
bool demonstratorGeometry) {
// construct the regions, stations and rings.
for (int re = -1; re <= 1; re = re + 2) {
GEMRegion* region = new GEMRegion(re);
Expand All @@ -582,7 +584,11 @@ void GEMGeometryBuilder::buildRegions(GEMGeometry& theGeometry, const std::vecto
GEMDetId chId(detId.region(), detId.ring(), detId.station(), la, detId.chamber(), 0);
auto chamber = theGeometry.chamber(chId);
if (!chamber) {
edm::LogWarning("GEMGeometryBuilder") << "Missing chamber " << chId;
// this particular layer 1 chamber *should* be missing in the demonstrator geometry (we only have layer 2)
if (!demonstratorGeometry or
not(chId.region() == 1 and chId.station() == 2 and chId.chamber() == 16 and chId.layer() == 1)) {
edm::LogWarning("GEMGeometryBuilder") << "Missing chamber " << chId;
}
} else {
superChamber->add(chamber);
}
Expand Down
2 changes: 1 addition & 1 deletion Geometry/GEMGeometryBuilder/src/GEMGeometryBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class GEMGeometryBuilder {
GEMEtaPartition* buildEtaPartition(cms::DDFilteredView& fv, GEMDetId detId) const;

// Common
void buildRegions(GEMGeometry&, const std::vector<GEMSuperChamber*>&);
void buildRegions(GEMGeometry&, const std::vector<GEMSuperChamber*>&, bool demonstratorGeometry);

static constexpr double k_ScaleFromDD4hep = (1.0 / dd4hep::cm);
};
Expand Down

0 comments on commit 9c3a5ca

Please sign in to comment.