5 #include "CLHEP/Random/RandFlat.h"
6 #include "CLHEP/Random/RandGaussZiggurat.h"
36 const double center_r = hit.
center_r();
37 const double center_z = hit.
center_z();
39 const float dist000 = TMath::Sqrt(center_r * center_r + center_z * center_z);
40 const float eta_jakobi = TMath::Abs(2.0 * TMath::Exp(-center_eta) /
41 (1.0 + TMath::Exp(-2 * center_eta)));
43 const float delta_eta = hit.
eta() - center_eta;
45 const float delta_eta_mm = delta_eta * eta_jakobi * dist000;
46 const float delta_phi_mm =
delta_phi * center_r;
47 const float delta_r_mm =
48 TMath::Sqrt(delta_eta_mm * delta_eta_mm + delta_phi_mm * delta_phi_mm);
57 float meanweight =
m_hist->GetBinContent(
bin);
61 float logweight = CLHEP::RandGaussZiggurat::shoot(simulstate.
randomEngine(),
63 weight *= TMath::Exp(logweight);
65 if (meanweight <= 1) {
74 float prob = 1.0 / meanweight;
75 float rnd = CLHEP::RandFlat::shoot(simulstate.
randomEngine());
83 <<
" meanweight=" << meanweight