xi is positive for diffractive protons, thus proton momentum p = (1-xi) * p_nom horizontal component of proton momentum: p_x = th_x * (1-xi) * p_nom
313 std::stringstream ssLog;
316 const HepMC::FourVector &vtx_cms = in_vtx->position();
317 const HepMC::FourVector &mom_cms = in_trk->momentum();
320 HepMC::FourVector vtx_lhc(-vtx_cms.x(), vtx_cms.y(), -vtx_cms.z(), vtx_cms.t());
321 HepMC::FourVector mom_lhc(-mom_cms.x(), mom_cms.y(), -mom_cms.z(), mom_cms.t());
324 unsigned int arm = 3;
326 double beamMomentum = 0.;
328 const std::unique_ptr<TF2> *empiricalAperture;
350 const double time_eff = (vtx_lhc.t() - z_sign * vtx_lhc.z()) / CLHEP::c_light;
353 const double p = mom_lhc.rho();
354 const double xi = 1. -
p / beamMomentum;
355 const double th_x_phys = mom_lhc.x() /
p;
356 const double th_y_phys = mom_lhc.y() /
p;
357 const double vtx_lhc_eff_x = vtx_lhc.x() - vtx_lhc.z() * (mom_lhc.x() / mom_lhc.z() +
xangle);
358 const double vtx_lhc_eff_y = vtx_lhc.y() - vtx_lhc.z() * (mom_lhc.y() / mom_lhc.z());
361 ssLog <<
"simu: xi = " <<
xi <<
", th_x_phys = " << th_x_phys <<
", th_y_phys = " << th_y_phys
362 <<
", vtx_lhc_eff_x = " << vtx_lhc_eff_x <<
", vtx_lhc_eff_y = " << vtx_lhc_eff_y << std::endl;
368 (*empiricalAperture)->SetParameter(
"xi",
xi);
369 (*empiricalAperture)->SetParameter(
"xangle",
xangle);
370 const double th_x_th = (*empiricalAperture)->EvalPar(
nullptr);
372 if (th_x_th > th_x_phys) {
374 ssLog <<
"stop because of empirical appertures";
375 edm::LogInfo(
"CTPPSDirectProtonSimulation") << ssLog.str();
385 const unsigned int rpDecId =
rpId.arm() * 100 +
rpId.station() * 10 +
rpId.rp();
388 if (
rpId.arm() != arm)
392 ssLog <<
" RP " << rpDecId << std::endl;
396 vtx_lhc_eff_x * 1E-1, th_x_phys, vtx_lhc_eff_y * 1E-1, th_y_phys,
xi};
398 ofp.second.transport(k_in, k_out,
true);
400 double b_x = k_out.
x * 1E1, b_y = k_out.
y * 1E1;
401 double a_x = k_out.
th_x, a_y = k_out.
th_y;
408 ofp.second.transport(k_be_in, k_be_out,
true);
410 a_x -= k_be_out.
th_x;
411 a_y -= k_be_out.
th_y;
412 b_x -= k_be_out.
x * 1E1;
413 b_y -= k_be_out.
y * 1E1;
416 const double z_scoringPlane = ofp.second.getScoringPlaneZ() * 1E1;
419 ssLog <<
" proton transported: a_x = " << a_x <<
" rad, a_y = " << a_y <<
" rad, b_x = " << b_x
420 <<
" mm, b_y = " << b_y <<
" mm, z = " << z_scoringPlane <<
" mm" << std::endl;
425 out_tracks.emplace_back(
426 rpId.rawId(), b_x, 0., b_y, 0., 0., 0., 0., 0., 0.,
CTPPSpixelLocalTrackReconstructionInfo::invalid, 0, 0., 0.);
433 for (
const auto &detIdInt :
geometry.sensorsInRP(
rpId)) {
442 double gl_o_z = gl_o.z();
449 A(0, 1) = -gl_a1.x();
450 A(0, 2) = -gl_a2.x();
451 B(0) = gl_o.x() - b_x;
453 A(1, 1) = -gl_a1.y();
454 A(1, 2) = -gl_a2.y();
455 B(1) = gl_o.y() - b_y;
457 A(2, 1) = -gl_a1.z();
458 A(2, 2) = -gl_a2.z();
459 B(2) = gl_o_z - z_scoringPlane;
469 auto h_loc =
geometry.globalToLocal(detId, h_glo);
473 <<
" de z = " <<
P(0) <<
" mm, p1 = " <<
P(1) <<
" mm, p2 = " <<
P(2) <<
" mm" << std::endl
474 <<
" h_glo: x = " << h_glo.x() <<
" mm, y = " << h_glo.y() <<
" mm, z = " << h_glo.z() <<
" mm"
476 <<
" h_loc: c1 = " << h_loc.x() <<
" mm, c2 = " << h_loc.y() <<
" mm, c3 = " << h_loc.z() <<
" mm"
482 double u = h_loc.x();
483 double v = h_loc.y();
486 ssLog <<
" u=" << u <<
", v=" <<
v;
491 ssLog <<
" | no hit" << std::endl;
503 ssLog <<
" | strip=" <<
strip;
509 ssLog <<
" | m=" <<
v <<
", sigma=" << sigma << std::endl;
515 out_strip_hits_per_particle[in_trk->barcode()].find_or_insert(detId);
523 const auto *dg =
geometry.sensor(detIdInt);
525 const auto &diamondDimensions = dg->getDiamondDimensions();
526 const auto x_half_width = diamondDimensions.xHalfWidth;
527 const auto y_half_width = diamondDimensions.yHalfWidth;
528 const auto z_half_width = diamondDimensions.zHalfWidth;
534 if (h_loc.x() < -x_half_width || h_loc.x() > +x_half_width || h_loc.y() < -y_half_width ||
535 h_loc.y() > +y_half_width)
539 const double t0 = time_eff + CLHEP::RandGauss::shoot(rndEngine, 0., time_resolution);
540 const double tot = 1.23456;
541 const double ch_t_precis = time_resolution;
542 const int time_slice = 0;
545 const bool multiHit =
false;
564 out_diamond_hits_per_particle[in_trk->barcode()].find_or_insert(detId);
572 ssLog <<
" pixel plane " << pixelDetId.plane() <<
": local hit x = " << h_loc.x()
573 <<
" mm, y = " << h_loc.y() <<
" mm, z = " << h_loc.z() <<
" mm" << std::endl;
586 ssLog <<
" hit accepted: m1 = " << h_loc.x() <<
" mm, m2 = " << h_loc.y() <<
" mm" << std::endl;
591 const LocalPoint lp(h_loc.x(), h_loc.y(), h_loc.z());
598 out_pixel_hits_per_particle[in_trk->barcode()].find_or_insert(detId);
605 edm::LogInfo(
"CTPPSDirectProtonSimulation") << ssLog.str();