10 useEmpiricalApertures_(iConfig.getParameter<
bool>(
"useEmpiricalApertures")),
11 empiricalAperture45_xi0_int_(iConfig.getParameter<double>(
"empiricalAperture45_xi0_int")),
12 empiricalAperture45_xi0_slp_(iConfig.getParameter<double>(
"empiricalAperture45_xi0_slp")),
13 empiricalAperture45_a_int_(iConfig.getParameter<double>(
"empiricalAperture45_a_int")),
14 empiricalAperture45_a_slp_(iConfig.getParameter<double>(
"empiricalAperture45_a_slp")),
15 empiricalAperture56_xi0_int_(iConfig.getParameter<double>(
"empiricalAperture56_xi0_int")),
16 empiricalAperture56_xi0_slp_(iConfig.getParameter<double>(
"empiricalAperture56_xi0_slp")),
17 empiricalAperture56_a_int_(iConfig.getParameter<double>(
"empiricalAperture56_a_int")),
18 empiricalAperture56_a_slp_(iConfig.getParameter<double>(
"empiricalAperture56_a_slp")) {
25 CLHEP::HepRandomEngine* engine) {
37 if (ofp.second.getScoringPlaneZ() < 0) {
43 if (ofp.second.getScoringPlaneZ() > 0) {
53 for (HepMC::GenEvent::particle_const_iterator eventParticle = evt->particles_begin();
54 eventParticle != evt->particles_end();
56 if (!((*eventParticle)->status() == 1 && (*eventParticle)->pdg_id() == 2212))
59 if (!(fabs((*eventParticle)->momentum().eta()) >
etaCut_ && fabs((*eventParticle)->momentum().pz()) >
momentumCut_))
62 unsigned int line = (*eventParticle)->barcode();
64 if (gpart->pdg_id() != 2212)
66 if (gpart->status() != 1)
76 const HepMC::FourVector& vtx_cms = in_trk->production_vertex()->position();
77 const HepMC::FourVector& mom_cms = in_trk->momentum();
80 HepMC::FourVector vtx_lhc(-vtx_cms.x(), vtx_cms.y(), -vtx_cms.z(), vtx_cms.t());
81 HepMC::FourVector mom_lhc(-mom_cms.x(), mom_cms.y(), -mom_cms.z(), mom_cms.t());
87 double empiricalAperture_xi0_int, empiricalAperture_xi0_slp;
88 double empiricalAperture_a_int, empiricalAperture_a_slp;
89 unsigned int optFunctionId;
122 const double p = mom_lhc.rho();
124 const double th_x_phys = mom_lhc.x() /
abs(mom_lhc.z()) -
tan(
xangle);
125 const double th_y_phys = mom_lhc.y() /
abs(mom_lhc.z());
126 const double vtx_lhc_eff_x = vtx_lhc.x() - vtx_lhc.z() * (mom_lhc.x() / mom_lhc.z() +
tan(
xangle)) - (vtxXoffset);
127 const double vtx_lhc_eff_y = vtx_lhc.y() - vtx_lhc.z() * (mom_lhc.y() / mom_lhc.z()) - (vtxYoffset);
130 LogDebug(
"OpticalFunctionsTransport")
131 <<
"simu: xi = " <<
xi <<
", th_x_phys = " << th_x_phys <<
", th_y_phys = " << th_y_phys
132 <<
", vtx_lhc_eff_x = " << vtx_lhc_eff_x <<
", vtx_lhc_eff_y = " << vtx_lhc_eff_y;
139 const double xi_th = (empiricalAperture_xi0_int +
xangle * empiricalAperture_xi0_slp) +
140 (empiricalAperture_a_int +
xangle * empiricalAperture_a_slp) * th_x_phys;
144 LogDebug(
"OpticalFunctionsTransport") <<
"stop because of empirical appertures";
153 const unsigned int rpDecId =
rpId.arm() * 100 +
rpId.station() * 10 +
rpId.rp();
156 LogDebug(
"OpticalFunctionsTransport") <<
" RP " << rpDecId << std::endl;
163 ofp.transport(k_in, k_out,
true);
167 double a_x = k_out.
th_x, a_y = k_out.
th_y;
174 ofp.transport(k_be_in, k_be_out,
true);
176 a_x -= k_be_out.
th_x;
177 a_y -= k_be_out.
th_y;
182 const double z_scoringPlane = ofp.getScoringPlaneZ() *
cm_to_mm;
185 LogDebug(
"OpticalFunctionsTransport")
186 <<
" proton transported: a_x = " << a_x <<
" rad, a_y = " << a_y <<
" rad, b_x = " << b_x
187 <<
" mm, b_y = " << b_y <<
" mm, z = " << z_scoringPlane <<
" mm";
194 unsigned int line = in_trk->barcode();
195 double px = -
p * a_x;
197 double pz = std::copysign(
sqrt(
p *
p -
px *
px -
py *
py), mom_cms.z());
199 TLorentzVector p_out(
px,
py, pz,
e);
double empiricalAperture56_a_slp_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
bool produceHitsRelativeToBeam_
bool useBeamPositionFromLHCInfo_
double empiricalAperture45_xi0_slp_
double getHalfXangleX56() const
edm::ESGetToken< LHCInfo, LHCInfoRcd > lhcInfoToken_
OpticalFunctionsTransport(const edm::ParameterSet &ps, edm::ConsumesCollector iC)
edm::ESGetToken< LHCInterpolatedOpticalFunctionsSetCollection, CTPPSInterpolatedOpticsRcd > opticsToken_
double getVtxOffsetX45() const
void process(const HepMC::GenEvent *ev, const edm::EventSetup &es, CLHEP::HepRandomEngine *engine) override
double fPPSRegionStart_56_
double empiricalAperture56_a_int_
~OpticalFunctionsTransport() override
Tan< T >::type tan(const T &t)
Abs< T >::type abs(const T &t)
edm::ESGetToken< CTPPSBeamParameters, CTPPSBeamParametersRcd > beamParametersToken_
float const crossingAngle() const
double getVtxOffsetY45() const
const LHCInterpolatedOpticalFunctionsSetCollection * opticalFunctions_
CLHEP::HepRandomEngine * engine_
proton kinematics description
edm::ESGetToken< SimBeamSpotObjects, SimBeamSpotObjectsRcd > beamspotToken_
double empiricalAperture45_a_slp_
unsigned int optFunctionId45_
unsigned int optFunctionId56_
double getBeamMom45() const
const SimBeamSpotObjects * beamspot_
std::map< unsigned int, double > m_xAtTrPoint
Base class for CTPPS detector IDs.
std::map< unsigned int, TLorentzVector > m_beamPart
double getBeamMom56() const
bool useEmpiricalApertures_
double fPPSRegionStart_45_
double empiricalAperture45_xi0_int_
const CTPPSBeamParameters * beamParameters_
double x() const
get X, Y, Z position
double empiricalAperture56_xi0_int_
bool transportProton(const HepMC::GenParticle *)
static const double ProtonMassSQ
std::map< unsigned int, double > m_yAtTrPoint
double empiricalAperture45_a_int_
double getHalfXangleX45() const
double empiricalAperture56_xi0_slp_
static const double cm_to_mm