37 #include "CLHEP/Random/RandFlat.h"
38 #include "CLHEP/Random/RandExponential.h"
39 #include "CLHEP/Random/RandBreitWigner.h"
40 #include "CLHEP/Random/RandGauss.h"
41 #include "CLHEP/Units/PhysicalConstants.h"
71 : _t_pt_mean(defs.get_float(
"t_pt_mean")),
72 _mt(defs.get_float(
"mt")),
73 _sigma_mt(defs.get_float(
"sigma_mt")),
74 _mh(defs.get_float(
"mh")),
75 _sigma_mh(defs.get_float(
"sigma_mh")),
76 _recoil_pt_mean(defs.get_float(
"recoil_pt_mean")),
77 _boost_sigma(defs.get_float(
"boost_sigma")),
78 _m_boost(defs.get_float(
"m_boost")),
79 _mb(defs.get_float(
"mb")),
80 _sigma_mb(defs.get_float(
"sigma_mb")),
81 _mw(defs.get_float(
"mw")),
82 _sigma_mw(defs.get_float(
"sigma_mw")),
83 _svx_tageff(defs.get_float(
"svx_tageff")),
84 _smear(defs.get_bool(
"smear")),
85 _smear_dir(defs.get_bool(
"smear_dir")),
86 _muon(defs.get_bool(
"muon")),
87 _ele_res_str(defs.get_string(
"ele_res_str")),
88 _muo_res_str(defs.get_string(
"muo_res_str")),
89 _jet_res_str(defs.get_string(
"jet_res_str")),
90 _kt_res_str(defs.get_string(
"kt_res_str")) {}
284 Threevec rand_spher(CLHEP::HepRandomEngine& engine)
296 CLHEP::RandFlat
r(engine);
300 double U =
r.fire(0.0, 1.0);
301 double V =
r.fire(0.0, 1.0);
304 double phi = acos(2 * V - 1.0);
306 double x =
sin(theta) *
cos(phi);
307 double y =
sin(theta) *
sin(phi);
308 double z =
cos(theta);
329 Fourvec make_massive(
const Threevec&
p,
double m_true,
double sigma, CLHEP::HepRandomEngine& engine)
345 CLHEP::RandBreitWigner rbw(engine);
346 double m = rbw.fire(m_true, sigma);
367 void decay(
const Fourvec& v,
double m1,
double m2, CLHEP::HepRandomEngine& engine,
Fourvec& vout1,
Fourvec& vout2)
389 double f = m0 / (m1 +
m2);
394 double m0_2 = m0 * m0;
395 double m1_2 = m1 * m1;
396 double m2_2 = m2 *
m2;
400 sqrt(m0_2 * m0_2 + m1_2 * m1_2 + m2_2 * m2_2 - 2 * m0_2 * m1_2 - 2 * m0_2 * m2_2 - 2 * m1_2 * m2_2);
401 double p2 = p.mag2();
407 vout1.boost(v.boostVector());
408 vout2.boost(v.boostVector());
420 Threevec rand_pt(
double pt_mean, CLHEP::HepRandomEngine& engine)
433 CLHEP::RandExponential rexp(engine);
439 p *= (rexp.fire(pt_mean) / p.perp());
451 Fourvec rand_boost(
const Gentop_Args&
args, CLHEP::HepRandomEngine& engine)
463 CLHEP::RandExponential rexp(engine);
464 CLHEP::RandFlat rflat(engine);
465 CLHEP::RandGauss rgauss(engine);
469 p.rotateZ(rflat.fire(0, 2 *
M_PI));
470 p *= rexp.fire(args.recoil_pt_mean());
471 p.setZ(rgauss.fire(0, args.boost_sigma()));
472 return Fourvec(p,
sqrt(p.mag2() + args.m_boost() * args.m_boost()));
484 void tagsim(
const Gentop_Args& args, Lepjets_Event&
ev, CLHEP::HepRandomEngine& engine)
497 CLHEP::RandFlat rflat(engine);
499 int typ = ev.jet(
i).type();
501 if (rflat.fire() < args.svx_tageff())
502 ev.jet(
i).svx_tag() =
true;
525 CLHEP::RandBreitWigner rbw(engine);
526 CLHEP::RandGauss rgauss(engine);
536 Fourvec boost = rand_boost(args, engine);
537 lept.boost(boost.boostVector());
538 hadt.boost(boost.boostVector());
542 double mlb = rgauss.fire(args.
mb(), args.
sigma_mb());
543 double mlw = rbw.fire(args.
mw(), args.
sigma_mw());
544 decay(lept, mlb, mlw, engine, lepb, lepw);
548 double mhb = rgauss.fire(args.
mb(), args.
sigma_mb());
549 double mhw = rbw.fire(args.
mw(), args.
sigma_mw());
550 decay(hadt, mhb, mhw, engine, hadb, hadw);
554 decay(lepw, 0, 0, engine, lep, nu);
558 decay(hadw, 0, 0, engine, q1, q2);
577 tagsim(args, ev, engine);
599 CLHEP::RandBreitWigner rbw(engine);
600 CLHEP::RandGauss rgauss(engine);
615 Fourvec boost = rand_boost(args, engine);
616 lept.boost(boost.boostVector());
617 hadt.boost(boost.boostVector());
618 higgs.boost(boost.boostVector());
622 decay(lept, rgauss.fire(args.
mb(), args.
sigma_mb()), rbw.fire(args.
mw(), args.
sigma_mw()), engine, lepb, lepw);
626 decay(hadt, rgauss.fire(args.
mb(), args.
sigma_mb()), rbw.fire(args.
mw(), args.
sigma_mw()), engine, hadb, hadw);
630 decay(lepw, 0, 0, engine, lep, nu);
634 decay(hadw, 0, 0, engine, q1, q2);
638 decay(higgs, rgauss.fire(args.
mb(), args.
sigma_mb()), rgauss.fire(args.
mb(), args.
sigma_mb()), engine, hb1, hb2);
659 tagsim(args, ev, engine);
bool muon() const
Return the value of muon parameter.
std::string muo_res_str() const
Return the value of muon_res_str parameter.
Define an abstract interface for getting parameter settings.
Represent a lepton in an instance of Lepjets_Event class. This class hold the following information: ...
double boost_sigma() const
Return the value of boost_sigma parameter.
Define three-vector and four-vector classes for the HitFit package, and supply a few additional opera...
Calculate and represent resolution for a physical quantity.
double mh() const
Return the value of mh parameter.
Gentop_Args(const Defaults &defs)
Constructor, initialize an instance of Gentop_Args from an instance of Defaults object.
Resolution & kt_res()
Return a reference to the resolution.
double mw() const
Return the value of mw parameter.
void add_lep(const Lepjets_Event_Lep &lep)
Add a new lepton to the event.
Sin< T >::type sin(const T &t)
Lepjets_Event gentth(const Gentop_Args &args, CLHEP::HepRandomEngine &engine)
Generate a event.
Geom::Theta< T > theta() const
std::string jet_res_str() const
Return the value of jet_res_str parameter.
double sigma_mt() const
Return the value of sigma_mt parameter.
double sigma_mh() const
Return the value of sigma_mh parameter.
double sigma_mb() const
Return the value of sigma_mb parameter.
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t V
Represent a simple event consisting of lepton(s) and jet(s).
std::string kt_res_str() const
Return the value of kt_res_str parameter.
double recoil_pt_mean() const
Return the value of recoil_pt_mean parameter.
Represent a simple event consisting of lepton(s) and jet(s). An instance of this class holds a list o...
double mb() const
Return the value of mb parameter.
Lepjets_Event gentop(const Gentop_Args &args, CLHEP::HepRandomEngine &engine)
Generate a event.
Cos< T >::type cos(const T &t)
CLHEP::HepLorentzVector Fourvec
Typedef for a HepLorentzVector.
A class to represent a jet in an instance of Lepjets_Event class. The class is derived from the Lepje...
double sigma_mw() const
Return the value of sigma_mw parameter.
bool smear_dir() const
Return the value of smear_dir parameter.
Hold on to parameters for the toy event generator.
double mt() const
Return the value of mt parameter.
Fourvec & met()
Return a reference to the missing transverse energy.
double m_boost() const
Return the value of m_boost parameter.
CLHEP::Hep3Vector Threevec
Typedef for a Hep3Vector.
std::string ele_res_str() const
Return the value of ele_res_str parameter.
void add_jet(const Lepjets_Event_Jet &jet)
Add a new jet to the event.
Define an interface for getting parameter settings.
bool smear() const
Return the value of smear parameter.
Calculate and represent resolution for a vector of , pseudorapidity , and azimuthal angle ...
A toy event generator for events.
void smear(CLHEP::HepRandomEngine &engine, bool smear_dir=false)
Smear the objects in the event according to their resolutions.
double svx_tageff() const
Return the value of svx_tageff parameter.
double t_pt_mean() const
Return the value of t_pt_mean parameter.