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);
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);
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()));
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);
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);
574 ev.kt_res() = kt_res;
581 ev.smear(engine,
args.smear_dir());
599 CLHEP::RandBreitWigner rbw(engine);
600 CLHEP::RandGauss rgauss(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);
638 decay(higgs, rgauss.fire(
args.mb(),
args.sigma_mb()), rgauss.fire(
args.mb(),
args.sigma_mb()), engine, hb1, hb2);
656 ev.kt_res() = kt_res;
663 ev.smear(engine,
args.smear_dir());