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
235 std::stringstream ssLog;
238 const HepMC::FourVector& vtx_cms = in_vtx->position();
239 const HepMC::FourVector& mom_cms = in_trk->momentum();
242 HepMC::FourVector vtx_lhc(-vtx_cms.x(), vtx_cms.y(), -vtx_cms.z(), vtx_cms.t());
243 HepMC::FourVector mom_lhc(-mom_cms.x(), mom_cms.y(), -mom_cms.z(), mom_cms.t());
246 unsigned int arm = 3;
248 double beamMomentum = 0.;
250 double empiricalAperture_xi0, empiricalAperture_a;
270 const double p = mom_lhc.rho();
271 const double xi = 1. - p / beamMomentum;
272 const double th_x_phys = mom_lhc.x() /
p;
273 const double th_y_phys = mom_lhc.y() /
p;
274 const double vtx_lhc_eff_x = vtx_lhc.x() - vtx_lhc.z() * (mom_lhc.x() / mom_lhc.z() + xangle);
275 const double vtx_lhc_eff_y = vtx_lhc.y() - vtx_lhc.z() * (mom_lhc.y() / mom_lhc.z());
278 ssLog <<
"simu: xi = " << xi <<
", th_x_phys = " << th_x_phys <<
", th_y_phys = " << th_y_phys
279 <<
", vtx_lhc_eff_x = " << vtx_lhc_eff_x <<
", vtx_lhc_eff_y = " << vtx_lhc_eff_y << std::endl;
284 const double xi_th = empiricalAperture_xi0 + th_x_phys * empiricalAperture_a;
287 ssLog <<
"stop because of empirical appertures";
288 edm::LogInfo(
"CTPPSDirectProtonSimulation") << ssLog.str();
296 for (
const auto& ofp : opticalFunctions) {
298 const unsigned int rpDecId = rpId.arm() * 100 + rpId.station() * 10 + rpId.rp();
301 if (rpId.arm() != arm)
305 ssLog <<
" RP " << rpDecId << std::endl;
309 vtx_lhc_eff_x * 1E-1, th_x_phys, vtx_lhc_eff_y * 1E-1, th_y_phys, xi};
311 ofp.second.transport(k_in, k_out,
true);
313 double b_x = k_out.
x * 1E1, b_y = k_out.
y * 1E1;
314 double a_x = k_out.
th_x, a_y = k_out.
th_y;
321 ofp.second.transport(k_be_in, k_be_out,
true);
323 a_x -= k_be_out.
th_x;
324 a_y -= k_be_out.
th_y;
325 b_x -= k_be_out.
x * 1E1;
326 b_y -= k_be_out.
y * 1E1;
329 const double z_scoringPlane = ofp.second.getScoringPlaneZ() * 1E1;
332 ssLog <<
" proton transported: a_x = " << a_x <<
" rad, a_y = " << a_y <<
" rad, b_x = " << b_x
333 <<
" mm, b_y = " << b_y <<
" mm, z = " << z_scoringPlane <<
" mm" << std::endl;
338 out_tracks.emplace_back(
339 rpId.rawId(), b_x, 0., b_y, 0., 0., 0., 0., 0., 0.,
CTPPSpixelLocalTrackReconstructionInfo::invalid, 0, 0., 0.);
346 for (
const auto& detIdInt : geometry.
sensorsInRP(rpId)) {
351 CLHEP::Hep3Vector gl_o = geometry.
localToGlobal(detId, CLHEP::Hep3Vector(0, 0, 0));
352 CLHEP::Hep3Vector gl_a1 = geometry.
localToGlobal(detId, CLHEP::Hep3Vector(1, 0, 0)) - gl_o;
353 CLHEP::Hep3Vector gl_a2 = geometry.
localToGlobal(detId, CLHEP::Hep3Vector(0, 1, 0)) - gl_o;
358 A(0, 1) = -gl_a1.x();
359 A(0, 2) = -gl_a2.x();
360 B(0) = gl_o.x() - b_x;
362 A(1, 1) = -gl_a1.y();
363 A(1, 2) = -gl_a2.y();
364 B(1) = gl_o.y() - b_y;
366 A(2, 1) = -gl_a1.z();
367 A(2, 2) = -gl_a2.z();
368 B(2) = gl_o.z() - z_scoringPlane;
375 CLHEP::Hep3Vector h_glo(a_x * ze + b_x, a_y * ze + b_y, z_sign * ze + z_scoringPlane);
378 CLHEP::Hep3Vector h_loc = geometry.
globalToLocal(detId, h_glo);
382 <<
" de z = " <<
P(0) <<
" mm, p1 = " <<
P(1) <<
" mm, p2 = " <<
P(2) <<
" mm" << std::endl
383 <<
" h_glo: x = " << h_glo.x() <<
" mm, y = " << h_glo.y() <<
" mm, z = " << h_glo.z() <<
" mm" 385 <<
" h_loc: c1 = " << h_loc.x() <<
" mm, c2 = " << h_loc.y() <<
" mm, c3 = " << h_loc.z() <<
" mm" 391 double u = h_loc.x();
392 double v = h_loc.y();
395 ssLog <<
" u=" << u <<
", v=" <<
v;
400 ssLog <<
" | no hit" << std::endl;
412 ssLog <<
" | strip=" <<
strip;
418 ssLog <<
" | m=" << v <<
", sigma=" << sigma << std::endl;
426 throw cms::Exception(
"CTPPSDirectProtonSimulation") <<
"Diamonds are not yet supported.";
433 ssLog <<
" pixel plane " << pixelDetId.plane() <<
": local hit x = " << h_loc.x()
434 <<
" mm, y = " << h_loc.y() <<
" mm, z = " << h_loc.z() <<
" mm" << std::endl;
446 ssLog <<
" hit accepted: m1 = " << h_loc.x() <<
" mm, m2 = " << h_loc.y() <<
" mm" << std::endl;
451 const LocalPoint lp(h_loc.x(), h_loc.y(), h_loc.z());
461 edm::LogInfo(
"CTPPSDirectProtonSimulation") << ssLog.str();
double pitchStrips_
strip pitch in mm
void push_back(const T &t)
double empiricalAperture56_xi0_
double empiricalAperture56_a_
bool produceScoringPlaneHits_
flags what output to be produced
static bool IsHit(double u, double v, double insensitiveMargin=0)
static bool isPixelHit(float xLocalCoordinate, float yLocalCoordinate, bool is3x2=true)
reference find_or_insert(det_id_type id)
double empiricalAperture45_a_
bool produceHitsRelativeToBeam_
Reconstructed hit in TOTEM RP.
double getBeamMom56() const
double insensitiveMarginStrips_
size of insensitive margin at sensor's edge facing the beam, in mm
double getHalfXangleX56() const
static const std::string B
CLHEP::Hep3Vector localToGlobal(const DetGeomDesc *, const CLHEP::Hep3Vector &) const
proton kinematics description
bool useEmpiricalApertures_
const std::set< unsigned int > & sensorsInRP(unsigned int) const
after checks returns set of sensor ids corresponding to the given RP id
std::pair< OmniClusterRef, TrackingParticleRef > P
Base class for CTPPS detector IDs.
double stripZeroPosition_
internal variable: v position of strip 0, in mm
double empiricalAperture45_xi0_
double getBeamMom45() const
double getHalfXangleX45() const
CLHEP::Hep3Vector globalToLocal(const DetGeomDesc *, const CLHEP::Hep3Vector &) const