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")) {
23 CLHEP::HepRandomEngine* _engine) {
35 if (ofp.second.getScoringPlaneZ() < 0) {
41 if (ofp.second.getScoringPlaneZ() > 0) {
51 for (HepMC::GenEvent::particle_const_iterator eventParticle = evt->particles_begin();
52 eventParticle != evt->particles_end();
54 if (!((*eventParticle)->status() == 1 && (*eventParticle)->pdg_id() == 2212))
57 if (!(fabs((*eventParticle)->momentum().eta()) >
etaCut_ && fabs((*eventParticle)->momentum().pz()) >
momentumCut_))
60 unsigned int line = (*eventParticle)->barcode();
62 if (gpart->pdg_id() != 2212)
64 if (gpart->status() != 1)
74 const HepMC::FourVector& vtx_cms = in_trk->production_vertex()->position();
75 const HepMC::FourVector& mom_cms = in_trk->momentum();
78 HepMC::FourVector vtx_lhc(-vtx_cms.x(), vtx_cms.y(), -vtx_cms.z(), vtx_cms.t());
79 HepMC::FourVector mom_lhc(-mom_cms.x(), mom_cms.y(), -mom_cms.z(), mom_cms.t());
85 double empiricalAperture_xi0_int, empiricalAperture_xi0_slp;
86 double empiricalAperture_a_int, empiricalAperture_a_slp;
87 unsigned int optFunctionId_;
124 const double p = mom_lhc.rho();
126 const double th_x_phys = mom_lhc.x() /
abs(mom_lhc.z()) -
tan(xangle);
127 const double th_y_phys = mom_lhc.y() /
abs(mom_lhc.z());
128 const double vtx_lhc_eff_x = vtx_lhc.x() - vtx_lhc.z() * (mom_lhc.x() / mom_lhc.z() +
tan(xangle)) - (vtxXoffset_);
129 const double vtx_lhc_eff_y = vtx_lhc.y() - vtx_lhc.z() * (mom_lhc.y() / mom_lhc.z()) - (vtxYoffset_);
132 LogDebug(
"OpticalFunctionsTransport")
133 <<
"simu: xi = " << xi <<
", th_x_phys = " << th_x_phys <<
", th_y_phys = " << th_y_phys
134 <<
", vtx_lhc_eff_x = " << vtx_lhc_eff_x <<
", vtx_lhc_eff_y = " << vtx_lhc_eff_y << std::endl;
141 const double xi_th = (empiricalAperture_xi0_int + xangle * empiricalAperture_xi0_slp) +
142 (empiricalAperture_a_int + xangle * empiricalAperture_a_slp) * th_x_phys;
146 LogDebug(
"OpticalFunctionsTransport") <<
"stop because of empirical appertures";
155 const unsigned int rpDecId = rpId.
arm() * 100 + rpId.
station() * 10 + rpId.
rp();
158 LogDebug(
"OpticalFunctionsTransport") <<
" RP " << rpDecId << std::endl;
162 vtx_lhc_eff_x * 1E-1, th_x_phys, vtx_lhc_eff_y * 1E-1, th_y_phys, xi};
165 ofp.transport(k_in, k_out,
true);
168 double b_x = k_out.
x * 1E1, b_y = k_out.
y * 1E1;
169 double a_x = k_out.
th_x, a_y = k_out.
th_y;
176 ofp.transport(k_be_in, k_be_out,
true);
178 a_x -= k_be_out.
th_x;
179 a_y -= k_be_out.
th_y;
180 b_x -= k_be_out.
x * 1E1;
181 b_y -= k_be_out.
y * 1E1;
184 const double z_scoringPlane = ofp.getScoringPlaneZ() * 1E1;
187 LogDebug(
"OpticalFunctionsTransport")
188 <<
" proton transported: a_x = " << a_x <<
" rad, a_y = " << a_y <<
" rad, b_x = " << b_x
189 <<
" mm, b_y = " << b_y <<
" mm, z = " << z_scoringPlane <<
" mm" << std::endl;
197 unsigned int line = in_trk->barcode();
198 double px = -p * a_x;
200 double pz = std::copysign(
sqrt(p * p - px * px - py * py), mom_cms.z());
202 TLorentzVector p_out(px, py, pz, e);
double fPPSRegionStart_45
double empiricalAperture56_a_slp_
double GetY() const
get Y beam position
bool useBeamPositionFromLHCInfo_
double empiricalAperture45_xi0_slp_
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
bool getData(T &iHolder) const
float const crossingAngle() const
double empiricalAperture56_a_int_
Tan< T >::type tan(const T &t)
Abs< T >::type abs(const T &t)
double getBeamMom56() const
double GetZ() const
get Z beam position
edm::ESGetToken< CTPPSBeamParameters, CTPPSBeamParametersRcd > beamParametersToken_
double getHalfXangleX56() const
const LHCInterpolatedOpticalFunctionsSetCollection * opticalFunctions_
double fPPSRegionStart_56
const BeamSpotObjects * beamspot_
CLHEP::HepRandomEngine * engine_
proton kinematics description
double empiricalAperture45_a_slp_
unsigned int optFunctionId45_
unsigned int optFunctionId56_
bool produceHitsRelativeToBeam_
double GetX() const
get X beam position
std::map< unsigned int, double > m_xAtTrPoint
edm::ESGetToken< BeamSpotObjects, BeamSpotObjectsRcd > beamspotToken_
double getVtxOffsetZ45() const
Base class for CTPPS detector IDs.
std::map< unsigned int, TLorentzVector > m_beamPart
double getVtxOffsetY45() const
bool useEmpiricalApertures_
double empiricalAperture45_xi0_int_
double getBeamMom45() const
const CTPPSBeamParameters * beamParameters_
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