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
224 std::stringstream ssLog;
227 const HepMC::FourVector& vtx_cms = in_vtx->position();
228 const HepMC::FourVector& mom_cms = in_trk->momentum();
231 HepMC::FourVector vtx_lhc(-vtx_cms.x(), vtx_cms.y(), -vtx_cms.z(), vtx_cms.t());
232 HepMC::FourVector mom_lhc(-mom_cms.x(), mom_cms.y(), -mom_cms.z(), mom_cms.t());
235 unsigned int arm = 3;
237 double beamMomentum = 0.;
239 double empiricalAperture_xi0, empiricalAperture_a;
259 const double p = mom_lhc.rho();
260 const double xi = 1. - p / beamMomentum;
261 const double th_x_phys = mom_lhc.x() /
p;
262 const double th_y_phys = mom_lhc.y() /
p;
263 const double vtx_lhc_eff_x = vtx_lhc.x() - vtx_lhc.z() * (mom_lhc.x() / mom_lhc.z() + xangle);
264 const double vtx_lhc_eff_y = vtx_lhc.y() - vtx_lhc.z() * (mom_lhc.y() / mom_lhc.z());
268 ssLog <<
"simu: xi = " << xi <<
", th_x_phys = " << th_x_phys <<
", th_y_phys = " << th_y_phys
269 <<
", vtx_lhc_eff_x = " << vtx_lhc_eff_x <<
", vtx_lhc_eff_y = " << vtx_lhc_eff_y << std::endl;
275 const double xi_th = empiricalAperture_xi0 + th_x_phys * empiricalAperture_a;
280 ssLog <<
"stop because of empirical appertures";
281 edm::LogInfo(
"CTPPSDirectProtonSimulation") << ssLog.str();
289 for (
const auto &ofp : opticalFunctions)
292 const unsigned int rpDecId = rpId.arm()*100 + rpId.station()*10 + rpId.rp();
295 if (rpId.arm() != arm)
299 ssLog <<
" RP " << rpDecId << std::endl;
304 ofp.second.transport(k_in, k_out,
true);
306 double b_x = k_out.
x * 1E1, b_y = k_out.
y * 1E1;
307 double a_x = k_out.
th_x, a_y = k_out.
th_y;
315 ofp.second.transport(k_be_in, k_be_out,
true);
317 a_x -= k_be_out.
th_x; a_y -= k_be_out.
th_y;
318 b_x -= k_be_out.
x * 1E1; b_y -= k_be_out.
y * 1E1;
321 const double z_scoringPlane = ofp.second.getScoringPlaneZ() * 1E1;
325 ssLog <<
" proton transported: a_x = " << a_x <<
" rad, a_y = " << a_y <<
" rad, b_x = " << b_x <<
326 " mm, b_y = " << b_y <<
" mm, z = " << z_scoringPlane <<
" mm" << std::endl;
331 out_tracks.emplace_back(rpId.rawId(), b_x, 0., b_y, 0., 0., 0., 0., 0., 0.,
CTPPSpixelLocalTrackReconstructionInfo::invalid, 0, 0., 0.);
344 CLHEP::Hep3Vector gl_o = geometry.
localToGlobal(detId, CLHEP::Hep3Vector(0, 0, 0));
345 CLHEP::Hep3Vector gl_a1 = geometry.
localToGlobal(detId, CLHEP::Hep3Vector(1, 0, 0)) - gl_o;
346 CLHEP::Hep3Vector gl_a2 = geometry.
localToGlobal(detId, CLHEP::Hep3Vector(0, 1, 0)) - gl_o;
350 A(0, 0) = a_x;
A(0, 1) = -gl_a1.x();
A(0, 2) = -gl_a2.x();
B(0) = gl_o.x() - b_x;
351 A(1, 0) = a_y;
A(1, 1) = -gl_a1.y();
A(1, 2) = -gl_a2.y();
B(1) = gl_o.y() - b_y;
352 A(2, 0) = z_sign;
A(2, 1) = -gl_a1.z();
A(2, 2) = -gl_a2.z();
B(2) = gl_o.z() - z_scoringPlane;
359 CLHEP::Hep3Vector h_glo(a_x * ze + b_x, a_y * ze + b_y, z_sign*ze + z_scoringPlane);
362 CLHEP::Hep3Vector h_loc = geometry.
globalToLocal(detId, h_glo);
367 <<
" de z = " <<
P(0) <<
" mm, p1 = " <<
P(1) <<
" mm, p2 = " <<
P(2) <<
" mm" << std::endl
368 <<
" h_glo: x = " << h_glo.x() <<
" mm, y = " << h_glo.y() <<
" mm, z = " << h_glo.z() <<
" mm" << std::endl
369 <<
" h_loc: c1 = " << h_loc.x() <<
" mm, c2 = " << h_loc.y() <<
" mm, c3 = " << h_loc.z() <<
" mm" << std::endl;
375 double u = h_loc.x();
376 double v = h_loc.y();
379 ssLog <<
" u=" << u <<
", v=" <<
v;
385 ssLog <<
" | no hit" << std::endl;
398 ssLog <<
" | strip=" <<
strip;
404 ssLog <<
" | m=" << v <<
", sigma=" << sigma << std::endl;
413 throw cms::Exception(
"CTPPSDirectProtonSimulation") <<
"Diamonds are not yet supported.";
422 ssLog <<
" pixel plane " << pixelDetId.plane() <<
": local hit x = " << h_loc.x()
423 <<
" mm, y = " << h_loc.y() <<
" mm, z = " << h_loc.z() <<
" mm" << std::endl;
436 ssLog <<
" hit accepted: m1 = " << h_loc.x() <<
" mm, m2 = " << h_loc.y() <<
" mm" << std::endl;
441 const LocalPoint lp(h_loc.x(), h_loc.y(), h_loc.z());
451 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_
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
const std::set< unsigned int > & getSensorsInRP(unsigned int) const
after checks returns set of sensor ids corresponding to the given RP id
double getHalfXangleX45() const
CLHEP::Hep3Vector globalToLocal(const DetGeomDesc *, const CLHEP::Hep3Vector &) const