Commit a0287dbf authored by Rachid Mazini's avatar Rachid Mazini
Browse files

Merge branch '21.0-ATLASSIM-5297' into '21.0'

Retry simulation if FCal cell assignment fails

See merge request !45158
parents ca029ad8 08236648
...@@ -16,12 +16,14 @@ FCSReturnCode TFCSHitCellMappingFCal::simulate_hit(Hit& hit,TFCSSimulationState& ...@@ -16,12 +16,14 @@ FCSReturnCode TFCSHitCellMappingFCal::simulate_hit(Hit& hit,TFCSSimulationState&
int cs=calosample(); int cs=calosample();
const CaloDetDescrElement* cellele=m_geo->getFCalDDE(cs,hit.x(),hit.y(),hit.z()); const CaloDetDescrElement* cellele=m_geo->getFCalDDE(cs,hit.x(),hit.y(),hit.z());
ATH_MSG_DEBUG("HIT: cellele="<<cellele<<" E="<<hit.E()<<" cs="<<cs<<" x="<<hit.x()<<" y="<<hit.y() << " z="<<hit.z()); ATH_MSG_DEBUG("HIT: cellele="<<cellele<<" E="<<hit.E()<<" cs="<<cs<<" x="<<hit.x()<<" y="<<hit.y() << " z="<<hit.z());
if(cellele) {
simulstate.deposit(cellele,hit.E());
} else {
ATH_MSG_ERROR("TFCSLateralShapeParametrizationHitCellMapping::simulate_hit: cellele="<<cellele<<" E="<<hit.E()<<" cs="<<cs<<" eta="<<hit.eta()<<" phi="<<hit.phi());
return FCSFatal;
}
/// protection against cases where hits cannot be matched to a FCal cell
if((hit.x() == 0 && hit.y() == 0) || cellele == 0) {
ATH_MSG_WARNING("TFCSLateralShapeParametrizationHitCellMapping::simulate_hit: cellele="<<cellele<<" E="<<hit.E()<<" cs="<<cs<<" eta="<<hit.eta()<<" phi="<<hit.phi());
return (FCSReturnCode)(FCSRetry+5); // retry simulation up to 5 times
}
simulstate.deposit(cellele,hit.E());
return FCSSuccess; return FCSSuccess;
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment