5#include "CLHEP/Random/RandFlat.h"
6#include "CLHEP/Random/RandPoisson.h"
22 const char *name,
const char *title)
58 const double center_r = hit.
center_r();
59 const double center_z = hit.
center_z();
61 if (TMath::IsNaN(center_r) or TMath::IsNaN(center_z) or
62 TMath::IsNaN(center_eta) or
63 TMath::IsNaN(center_phi)) {
69 alpha = 2 * TMath::Pi() * CLHEP::RandFlat::shoot(simulstate.
randomEngine());
72 float delta_eta =
r * cos(alpha);
73 float delta_phi =
r * sin(alpha);
75 hit.
setEtaPhiZE(center_eta + delta_eta, center_phi + delta_phi, center_z,
79 <<
" phi=" << hit.
phi() <<
" z=" << hit.
z()
80 <<
" r=" <<
r <<
" alpha=" << alpha);
87 bool shortprint = opt.Index(
"short") >= 0;
88 bool longprint =
msgLvl(MSG::DEBUG) || (
msgLvl(MSG::INFO) && !shortprint);
89 TString optprint = opt;
90 optprint.ReplaceAll(
"short",
"");
FCSReturnCode
Base class for all FastCaloSim parametrizations Functionality in derivde classes is provided through ...
bool msgLvl(const MSG::Level lvl) const
Check whether the logging system is active at the provided verbosity level.
virtual FCSReturnCode simulate_hit(Hit &hit, TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) override
simulated one hit position with weight that should be put into simulstate sometime later all hit weig...
virtual int get_number_of_hits(TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) const override
default for this class is to simulate poisson(integral histogram) hits
void set_dR(float _dR)
set the radius in which hits should be generated
void set_number_of_hits(float nhits)
set the integral of the histogram to the desired number of hits
TFCSFlatLateralShapeParametrization(const char *name=nullptr, const char *title=nullptr)
virtual void Print(Option_t *option="") const override
void set_scale(float _scale)
set the radius in which hits should be generated
virtual ~TFCSFlatLateralShapeParametrization()
float m_dR
Simulate hits flat in radius dR.
void setEtaPhiZE(float eta, float phi, float z, float E)
TFCSLateralShapeParametrizationHitBase(const char *name=nullptr, const char *title=nullptr)
void Print(Option_t *option="") const override
CLHEP::HepRandomEngine * randomEngine()