3 #include <CLHEP/Random/RandGauss.h>
4 #include "TLorentzVector.h"
6 #include "H_BeamLine.h"
7 #include "H_BeamParticle.h"
35 edm::LogInfo(
"ProtonTransport") <<
"=============================================================================\n"
36 <<
" Bulding LHC Proton transporter based on HECTOR model\n"
37 <<
"=============================================================================\n";
46 CLHEP::HepRandomEngine* _engine) {
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();
63 if (gpart->pdg_id() != 2212)
65 if (gpart->status() != 1)
74 edm::LogInfo(
"ProtonTransport") <<
"Starting proton transport using HECTOR method\n";
77 unsigned int line = (gpart)->barcode();
79 double mass = gpart->generatedMass();
83 px = -gpart->momentum().px();
84 py = gpart->momentum().py();
85 pz = -gpart->momentum().pz();
86 e = gpart->momentum().e();
88 int direction = (pz > 0) ? 1 : -1;
90 double XforPosition = -gpart->production_vertex()->position().x();
91 double YforPosition = gpart->production_vertex()->position().y();
92 double ZforPosition = -gpart->production_vertex()->position().z();
97 h_p.set4Momentum(
px,
py, pz,
e);
100 XforPosition = XforPosition - ZforPosition * (
px / pz + fCrossingAngleX *
urad);
101 YforPosition = YforPosition - ZforPosition * (
py / pz + fCrossingAngleY *
urad);
105 h_p.setPosition(XforPosition *
mm_to_um, YforPosition *
mm_to_um, h_p.getTX(), h_p.getTY(), 0.);
111 H_BeamLine* _beamline =
nullptr;
124 h_p.computePath(&*_beamline);
125 is_stop = h_p.stopped(&*_beamline);
127 LogDebug(
"HectorTransportEventProcessing")
128 <<
"HectorTransport:filterPPS: barcode = " <<
line <<
" is_stop= " << is_stop;
135 h_p.propagate(_targetZ);
136 x1_ctpps = h_p.getX();
137 y1_ctpps = h_p.getY();
139 double thx = h_p.getTX();
140 double thy = h_p.getTY();
145 p_beam.setPosition(0., 0., fCrossingAngleX *
urad, fCrossingAngleY *
urad, 0.);
146 p_beam.computePath(&*_beamline);
147 thx -= p_beam.getTX();
148 thy -= p_beam.getTY();
149 x1_ctpps -= p_beam.getX();
150 y1_ctpps -= p_beam.getY();
166 LogDebug(
"HectorTransportEventProcessing")
167 <<
"HectorTransport:filterPPS: barcode = " <<
line <<
" x= " << x1_ctpps <<
" y= " << y1_ctpps;
189 edm::LogInfo(
"HectorTransportSetup") <<
"===================================================================\n"
190 <<
" * * * * * * * * * * * * * * * * * * * * * * * * * * * * \n"
192 <<
" * --<--<-- A fast simulator --<--<-- * \n"
193 <<
" * | --<--<-- of particle --<--<-- * \n"
194 <<
" * ----HECTOR----< * \n"
195 <<
" * | -->-->-- transport through-->-->-- * \n"
196 <<
" * -->-->-- generic beamlines -->-->-- * \n"
198 <<
" * JINST 2:P09005 (2007) * \n"
199 <<
" * X Rouby, J de Favereau, K Piotrzkowski (CP3) * \n"
200 <<
" * http://www.fynu.ucl.ac.be/hector.html * \n"
202 <<
" * Center for Cosmology, Particle Physics and Phenomenology * \n"
203 <<
" * Universite catholique de Louvain * \n"
204 <<
" * Louvain-la-Neuve, Belgium * \n"
206 <<
" * * * * * * * * * * * * * * * * * * * * * * * * * * * * \n"
207 <<
" HectorTransport configuration: \n"
211 <<
"===================================================================\n";
214 edm::LogInfo(
"HectorTransportSetup") <<
"====================================================================\n"
215 <<
" Forward beam line elements \n";
217 edm::LogInfo(
"HectorTransportSetup") <<
"====================================================================\n"
218 <<
" Backward beam line elements \n";