3 #include <CLHEP/Random/RandGauss.h> 4 #include "TLorentzVector.h" 6 #include "H_BeamLine.h" 7 #include "H_BeamParticle.h" 43 edm::LogInfo(
"ProtonTransport") <<
"=============================================================================\n" 44 <<
" Bulding LHC Proton transporter based on HECTOR model\n" 45 <<
"=============================================================================\n";
53 CLHEP::HepRandomEngine* _engine) {
60 edm::LogInfo(
"ProtonTransport") <<
"Starting proton transport using HECTOR method\n";
63 unsigned int line = (gpart)->barcode();
65 double mass = gpart->generatedMass();
68 px = gpart->momentum().px();
69 py = gpart->momentum().py();
70 pz = gpart->momentum().pz();
71 e = gpart->momentum().e();
75 int direction = (pz > 0) ? 1 : -1;
78 TLorentzVector p_out(px, py, pz, e);
89 double XforPosition = gpart->production_vertex()->position().x() / cm;
90 double YforPosition = gpart->production_vertex()->position().y() / cm;
91 double ZforPosition = gpart->production_vertex()->position().z() / cm;
93 H_BeamParticle h_p(mass, charge);
94 h_p.set4Momentum(-direction * p_out.Px(), p_out.Py(), fabs(p_out.Pz()), p_out.E());
103 XforPosition = XforPosition +
104 (
tan((
long double)fCrossingAngle *
urad) - ((
long double)p_out.Px()) / ((
long double)p_out.Pz())) *
106 YforPosition = YforPosition - ((
long double)p_out.Py()) / ((
long double)p_out.Pz()) * ZforPosition;
112 h_p.setPosition(-direction * XforPosition *
cm_to_um,
113 YforPosition * cm_to_um,
116 -direction * ZforPosition *
cm_to_m);
121 H_BeamLine* _beamline =
nullptr;
134 h_p.computePath(&*_beamline);
135 is_stop = h_p.stopped(&*_beamline);
137 LogDebug(
"HectorTransportEventProcessing")
138 <<
"HectorTransport:filterPPS: barcode = " << line <<
" is_stop= " << is_stop;
145 h_p.propagate(_targetZ);
149 p_out.SetPx(direction * p_out.Px());
150 x1_ctpps = direction * h_p.getX() *
um_to_mm;
154 LogDebug(
"HectorTransportEventProcessing")
155 <<
"HectorTransport:filterPPS: barcode = " << line <<
" x= " << x1_ctpps <<
" y= " << y1_ctpps;
168 for (HepMC::GenEvent::particle_const_iterator eventParticle = evt->particles_begin();
169 eventParticle != evt->particles_end();
171 if (!((*eventParticle)->status() == 1 && (*eventParticle)->pdg_id() == 2212))
173 if (!(fabs((*eventParticle)->momentum().eta()) >
m_fEtacut &&
176 line = (*eventParticle)->barcode();
192 edm::LogInfo(
"HectorTransportSetup") <<
"===================================================================\n" 193 <<
" * * * * * * * * * * * * * * * * * * * * * * * * * * * * \n" 195 <<
" * --<--<-- A fast simulator --<--<-- * \n" 196 <<
" * | --<--<-- of particle --<--<-- * \n" 197 <<
" * ----HECTOR----< * \n" 198 <<
" * | -->-->-- transport through-->-->-- * \n" 199 <<
" * -->-->-- generic beamlines -->-->-- * \n" 201 <<
" * JINST 2:P09005 (2007) * \n" 202 <<
" * X Rouby, J de Favereau, K Piotrzkowski (CP3) * \n" 203 <<
" * http://www.fynu.ucl.ac.be/hector.html * \n" 205 <<
" * Center for Cosmology, Particle Physics and Phenomenology * \n" 206 <<
" * Universite catholique de Louvain * \n" 207 <<
" * Louvain-la-Neuve, Belgium * \n" 209 <<
" * * * * * * * * * * * * * * * * * * * * * * * * * * * * \n" 210 <<
" HectorTransport configuration: \n" 214 <<
"===================================================================\n";
229 edm::LogInfo(
"HectorTransportSetup") <<
"====================================================================\n" 230 <<
" Forward beam line elements \n";
232 edm::LogInfo(
"HectorTransportSetup") <<
"====================================================================\n" 233 <<
" Backward beam line elements \n";
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
double fPPSRegionStart_45
~HectorTransport() override
void ApplyBeamCorrection(HepMC::GenParticle *p)
void genProtonsLoop(const HepMC::GenEvent *, const edm::EventSetup &)
Clears BeamParticle, prepares PPSHector for a next Aperture check or/and a next event.
std::map< unsigned int, TLorentzVector > m_beamPart
std::map< unsigned int, double > m_yAtTrPoint
static const double cm_to_um
std::string m_beam2filename
bool transportProton(const HepMC::GenParticle *)
propagate the particles through a beamline to PPS
std::map< unsigned int, double > m_xAtTrPoint
bool getData(T &iHolder) const
void process(const HepMC::GenEvent *, const edm::EventSetup &, CLHEP::HepRandomEngine *) override
double fPPSRegionStart_56
edm::ESHandle< ParticleDataTable > m_pdt
Tan< T >::type tan(const T &t)
static const double um_to_mm
void addPartToHepMC(HepMC::GenEvent *)
std::string m_beam1filename
static const double mm_to_cm
static const double cm_to_m
std::unique_ptr< H_BeamLine > m_beamline56
std::unique_ptr< H_BeamLine > m_beamline45
Power< A, B >::type pow(const A &a, const B &b)
CLHEP::HepRandomEngine * engine