5#include "CLHEP/Random/RandPoisson.h"
31 double stochastic_hadron,
43 float energy = simulstate.
E(cs);
49 if (TMath::IsNaN(energy)) {
54 double sqrtE = sqrt(energy / 1000.0);
60 double sigma_hadron =
m_constant + sigma_stochastic_hadron;
64 sigma_stochastic * sigma_stochastic + sigma_hadron * sigma_hadron;
79 int hits = CLHEP::RandPoisson::shoot(simulstate.
randomEngine(), 1.0 / sigma2);
103 <<
IsA()->GetName() <<
" != " <<
ref.IsA()->GetName());
111 ATH_MSG_DEBUG(
"operator==(): different fluctuation model sigma^2=["
114 <<
"/sqrt(E/GeV)]^2 != sigma^2=[" << ref_typed.
m_stochastic
115 <<
"/sqrt(E/GeV)]^2 + [" << ref_typed.
m_constant <<
" + "
124 Option_t *option)
const {
126 bool shortprint = opt.Index(
"short") >= 0;
127 bool longprint =
msgLvl(MSG::DEBUG) || (
msgLvl(MSG::INFO) && !shortprint);
128 TString optprint = opt;
129 optprint.ReplaceAll(
"short",
"");
134 <<
"/sqrt(E/GeV)]^2 + [" <<
m_constant <<
" + "
const boost::regex ref(r_ef)
bool msgLvl(const MSG::Level lvl) const
Check whether the logging system is active at the provided verbosity level.
TFCSLateralShapeParametrizationHitBase(const char *name=nullptr, const char *title=nullptr)
virtual bool operator==(const TFCSParametrizationBase &ref) const override
The == operator compares the content of instances.
int get_number_of_hits(TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) const override
Call get_number_of_hits() only once per shower simulation, as it could be calculated with random numb...
double get_sigma2_fluctuation(TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) const override
Give the effective size sigma^2 of the fluctuations from the stochastic and constant term.
void Print(Option_t *option="") const override
TFCSLateralShapeParametrizationHitNumberFromE(const char *name=nullptr, const char *title=nullptr, double stochastic=0.1, double constant=0)
LAr: 10.1%/sqrt(E) stochastic=0.101; constant=0.002; HadEC: 21.4%/sqrt(E) stochastic=0....
double m_stochastic_hadron
bool compare(const TFCSParametrizationBase &ref) const
void Print(Option_t *option="") const override
bool compare(const TFCSParametrizationBase &ref) const
virtual void set_match_all_pdgid()
bool compare(const TFCSParametrizationBase &ref) const
Do not persistify!
bool compare(const TFCSParametrizationBase &ref) const
CLHEP::HepRandomEngine * randomEngine()
#define IsA
Declare the TObject style functions.