36 const int pdgId = truth->
pdgid();
37 const double charge = HepPDT::ParticleID(pdgId).charge();
46 const double center_r = hit.
center_r();
47 const double center_z = hit.
center_z();
49 float alpha,
r, rnd1, rnd2;
50 rnd1 = CLHEP::RandFlat::shoot(simulstate.
randomEngine());
51 rnd2 = CLHEP::RandFlat::shoot(simulstate.
randomEngine());
56 m_hist.rnd_to_fct(alpha,
r, rnd1, rnd2);
60 m_hist.rnd_to_fct(alpha,
r, rnd1, rnd2);
63 m_hist.rnd_to_fct(alpha,
r, rnd1, rnd2);
65 if (TMath::IsNaN(alpha) || TMath::IsNaN(
r)) {
67 <<
m_hist.get_HistoBordersx().size() - 1 <<
"*"
68 <<
m_hist.get_HistoBordersy().size() - 1
69 <<
" bins, #hits=" <<
m_nhits <<
" alpha=" << alpha
70 <<
" r=" <<
r <<
" rnd1=" << rnd1 <<
" rnd2=" << rnd2);
78 const float hit_r =
r * cos(alpha) + center_r;
79 float delta_phi =
r * sin(alpha) / center_r;
83 if ((
charge < 0. && pdgId!=11) || pdgId==-11)
84 delta_phi = -delta_phi;
85 const float hit_phi = delta_phi + center_phi;
87 hit.
setXYZE(hit_r * cos(hit_phi), hit_r * sin(hit_phi), center_z, hit.
E());
90 <<
" y=" << hit.
y() <<
" z=" << hit.
z() <<
" r=" <<
r
91 <<
" alpha=" << alpha);
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...