3 #include <CLHEP/Random/RandGauss.h> 4 #include "TLorentzVector.h" 6 #include "H_BeamLine.h" 7 #include "H_BeamParticle.h" 46 <<
"=============================================================================\n" 47 <<
" Bulding LHC Proton transporter based on HECTOR model\n" 48 <<
"=============================================================================\n";
67 edm::LogInfo(
"ProtonTransport")<<
"Starting proton transport using HECTOR method\n";
70 unsigned int line = (gpart)->barcode();
72 double mass = gpart->generatedMass();
75 px = gpart->momentum().px();
76 py = gpart->momentum().py();
77 pz = gpart->momentum().pz();
78 e = gpart->momentum().e();
82 int direction = (pz>0)?1:-1;
85 TLorentzVector p_out(px,py,pz,e);
93 double XforPosition = gpart->production_vertex()->position().x()/cm;
94 double YforPosition = gpart->production_vertex()->position().y()/cm;
95 double ZforPosition = gpart->production_vertex()->position().z()/cm;
97 H_BeamParticle h_p(mass,charge);
98 h_p.set4Momentum(-direction*p_out.Px(), p_out.Py(), fabs(p_out.Pz()), p_out.E());
107 XforPosition = XforPosition+(
tan((
long double)fCrossingAngle*
urad)-((
long double)p_out.Px())/((
long double)p_out.Pz()))*ZforPosition;
108 YforPosition = YforPosition-((
long double)p_out.Py())/((
long double)p_out.Pz())*ZforPosition;
114 h_p.setPosition(-direction*XforPosition*
cm_to_um,YforPosition*cm_to_um,h_p.getTX(),h_p.getTY(),-direction*ZforPosition*
cm_to_m);
119 H_BeamLine* _beamline =
nullptr;
130 h_p.computePath(&*_beamline);
131 is_stop = h_p.stopped(&*_beamline);
132 if(
m_verbosity)
LogDebug(
"HectorTransportEventProcessing") <<
"HectorTransport:filterPPS: barcode = " 133 << line <<
" is_stop= "<< is_stop;
140 h_p.propagate( _targetZ );
144 p_out.SetPx(direction*p_out.Px());
145 x1_ctpps = direction*h_p.getX()*
um_to_mm;
149 "HectorTransport:filterPPS: barcode = " << line <<
" x= "<< x1_ctpps <<
" y= " << y1_ctpps;
163 for (HepMC::GenEvent::particle_const_iterator eventParticle =evt->particles_begin(); eventParticle != evt->particles_end(); ++eventParticle ) {
164 if (!((*eventParticle)->status() == 1 && (*eventParticle)->pdg_id()==2212 ))
continue;
165 if (!(fabs((*eventParticle)->momentum().eta())>
m_fEtacut && fabs((*eventParticle)->momentum().pz())>
m_fMomentumMin))
continue;
166 line = (*eventParticle)->barcode();
183 edm::LogInfo(
"HectorTransportSetup") <<
"===================================================================\n" 184 <<
" * * * * * * * * * * * * * * * * * * * * * * * * * * * * \n" 186 <<
" * --<--<-- A fast simulator --<--<-- * \n" 187 <<
" * | --<--<-- of particle --<--<-- * \n" 188 <<
" * ----HECTOR----< * \n" 189 <<
" * | -->-->-- transport through-->-->-- * \n" 190 <<
" * -->-->-- generic beamlines -->-->-- * \n" 192 <<
" * JINST 2:P09005 (2007) * \n" 193 <<
" * X Rouby, J de Favereau, K Piotrzkowski (CP3) * \n" 194 <<
" * http://www.fynu.ucl.ac.be/hector.html * \n" 196 <<
" * Center for Cosmology, Particle Physics and Phenomenology * \n" 197 <<
" * Universite catholique de Louvain * \n" 198 <<
" * Louvain-la-Neuve, Belgium * \n" 200 <<
" * * * * * * * * * * * * * * * * * * * * * * * * * * * * \n" 201 <<
" HectorTransport configuration: \n" 205 <<
"===================================================================\n";
221 <<
"====================================================================\n" 222 <<
" Forward beam line elements \n";
225 <<
"====================================================================\n" 226 <<
" 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
Tan< T >::type tan(const T &t)
edm::ESHandle< ParticleDataTable > m_pdt
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