Skip to content
Snippets Groups Projects
Commit 053ac417 authored by Tadej Novak's avatar Tadej Novak
Browse files

FCS: Only simulate one hit if energy is negative

Former-commit-id: 3088d5920b46add53497e87e32a596d51d331a77
parent 9c9b2c4a
No related branches found
No related tags found
No related merge requests found
......@@ -28,6 +28,10 @@ int TFCSLateralShapeParametrizationHitNumberFromE::get_number_of_hits(TFCSSimula
int cs=calosample();
double energy=simulstate.E(cs);
if (energy < 0) {
return 1;
}
double sigma_stochastic=m_stochastic/sqrt(energy/1000.0);
int hits = CLHEP::RandPoisson::shoot(simulstate.randomEngine(), 1.0 / (sigma_stochastic*sigma_stochastic + m_constant*m_constant));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment