4 #include <CLHEP/Random/RandGauss.h>
5 #include <CLHEP/Units/GlobalSystemOfUnits.h>
9 : verbosity_(iConfig.getParameter<
bool>(
"Verbosity")),
10 bApplyZShift(iConfig.getParameter<
bool>(
"ApplyZShift")),
11 fPPSRegionStart_45(iConfig.getParameter<double>(
"PPSRegionStart_45")),
12 fPPSRegionStart_56(iConfig.getParameter<double>(
"PPSRegionStart_56")),
13 etaCut_(iConfig.getParameter<double>(
"EtaCut")),
14 momentumCut_(iConfig.getParameter<double>(
"MomentumCut")) {
19 p_out.SetPx(
p->momentum().px());
20 p_out.SetPy(
p->momentum().py());
21 p_out.SetPz(
p->momentum().pz());
22 p_out.SetE(
p->momentum().e());
24 p->set_momentum(HepMC::FourVector(p_out.Px(), p_out.Py(), p_out.Pz(), p_out.E()));
27 double theta = p_out.Theta();
28 double thetax = atan(p_out.Px() / fabs(p_out.Pz()));
29 double thetay = atan(p_out.Py() / fabs(p_out.Pz()));
33 int direction = (p_out.Pz() > 0) ? 1 : -1;
43 double denergy = (double)CLHEP::RandGauss::shoot(
engine_, 0.,
m_sig_E);
45 double s_theta =
sqrt(
pow(thetax + dtheta_x *
urad, 2) +
pow(thetay + dtheta_y *
urad, 2));
46 double s_phi = atan2(thetay + dtheta_y *
urad, thetax + dtheta_x *
urad);
50 p_out.SetPx((
double)
p *
sin(s_theta) *
cos(s_phi));
51 p_out.SetPy((
double)
p *
sin(s_theta) *
sin(s_phi));
52 p_out.SetPz((
double)
p * (
cos(s_theta)) * direction);
66 gpart = in_evt->barcode_to_particle(
line);
68 direction = (gpart->momentum().pz() > 0) ? 1 : -1;
73 double time = (ddd * meter - gpart->production_vertex()->position().z() * mm);
82 LogDebug(
"BaseProtonTransportEventProcessing")
83 <<
"BaseProtonTransport:: x= " << (*(
m_xAtTrPoint.find(
line))).second <<
"\n"
84 <<
"BaseProtonTransport:: y= " << (*(
m_yAtTrPoint.find(
line))).second <<
"\n"
85 <<
"BaseProtonTransport:: z= " << ddd * direction *
m_to_mm <<
"\n"
86 <<
"BaseProtonTransport:: t= " <<
time;
88 TLorentzVector
const& p_out = (it).
second;
90 HepMC::GenVertex* vert =
new HepMC::GenVertex(HepMC::FourVector((*(
m_xAtTrPoint.find(
line))).second,
96 HepMC::FourVector(p_out.Px(), p_out.Py(), p_out.Pz(), p_out.E()), gpart->pdg_id(), 1, gpart->flow()));
97 evt->add_vertex(vert);
100 int outgoing = (*vert->particles_out_const_begin())->barcode();
104 LogDebug(
"BaseProtonTransportEventProcessing")
105 <<
"BaseProtonTransport:addPartToHepMC: LHCTransportLink " << theLink;