• API
• FAQ
• Tools
• Archive
A Pastebin account makes a great Christmas gift
SHARE
TWEET

# Untitled

a guest Sep 20th, 2018 61 Never
ENDING IN00days00hours00mins00secs

1. #include "Math/GenVector/Boost.h"
2. #include "Math/LorentzVector.h"
3. #include "Math/PtEtaPhiE4D.h"
4. typedef ROOT::Math::LorentzVector<ROOT::Math::PtEtaPhiE4D<float>> LorentzVector;
5.
6. double cosTheta(LorentzVector wP4, LorentzVector zP4, LorentzVector lP4) {
7.   ROOT::Math::Boost boostWcm;
8.   boostWcm.SetComponents(wP4.BoostToCM());
9.   ROOT::Math::Boost boostWZcm;
10.   boostWZcm.SetComponents((wP4+zP4).BoostToCM());
11.
12.   auto lP4_w = boostWcm(lP4);
13.   auto wP4_wz = boostWZcm(wP4);
14.   double ct = lP4_w.Vect().Dot(wP4_wz.Vect()) / (lP4_w.P()*wP4_wz.P());
15.   return ct;
16. }
17.
18. LorentzVector wP4estimate(LorentzVector lP4, double pTmiss, double phi_miss) {
19.   const double wMass = 80.385;
20.   double x = wMass*wMass/(2*lP4.Pt()*pTmiss) + std::cos(lP4.phi()-phi_miss);
21.   double eta_nu;
22.   if ( x < 1. ) {
23.     // Complex solution
24.     double complex_arg = std::atan2(std::sqrt(1-x*x), x);
25.     eta_nu = std::asinh(std::cos(complex_arg)*std::sinh(lP4.Eta()));
26.   }
27.   else {
28.     eta_nu = lP4.Eta() + (lP4.Eta() > 0. ? -1.:1) * std::acosh(x);
29.   }
30.   LorentzVector nuP4(pTmiss, eta_nu, phi_miss, pTmiss*cosh(eta_nu));
31.   return nuP4 + lP4;
32. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.

Top