47 CLHEP::HepRandomEngine* rndm_engine,
48 const EventContext& ctx)
const {
50 const SiHit& hit = *timed_hit_ptr;
55 float tof_expected = element->
center().norm() / Gaudi::Units::c_light;
58 << hit.
meanTime() <<
", tof =" << time_of_flight
59 <<
", tof exp =" << tof_expected);
89 ATH_MSG_DEBUG(
"x and y, z are: " << element_center.x() <<
", "
90 << element_center.y() <<
", "
91 << element_center.z());
92 float element_r = sqrt(element_center.x() * element_center.x() +
93 element_center.y() * element_center.y());
102 CLHEP::Hep3Vector direction = end_pos - start_pos;
103 float deposit_length = direction.mag();
107 if (deposit_length > 1.e-10) {
108 direction.setMag(deposit_length /
static_cast<float>(n_steps));
113 const float tot_charge = tot_eloss / (3.62 * CLHEP::eV) * Gaudi::Units::eplus;
115 float charge_per_step = tot_charge /
static_cast<float>(n_steps);
119 ATH_MSG_DEBUG(
">>>>>>> before processing, event_t, t, E, r: "
121 << tot_eloss <<
", " << element_r);
124 time_of_flight += CLHEP::RandGaussZiggurat::shoot(
129 ATH_MSG_DEBUG(
">>>>>>> after processing, t: " << time_of_flight);
134 float xphi_offset = 9.75;
135 float xeta_offset = 19.5;
137 float interpad = 50 * CLHEP::micrometer;
139 for (
int i_step = 0; i_step < n_steps; i_step++) {
140 CLHEP::Hep3Vector surface_pos = start_pos + i_step * direction;
142 <<
", y=" << surface_pos.y()
143 <<
", z=" << surface_pos.z());
156 0.5 * sensor_thickness - readout_side * surface_pos[
SiHit::xDep];
167 rdif * CLHEP::RandGaussZiggurat::shoot(rndm_engine);
169 rdif * CLHEP::RandGaussZiggurat::shoot(rndm_engine);
172 if (fabs(surf_pos_xphi) > xphi_offset or
173 fabs(surf_pos_xeta) > xeta_offset) {
178 int bin_xphi = floor(fabs(surf_pos_xphi + xphi_offset) / pixel_size_xphi);
179 int bin_xeta = floor(fabs(surf_pos_xeta + xeta_offset) / pixel_size_xeta);
181 float pos_xphi_inpixel =
182 fabs(surf_pos_xphi + xphi_offset) - float(bin_xphi) * pixel_size_xphi;
183 float pos_xeta_inpixel =
184 fabs(surf_pos_xeta + xeta_offset) - float(bin_xeta) * pixel_size_xeta;
186 bool is_interpad_xphi = (pos_xphi_inpixel < interpad or
187 pos_xphi_inpixel > (pixel_size_xphi - interpad));
188 bool is_interpad_xeta = (pos_xeta_inpixel < interpad or
189 pos_xeta_inpixel > (pixel_size_xeta - interpad));
192 if (is_interpad_xphi or is_interpad_xeta) {
201 position,
SiCharge(charge_per_step, time_of_flight, hitproc,
209 diode_coll->
add(cell_id, surface_charge.
charge());
a link optimized in size for a GenParticle in a McEventCollection
static HepMcParticleLink getRedirectedLink(const HepMcParticleLink &particleLink, uint32_t eventIndex, const EventContext &ctx)
Return a HepMcParticleLink pointing at the same particle, but in a different GenEvent.