6 lhcInfoLabel_(iConfig.getParameter<
std::
string>(
"lhcInfoLabel")),
7 opticsLabel_(iConfig.getParameter<
std::
string>(
"opticsLabel")),
8 useEmpiricalApertures_(iConfig.getParameter<
bool>(
"useEmpiricalApertures")),
9 empiricalAperture45_xi0_int_(iConfig.getParameter<double>(
"empiricalAperture45_xi0_int")),
10 empiricalAperture45_xi0_slp_(iConfig.getParameter<double>(
"empiricalAperture45_xi0_slp")),
11 empiricalAperture45_a_int_(iConfig.getParameter<double>(
"empiricalAperture45_a_int")),
12 empiricalAperture45_a_slp_(iConfig.getParameter<double>(
"empiricalAperture45_a_slp")),
13 empiricalAperture56_xi0_int_(iConfig.getParameter<double>(
"empiricalAperture56_xi0_int")),
14 empiricalAperture56_xi0_slp_(iConfig.getParameter<double>(
"empiricalAperture56_xi0_slp")),
15 empiricalAperture56_a_int_(iConfig.getParameter<double>(
"empiricalAperture56_a_int")),
16 empiricalAperture56_a_slp_(iConfig.getParameter<double>(
"empiricalAperture56_a_slp")),
17 produceHitsRelativeToBeam_(iConfig.getParameter<
bool>(
"produceHitsRelativeToBeam")) {
22 CLHEP::HepRandomEngine* _engine) {
31 for (HepMC::GenEvent::particle_const_iterator eventParticle = evt->particles_begin();
32 eventParticle != evt->particles_end();
34 if (!((*eventParticle)->status() == 1 && (*eventParticle)->pdg_id() == 2212))
37 if (!(fabs((*eventParticle)->momentum().eta()) >
etaCut_ && fabs((*eventParticle)->momentum().pz()) >
momentumCut_))
40 unsigned int line = (*eventParticle)->barcode();
42 if (gpart->pdg_id() != 2212)
44 if (gpart->status() != 1)
54 const HepMC::FourVector& vtx_cms = in_trk->production_vertex()->position();
55 const HepMC::FourVector& mom_cms = in_trk->momentum();
58 HepMC::FourVector vtx_lhc(-vtx_cms.x(), vtx_cms.y(), -vtx_cms.z(), vtx_cms.t());
59 HepMC::FourVector mom_lhc(-mom_cms.x(), mom_cms.y(), -mom_cms.z(), mom_cms.t());
65 double empiricalAperture_xi0_int, empiricalAperture_xi0_slp;
66 double empiricalAperture_a_int, empiricalAperture_a_slp;
88 const double p = mom_lhc.rho();
90 const double th_x_phys = mom_lhc.x() /
p;
91 const double th_y_phys = mom_lhc.y() /
p;
92 const double vtx_lhc_eff_x = vtx_lhc.x() - vtx_lhc.z() * (mom_lhc.x() / mom_lhc.z() +
xangle);
93 const double vtx_lhc_eff_y = vtx_lhc.y() - vtx_lhc.z() * (mom_lhc.y() / mom_lhc.z());
96 LogDebug(
"OpticalFunctionsTransport")
97 <<
"simu: xi = " <<
xi <<
", th_x_phys = " << th_x_phys <<
", th_y_phys = " << th_y_phys
98 <<
", vtx_lhc_eff_x = " << vtx_lhc_eff_x <<
", vtx_lhc_eff_y = " << vtx_lhc_eff_y << std::endl;
104 const double xi_th = (empiricalAperture_xi0_int +
xangle * empiricalAperture_xi0_slp) +
105 (empiricalAperture_a_int +
xangle * empiricalAperture_a_slp) * th_x_phys;
109 LogDebug(
"OpticalFunctionsTransport") <<
"stop because of empirical appertures";
118 const unsigned int rpDecId =
rpId.arm() * 100 +
rpId.station() * 10 +
rpId.rp();
121 if (
rpId.arm() != arm)
125 LogDebug(
"OpticalFunctionsTransport") <<
" RP " << rpDecId << std::endl;
129 vtx_lhc_eff_x * 1E-1, th_x_phys, vtx_lhc_eff_y * 1E-1, th_y_phys,
xi};
132 ofp.second.transport(k_in, k_out,
true);
134 double b_x = k_out.
x * 1E1, b_y = k_out.
y * 1E1;
135 double a_x = k_out.
th_x, a_y = k_out.
th_y;
142 ofp.second.transport(k_be_in, k_be_out,
true);
144 a_x -= k_be_out.
th_x;
145 a_y -= k_be_out.
th_y;
146 b_x -= k_be_out.
x * 1E1;
147 b_y -= k_be_out.
y * 1E1;
150 const double z_scoringPlane = ofp.second.getScoringPlaneZ() * 1E1;
153 LogDebug(
"OpticalFunctionsTransport")
154 <<
" proton transported: a_x = " << a_x <<
" rad, a_y = " << a_y <<
" rad, b_x = " << b_x
155 <<
" mm, b_y = " << b_y <<
" mm, z = " << z_scoringPlane <<
" mm" << std::endl;
157 unsigned int line = in_trk->barcode();
158 double px = -
p * a_x;
160 double pz = std::copysign(
sqrt(
p *
p -
px *
px -
py *
py), mom_cms.z());
162 TLorentzVector p_out(
px,
py, pz,
e);