Skip to content

Commit

Permalink
Merge pull request #23660 from kpedro88/Phase2-WF45val-fix1
Browse files Browse the repository at this point in the history
bug fix for case with SimClusters but no RecHits
  • Loading branch information
cmsbuild committed Jun 25, 2018
2 parents 5c50974 + 7034294 commit 017a7d5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
1 change: 1 addition & 0 deletions RecoLocalCalo/HGCalRecAlgos/interface/RecHitTools.h
Expand Up @@ -58,6 +58,7 @@ namespace hgcal {
unsigned int lastLayerEE() const {return fhOffset_;}
unsigned int lastLayerFH() const {return bhOffset_;}
unsigned int maxNumberOfWafersPerLayer() const {return maxNumberOfWafersPerLayer_;}
inline int getGeometryType() const {return geometryType_;}
private:
const CaloGeometry* geom_;
unsigned int fhOffset_, bhOffset_, maxNumberOfWafersPerLayer_;
Expand Down
Expand Up @@ -66,14 +66,8 @@ void RealisticSimClusterMapper::buildClusters(const edm::Handle<reco::PFRecHitCo
{
const SimClusterCollection& simClusters = *simClusterH_;
auto const& hits = *input;
if(hits.empty()) return;
RealisticHitToClusterAssociator realisticAssociator;
int geometryType = 0;
if(DetId(hits[0].detId()).det()==DetId::HGCalEE or
DetId(hits[0].detId()).det()==DetId::HGCalHSi or
DetId(hits[0].detId()).det()==DetId::HGCalHSc)
{ geometryType = 1; }
const int numberOfLayers = geometryType==0 ? rhtools_.getLayer(ForwardSubdetector::ForwardEmpty) : rhtools_.getLayer(DetId::Forward);
const int numberOfLayers = rhtools_.getGeometryType()==0 ? rhtools_.getLayer(ForwardSubdetector::ForwardEmpty) : rhtools_.getLayer(DetId::Forward);
realisticAssociator.init(hits.size(), simClusters.size(), numberOfLayers + 1);
// for quick indexing back to hit energy
std::unordered_map < uint32_t, size_t > detIdToIndex(hits.size());
Expand Down

0 comments on commit 017a7d5

Please sign in to comment.