NAGASH 0.9.8
Next Generation Analysis System
Loading...
Searching...
No Matches
Kinematics.h
Go to the documentation of this file.
1//***************************************************************************************
4//***************************************************************************************
5
6#pragma once
7
8#include "NAGASH/Global.h"
9#include "NAGASH/Tool.h"
10
11namespace NAGASH
12{
16 class Kinematics : public Tool
17 {
18 public:
19 Kinematics(std::shared_ptr<MSGTool> MSG) : Tool(MSG) {}
20 static double MT(const TLorentzVector &l1, const TLorentzVector &l2);
21 static double CosthStar(const TLorentzVector &Lepton, const TLorentzVector &AntiLepton);
22 static double DeltaR(double, double, double, double);
23 static double DeltaPhi(double, double);
24
25 static void GetCSFAngles(const TLorentzVector &lep1, const int &charge1, const TLorentzVector &lep2, double ebeam, double &costh, double &phi);
26 static void GetVHFAngles(const TLorentzVector &lep1, const int &charge1, const TLorentzVector &lep2, double &costh, double &phi);
27 static void GetBDFAngles(const TLorentzVector &tlv1, const int &charge1, const TLorentzVector &tlv2, double &costh, double &phi);
28
29 static void GetAiPolynominals(double costh, double phi, std::vector<double> &aipols);
30 static std::vector<double> GetAiPolynominals(double costh, double phi);
31 static double SumAiPolynominals(std::vector<double> &ai, std::vector<double> &aimom);
32
33 // projections
34 static void GetProjections(const TLorentzVector &proj, const TLorentzVector &axis, double &par, double &perp);
35 };
36
41 inline double Kinematics::MT(const TLorentzVector &l1, const TLorentzVector &l2)
42 {
43 return sqrt(2 * l1.Pt() * l2.Pt() * (1 - cos(l1.DeltaPhi(l2))));
44 }
45
50 inline double Kinematics::CosthStar(const TLorentzVector &Lepton, const TLorentzVector &AntiLepton)
51 {
52 double costh, P1_plus, P1_minus, P2_plus, P2_minus, Q, QT;
53 TLorentzVector Zboson = Lepton + AntiLepton;
54
55 P1_plus = 1 / sqrt(2) * (Lepton.E() + Lepton.Pz());
56 P1_minus = 1 / sqrt(2) * (Lepton.E() - Lepton.Pz());
57 P2_plus = 1 / sqrt(2) * (AntiLepton.E() + AntiLepton.Pz());
58 P2_minus = 1 / sqrt(2) * (AntiLepton.E() - AntiLepton.Pz());
59 Q = Zboson.M();
60 QT = Zboson.Pt();
61 costh = 2 / (Q * sqrt(Q * Q + QT * QT)) * (P1_plus * P2_minus - P2_plus * P1_minus);
62 return costh;
63 }
64
70 inline void Kinematics::GetProjections(const TLorentzVector &proj, const TLorentzVector &axis, double &par, double &perp)
71 {
72 par = (proj.Px() * axis.Px() + proj.Py() * axis.Py()) / axis.Pt();
73 perp = (proj.Py() * axis.Px() - proj.Px() * axis.Py()) / axis.Pt();
74 }
75
80 inline double Kinematics::SumAiPolynominals(std::vector<double> &ai, std::vector<double> &aimom)
81 {
82 ai.resize(8);
83 aimom.resize(8);
84
85 static const double norm = 3. / (16. * TMath::Pi());
86 double xsec = 1 + aimom[4] * aimom[4];
87 for (int imom = 0; imom < 8; imom++)
88 xsec += ((imom == 2) ? 0.5 : 1) * ai[imom] * aimom[imom];
89 return xsec * norm;
90 }
91
98 inline double Kinematics::DeltaR(double eta1, double phi1, double eta2, double phi2)
99 {
100 return sqrt((eta1 - eta2) * (eta1 - eta2) + pow(DeltaPhi(phi1, phi2), 2));
101 }
102
107 inline double Kinematics::DeltaPhi(double phi1, double phi2)
108 {
109 return TVector2::Phi_mpi_pi(phi1 - phi2);
110 }
111
112} // namespace NAGASH
Some global definitions.
Provide some static functions to calculate kinematic variables.
Definition Kinematics.h:17
static void GetAiPolynominals(double costh, double phi, std::vector< double > &aipols)
Calculate angular terms corresponding to each angular coefficient.
static void GetProjections(const TLorentzVector &proj, const TLorentzVector &axis, double &par, double &perp)
Get the parallel and perpendicular components of a vector corresponding to an axis.
Definition Kinematics.h:70
static double CosthStar(const TLorentzVector &Lepton, const TLorentzVector &AntiLepton)
Calculate the Collins-Soper angle of a two-particle-system.
Definition Kinematics.h:50
static double DeltaR(double, double, double, double)
Calculate the between two particles.
Definition Kinematics.h:98
static double SumAiPolynominals(std::vector< double > &ai, std::vector< double > &aimom)
Calculate the angular polynomials.
Definition Kinematics.h:80
static double DeltaPhi(double, double)
Calculate the between two angles.
Definition Kinematics.h:107
static void GetCSFAngles(const TLorentzVector &lep1, const int &charge1, const TLorentzVector &lep2, double ebeam, double &costh, double &phi)
Calculate the decay angles in the Collins-Soper Frame.
static double MT(const TLorentzVector &l1, const TLorentzVector &l2)
Calculate the transverse momentum of a two-particle-system.
Definition Kinematics.h:41
static void GetVHFAngles(const TLorentzVector &lep1, const int &charge1, const TLorentzVector &lep2, double &costh, double &phi)
Calculate the decay angles in the Vector Boson Helicity Frame.
static void GetBDFAngles(const TLorentzVector &tlv1, const int &charge1, const TLorentzVector &tlv2, double &costh, double &phi)
Calculate the decay angles in the Beam Direction Frame.
Kinematics(std::shared_ptr< MSGTool > MSG)
Definition Kinematics.h:19
Provide interface for all tools in NAGASH.
Definition Tool.h:72