Skip to content

Commit

Permalink
Update CaloSD.cc
Browse files Browse the repository at this point in the history
add proposed changes
  • Loading branch information
mrodozov committed Dec 16, 2019
1 parent e61b9fc commit 74d2913
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions SimG4CMS/Calo/src/CaloSD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,9 @@ bool CaloSD::checkHit() {
found = true;
}
} else if (nCheckedHits > 0) {
size_t minhit = (theHC->entries() > nCheckedHits ? theHC->entries() - nCheckedHits : 0);
int maxhit = theHC->entries() - 1;
int nhits = theHC->entries();
int minhit = std::max(nhits - nCheckedHits, 0);
int maxhit = - 1;

for (int j = maxhit; j > minhit; --j) {
if ((*theHC)[j]->getID() == currentID) {
Expand Down

0 comments on commit 74d2913

Please sign in to comment.