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) {
33 if (ofp.second.getScoringPlaneZ() < 0) {
39 if (ofp.second.getScoringPlaneZ() > 0) {
49 for (HepMC::GenEvent::particle_const_iterator eventParticle = evt->particles_begin();
50 eventParticle != evt->particles_end();
52 if (!((*eventParticle)->status() == 1 && (*eventParticle)->pdg_id() == 2212))
55 if (!(fabs((*eventParticle)->momentum().eta()) >
etaCut_ && fabs((*eventParticle)->momentum().pz()) >
momentumCut_))
58 unsigned int line = (*eventParticle)->barcode();
60 if (gpart->pdg_id() != 2212)
62 if (gpart->status() != 1)
72 const HepMC::FourVector& vtx_cms = in_trk->production_vertex()->position();
73 const HepMC::FourVector& mom_cms = in_trk->momentum();
76 HepMC::FourVector vtx_lhc(-vtx_cms.x(), vtx_cms.y(), -vtx_cms.z(), vtx_cms.t());
77 HepMC::FourVector mom_lhc(-mom_cms.x(), mom_cms.y(), -mom_cms.z(), mom_cms.t());
83 double empiricalAperture_xi0_int, empiricalAperture_xi0_slp;
84 double empiricalAperture_a_int, empiricalAperture_a_slp;
85 unsigned int optFunctionId_;
108 const double p = mom_lhc.rho();
110 const double th_x_phys = mom_lhc.x() /
p;
111 const double th_y_phys = mom_lhc.y() /
p;
112 const double vtx_lhc_eff_x = vtx_lhc.x() - vtx_lhc.z() * (mom_lhc.x() / mom_lhc.z() +
xangle);
113 const double vtx_lhc_eff_y = vtx_lhc.y() - vtx_lhc.z() * (mom_lhc.y() / mom_lhc.z());
116 LogDebug(
"OpticalFunctionsTransport")
117 <<
"simu: xi = " <<
xi <<
", th_x_phys = " << th_x_phys <<
", th_y_phys = " << th_y_phys
118 <<
", vtx_lhc_eff_x = " << vtx_lhc_eff_x <<
", vtx_lhc_eff_y = " << vtx_lhc_eff_y << std::endl;
125 const double xi_th = (empiricalAperture_xi0_int +
xangle * empiricalAperture_xi0_slp) +
126 (empiricalAperture_a_int +
xangle * empiricalAperture_a_slp) * th_x_phys;
130 LogDebug(
"OpticalFunctionsTransport") <<
"stop because of empirical appertures";
139 const unsigned int rpDecId =
rpId.arm() * 100 +
rpId.station() * 10 +
rpId.rp();
142 LogDebug(
"OpticalFunctionsTransport") <<
" RP " << rpDecId << std::endl;
146 vtx_lhc_eff_x * 1E-1, th_x_phys, vtx_lhc_eff_y * 1E-1, th_y_phys,
xi};
149 ofp.transport(k_in, k_out,
true);
152 double b_x = k_out.
x * 1E1, b_y = k_out.
y * 1E1;
153 double a_x = k_out.
th_x, a_y = k_out.
th_y;
160 ofp.transport(k_be_in, k_be_out,
true);
162 a_x -= k_be_out.
th_x;
163 a_y -= k_be_out.
th_y;
164 b_x -= k_be_out.
x * 1E1;
165 b_y -= k_be_out.
y * 1E1;
168 const double z_scoringPlane = ofp.getScoringPlaneZ() * 1E1;
171 LogDebug(
"OpticalFunctionsTransport")
172 <<
" proton transported: a_x = " << a_x <<
" rad, a_y = " << a_y <<
" rad, b_x = " << b_x
173 <<
" mm, b_y = " << b_y <<
" mm, z = " << z_scoringPlane <<
" mm" << std::endl;
181 unsigned int line = in_trk->barcode();
182 double px = -
p * a_x;
184 double pz = std::copysign(
sqrt(
p *
p -
px *
px -
py *
py), mom_cms.z());
186 TLorentzVector p_out(
px,
py, pz,
e);