15 #include "TLorentzVector.h" 35 uniform_real_distribution<>
unihalf_(0., 0.5);
36 uniform_real_distribution<>
uni2pi_(0., 2.*acos(-1.));
44 TFile file(
"mt2.root",
"recreate");
46 TLorentzVector p4A, p4a, p4B, p4b, test_a, test_b;
47 double test_mass, their_mt2, my_mt2, test_mt2, unbalanced;
48 TTree tree(
"tree",
"tree");
49 tree.Branch(
"A", &p4A);
50 tree.Branch(
"a", &p4a);
51 tree.Branch(
"B", &p4B);
52 tree.Branch(
"b", &p4b);
53 tree.Branch(
"test_a", &test_a);
54 tree.Branch(
"test_b", &test_b);
55 tree.Branch(
"test_mass", &test_mass);
56 tree.Branch(
"theirs", &their_mt2);
57 tree.Branch(
"mine", &my_mt2);
58 tree.Branch(
"test_mt2", &test_mt2);
59 tree.Branch(
"unbalanced", &unbalanced);
60 Timer timer(nevents_, 1.);
62 for(
size_t event = 0;
event <
nevents_; ++event){
80 double thetaA = acos(costA);
81 double thetaa = acos(-1.)-thetaA;
82 double etaA = -log(tan(0.5*thetaA));
83 double etaa = -log(tan(0.5*thetaa));
86 double pA = sqrt((mt_*mt_-sumA*sumA)*(mt_*mt_-diffA*diffA))/(2.*
mt_);
89 p4TA.SetXYZM(pxtA, pytA, pztA, mt_);
90 p4A.SetPtEtaPhiM(pA, etaA, phiA, mA);
91 p4a.SetPtEtaPhiM(pA, etaa, -phiA, ma);
92 p4A.Boost(p4TA.BoostVector());
93 p4a.Boost(p4TA.BoostVector());
95 double thetaB = acos(costB);
96 double thetab = acos(-1.)-thetaB;
97 double etaB = -log(tan(0.5*thetaB));
98 double etab = -log(tan(0.5*thetab));
100 double diffB = mB-mb;
101 double pB = sqrt((mt_*mt_-sumB*sumB)*(mt_*mt_-diffB*diffB))/(2.*
mt_);
103 p4TB.SetXYZM(pxtB, pytB, pztB, mt_);
104 p4B.SetPtEtaPhiM(pB, etaB, phiB, mB);
105 p4b.SetPtEtaPhiM(pB, etab, -phiB, mb);
106 p4B.Boost(p4TB.BoostVector());
107 p4b.Boost(p4TB.BoostVector());
109 TLorentzVector p4c = p4a+p4b;
111 double pa0[3] = {p4A.M(), p4A.Px(), p4A.Py()};
112 double pb0[3] = {p4B.M(), p4B.Px(), p4B.Py()};
113 double pmiss0[3] = {0., p4c.Px(), p4c.Py()};
116 mine.
SetMomenta(p4A, p4B, p4c.Px(), p4c.Py());
121 test_mt2 = mine.
GetTrialMT2(test_a.Px(), test_a.Py());
132 generate_n(sd.begin(), sd.size(), ref(r));
133 seed_seq ss(begin(sd), end(sd));
134 return mt19937_64(ss);
void SetMomenta(const TLorentzVector &visible_A, const TLorentzVector &visible_B, double invisible_px, double invisible_py)
uniform_real_distribution unihalf_(0., 0.5)
bernoulli_distribution bernoulli_(7./8.)
uniform_real_distribution uniform_
void set_momenta(double *pa0, double *pb0, double *pmiss0)
void GetInvisibleMomenta(TLorentzVector &invisible_a, TLorentzVector &invisible_b) const
uniform_real_distribution uni2pi_(0., 2.*acos(-1.))
double IsUnbalanced() const
double GetTrialMT2(double invisible_px_a, double invisible_py_a) const
exponential_distribution exponential_(0.01)
mt19937_64 InitializePRNG()
void SetTestMass(double test_mass)