5#include "CLHEP/Random/RandFlat.h"
6#include "CLHEP/Random/RandGaussZiggurat.h"
20 const char *name,
const char *title)
38 const double center_r = hit.
center_r();
39 const double center_z = hit.
center_z();
41 const float dist000 = TMath::Sqrt(center_r * center_r + center_z * center_z);
42 const float eta_jakobi = TMath::Abs(2.0 * TMath::Exp(-center_eta) /
43 (1.0 + TMath::Exp(-2 * center_eta)));
45 const float delta_eta = hit.
eta() - center_eta;
46 const float delta_phi = hit.
phi() - center_phi;
47 const float delta_eta_mm = delta_eta * eta_jakobi * dist000;
48 const float delta_phi_mm = delta_phi * center_r;
49 const float delta_r_mm =
50 TMath::Sqrt(delta_eta_mm * delta_eta_mm + delta_phi_mm * delta_phi_mm);
59 float weight =
m_hist->GetBinContent(
bin);
62 float logweight = CLHEP::RandGaussZiggurat::shoot(simulstate.
randomEngine(),
63 -0.5 * RMS * RMS, RMS);
64 weight *= TMath::Exp(logweight);
69 <<
" weight=" << weight);
76void TFCSHistoLateralShapeGausLogWeight::LoadHist() {
81 m_LdFH =
new LoadGpuHist();
89 for (
int ibin = 0; ibin < fh1d.
nbins; ++ibin) {
96 m_LdFH->set_hf1d(&fh1d);
FCSReturnCode
Base class for all FastCaloSim parametrizations Functionality in derivde classes is provided through ...
virtual ~TFCSHistoLateralShapeGausLogWeight()
virtual FCSReturnCode simulate_hit(Hit &hit, TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) override
weight the energy of one hit in order to generate fluctuations
TFCSHistoLateralShapeGausLogWeight(const char *name=nullptr, const char *title=nullptr)
TFCSHistoLateralShapeWeight(const char *name=nullptr, const char *title=nullptr)
TH1 * m_hist
Histogram to be used for the shape simulation The histogram x-axis should be in dR^2=deta^2+dphi^2.
CLHEP::HepRandomEngine * randomEngine()