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

bug fix for case with SimClusters but no RecHits #23660

Merged
merged 1 commit into from
Jun 25, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions RecoLocalCalo/HGCalRecAlgos/interface/RecHitTools.h
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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