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

Phase2-hgx153 Bug fix for RecoGeometry in FireWorks #24599

Merged
merged 1 commit into from
Sep 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Fireworks/Geometry/src/FWRecoGeometryESProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,12 @@ FWRecoGeometryESProducer::addCaloGeometry( void )
const CaloCellGeometry::CornersVec& cor = m_caloGeom->getGeometry( *it )->getCorners();
fillPoints( id, cor.begin(), cor.end());
} else {
const HGCalGeometry* geom = dynamic_cast<const HGCalGeometry*>(m_caloGeom->getSubdetectorGeometry( *it ) );
DetId::Detector det = it->det();
int subdet = (((DetId::HGCalEE == det) ||
(DetId::HGCalHSi == det) ||
(DetId::HGCalHSc == det)) ? ForwardEmpty :
it->subdetId());
const HGCalGeometry* geom = dynamic_cast<const HGCalGeometry*>(m_caloGeom->getSubdetectorGeometry(det,subdet));
const auto cor = geom->get8Corners( *it );
fillPoints( id, cor.begin(), cor.end() );
}
Expand Down
48 changes: 24 additions & 24 deletions Geometry/HGCalGeometry/src/HGCalGeometry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ void HGCalGeometry::newCell( const GlobalPoint& f1 ,
<< " GEOM " << HGCSiliconDetId(geomId);
#endif
}
const uint32_t cellIndex (m_topology.detId2denseGeomId(detId));
const uint32_t cellIndex (m_topology.detId2denseGeomId(geomId));

if (m_det == DetId::HGCalHSc) {
m_cellVec2.at( cellIndex ) = FlatTrd( cornersMgr(), f1, f2, f3, parm ) ;
Expand Down Expand Up @@ -212,37 +212,37 @@ void HGCalGeometry::newCell( const GlobalPoint& f1 ,

std::shared_ptr<const CaloCellGeometry> HGCalGeometry::getGeometry(const DetId& id) const {
if (id == DetId()) return nullptr; // nothing to get
DetId geoId;
DetId geomId;
if ((mode_ == HGCalGeometryMode::Hexagon) ||
(mode_ == HGCalGeometryMode::HexagonFull)) {
geoId = (DetId)(HGCalDetId(id).geometryCell());
geomId = (DetId)(HGCalDetId(id).geometryCell());
} else if (mode_ == HGCalGeometryMode::Trapezoid) {
geoId = (DetId)(HGCScintillatorDetId(id).geometryCell());
geomId = (DetId)(HGCScintillatorDetId(id).geometryCell());
} else if (m_topology.isHFNose()) {
geoId = (DetId)(HFNoseDetId(id).geometryCell());
geomId = (DetId)(HFNoseDetId(id).geometryCell());
} else {
geoId = (DetId)(HGCSiliconDetId(id).geometryCell());
geomId = (DetId)(HGCSiliconDetId(id).geometryCell());
}
const uint32_t cellIndex (m_topology.detId2denseGeomId(geoId));
const GlobalPoint pos = (id != geoId) ? getPosition(id) : GlobalPoint();
const uint32_t cellIndex (m_topology.detId2denseGeomId(geomId));
const GlobalPoint pos = (id != geomId) ? getPosition(id) : GlobalPoint();
return cellGeomPtr (cellIndex, pos);

}

bool HGCalGeometry::present(const DetId& id) const {
if (id == DetId()) return false;
DetId geoId;
DetId geomId;
if ((mode_ == HGCalGeometryMode::Hexagon) ||
(mode_ == HGCalGeometryMode::HexagonFull)) {
geoId = (DetId)(HGCalDetId(id).geometryCell());
geomId = (DetId)(HGCalDetId(id).geometryCell());
} else if (mode_ == HGCalGeometryMode::Trapezoid) {
geoId = (DetId)(HGCScintillatorDetId(id).geometryCell());
geomId = (DetId)(HGCScintillatorDetId(id).geometryCell());
} else if (m_topology.isHFNose()) {
geoId = (DetId)(HFNoseDetId(id).geometryCell());
geomId = (DetId)(HFNoseDetId(id).geometryCell());
} else {
geoId = (DetId)(HGCSiliconDetId(id).geometryCell());
geomId = (DetId)(HGCSiliconDetId(id).geometryCell());
}
const uint32_t index (m_topology.detId2denseGeomId(geoId));
const uint32_t index (m_topology.detId2denseGeomId(geomId));
return (nullptr != getGeometryRawPtr(index)) ;
}

Expand Down Expand Up @@ -443,25 +443,25 @@ std::string HGCalGeometry::cellElement() const {
else return "Unknown";
}

unsigned int HGCalGeometry::indexFor(const DetId& id) const {
unsigned int HGCalGeometry::indexFor(const DetId& detId) const {
unsigned int cellIndex = ((m_det == DetId::HGCalHSc) ? m_cellVec2.size() :
m_cellVec.size());
if (id != DetId()) {
DetId geoId;
if (detId != DetId()) {
DetId geomId;
if ((mode_ == HGCalGeometryMode::Hexagon) ||
(mode_ == HGCalGeometryMode::HexagonFull)) {
geoId = (DetId)(HGCalDetId(id).geometryCell());
geomId = (DetId)(HGCalDetId(detId).geometryCell());
} else if (mode_ == HGCalGeometryMode::Trapezoid) {
geoId = (DetId)(HGCScintillatorDetId(id).geometryCell());
geomId = (DetId)(HGCScintillatorDetId(detId).geometryCell());
} else if (m_topology.isHFNose()) {
geoId = (DetId)(HFNoseDetId(id).geometryCell());
geomId = (DetId)(HFNoseDetId(detId).geometryCell());
} else {
geoId = (DetId)(HGCSiliconDetId(id).geometryCell());
geomId = (DetId)(HGCSiliconDetId(detId).geometryCell());
}
cellIndex = m_topology.detId2denseGeomId(geoId);
cellIndex = m_topology.detId2denseGeomId(geomId);
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "indexFor " << std::hex << id.rawId()
<< ":" << geoId.rawId() << std::dec
edm::LogVerbatim("HGCalGeom") << "indexFor " << std::hex << detId.rawId()
<< ":" << geomId.rawId() << std::dec
<< " index " << cellIndex;
#endif
}
Expand Down