3 #include <CLHEP/Random/RandGauss.h>
4 #include "TLorentzVector.h"
6 #include "H_BeamLine.h"
7 #include "H_BeamParticle.h"
33 edm::LogInfo(
"ProtonTransport") <<
"=============================================================================\n"
34 <<
" Bulding LHC Proton transporter based on HECTOR model\n"
35 <<
"=============================================================================\n";
44 CLHEP::HepRandomEngine* _engine) {
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();
61 if (gpart->pdg_id() != 2212)
63 if (gpart->status() != 1)
72 edm::LogInfo(
"ProtonTransport") <<
"Starting proton transport using HECTOR method\n";
75 unsigned int line = (gpart)->barcode();
77 double mass = gpart->generatedMass();
80 px = gpart->momentum().px();
81 py = gpart->momentum().py();
82 pz = gpart->momentum().pz();
83 e = gpart->momentum().e();
87 int direction = (pz > 0) ? 1 : -1;
90 TLorentzVector p_out(
px,
py, pz,
e);
101 double XforPosition = gpart->production_vertex()->position().x() / cm;
102 double YforPosition = gpart->production_vertex()->position().y() / cm;
103 double ZforPosition = gpart->production_vertex()->position().z() / cm;
106 h_p.set4Momentum(-direction * p_out.Px(), p_out.Py(), fabs(p_out.Pz()), p_out.E());
115 XforPosition = XforPosition +
116 (
tan((
long double)fCrossingAngle *
urad) - ((
long double)p_out.Px()) / ((
long double)p_out.Pz())) *
118 YforPosition = YforPosition - ((
long double)p_out.Py()) / ((
long double)p_out.Pz()) * ZforPosition;
124 h_p.setPosition(-direction * XforPosition *
cm_to_um,
128 -direction * ZforPosition *
cm_to_m);
133 H_BeamLine* _beamline =
nullptr;
146 h_p.computePath(&*_beamline);
147 is_stop = h_p.stopped(&*_beamline);
149 LogDebug(
"HectorTransportEventProcessing")
150 <<
"HectorTransport:filterPPS: barcode = " <<
line <<
" is_stop= " << is_stop;
157 h_p.propagate(_targetZ);
161 p_out.SetPx(direction * p_out.Px());
162 x1_ctpps = direction * h_p.getX() *
um_to_mm;
166 LogDebug(
"HectorTransportEventProcessing")
167 <<
"HectorTransport:filterPPS: barcode = " <<
line <<
" x= " << x1_ctpps <<
" y= " << y1_ctpps;
190 edm::LogInfo(
"HectorTransportSetup") <<
"===================================================================\n"
191 <<
" * * * * * * * * * * * * * * * * * * * * * * * * * * * * \n"
193 <<
" * --<--<-- A fast simulator --<--<-- * \n"
194 <<
" * | --<--<-- of particle --<--<-- * \n"
195 <<
" * ----HECTOR----< * \n"
196 <<
" * | -->-->-- transport through-->-->-- * \n"
197 <<
" * -->-->-- generic beamlines -->-->-- * \n"
199 <<
" * JINST 2:P09005 (2007) * \n"
200 <<
" * X Rouby, J de Favereau, K Piotrzkowski (CP3) * \n"
201 <<
" * http://www.fynu.ucl.ac.be/hector.html * \n"
203 <<
" * Center for Cosmology, Particle Physics and Phenomenology * \n"
204 <<
" * Universite catholique de Louvain * \n"
205 <<
" * Louvain-la-Neuve, Belgium * \n"
207 <<
" * * * * * * * * * * * * * * * * * * * * * * * * * * * * \n"
208 <<
" HectorTransport configuration: \n"
212 <<
"===================================================================\n";
215 edm::LogInfo(
"HectorTransportSetup") <<
"====================================================================\n"
216 <<
" Forward beam line elements \n";
218 edm::LogInfo(
"HectorTransportSetup") <<
"====================================================================\n"
219 <<
" Backward beam line elements \n";