diff --git a/Calorimeter/CaloRec/src/CaloClusterMomentsMaker.cxx b/Calorimeter/CaloRec/src/CaloClusterMomentsMaker.cxx index ff4c32a6ead37eba7a16d342494af6c37f3a6eb7..7ebcf71ff79d4fda079bf6f0215ab61d3954c28d 100644 --- a/Calorimeter/CaloRec/src/CaloClusterMomentsMaker.cxx +++ b/Calorimeter/CaloRec/src/CaloClusterMomentsMaker.cxx @@ -538,11 +538,11 @@ CaloClusterMomentsMaker::execute(const EventContext& ctx, ncell++; } } //end of loop over all cells - - const auto hvFrac=m_larHVFraction->getLArHVFrac(theCluster->getCellLinks(),ctx); - eBadLArHV= hvFrac.first; - nBadLArHV=hvFrac.second; - + if (m_calculateLArHVFraction) { + const auto hvFrac=m_larHVFraction->getLArHVFrac(theCluster->getCellLinks(),ctx); + eBadLArHV= hvFrac.first; + nBadLArHV=hvFrac.second; + } if ( w > 0 ) { mass = w*w - mx*mx - my*my - mz*mz;