NAGASH 0.9.8
Next Generation Analysis System
Loading...
Searching...
No Matches
Kinematics.cxx
Go to the documentation of this file.
1#include "NAGASH/Kinematics.h"
2
3using namespace NAGASH;
4using namespace std;
5
13void Kinematics::GetCSFAngles(const TLorentzVector &lep1, const int &charge1, const TLorentzVector &lep2, double ebeam, double &costh, double &phi)
14{
15
16 TLorentzVector boson = lep1 + lep2;
17 double Lplus = (charge1 < 0) ? lep1.E() + lep1.Pz() : lep2.E() + lep2.Pz();
18 double Lminus = (charge1 < 0) ? lep1.E() - lep1.Pz() : lep2.E() - lep2.Pz();
19 double Pplus = (charge1 < 0) ? lep2.E() + lep2.Pz() : lep1.E() + lep1.Pz();
20 double Pminus = (charge1 < 0) ? lep2.E() - lep2.Pz() : lep1.E() - lep1.Pz();
21
22 costh = (Lplus * Pminus - Lminus * Pplus);
23 costh *= TMath::Abs(boson.Pz());
24 costh /= (boson.Mag() * boson.Pz());
25 costh /= TMath::Sqrt(boson.Mag2() + boson.Pt() * boson.Pt());
26
27 TVector3 boostV = -boson.BoostVector();
28 TLorentzVector lep1_boosted = (charge1 < 0) ? lep1 : lep2;
29 lep1_boosted.Boost(boostV);
30
31 TVector3 CSAxis, xAxis, yAxis;
32 TLorentzVector p1, p2;
33 double sign = +1.;
34 if (boson.Z() < 0)
35 sign = -1.;
36 p1.SetXYZM(0., 0., sign * ebeam, 0.938); // quark (?)
37 p2.SetXYZM(0., 0., -sign * ebeam, 0.938); // antiquark (?)
38
39 p1.Boost(boostV);
40 p2.Boost(boostV);
41 CSAxis = (p1.Vect().Unit() - p2.Vect().Unit()).Unit();
42 yAxis = (p1.Vect().Unit()).Cross(p2.Vect().Unit());
43 yAxis = yAxis.Unit();
44 xAxis = yAxis.Cross(CSAxis);
45 xAxis = xAxis.Unit();
46
47 phi = TMath::ATan2(lep1_boosted.Vect() * yAxis, lep1_boosted.Vect() * xAxis);
48}
49
56void Kinematics::GetBDFAngles(const TLorentzVector &lep1, const int &charge1, const TLorentzVector &lep2, double &costh, double &phi)
57{
58 const TLorentzVector dilep = lep1 + lep2;
59
60 double cosThetap = (charge1 > 0) ? TMath::TanH((lep2.Eta() - lep1.Eta()) / 2.) : TMath::TanH((lep1.Eta() - lep2.Eta()) / 2.);
61 costh = (dilep.Rapidity() < 0) ? -cosThetap : cosThetap;
62
63 double sintheta = TMath::Sqrt(1. - costh * costh);
64 double phiacop = TMath::Pi() - TVector2::Phi_mpi_pi(lep1.Phi() - lep2.Phi());
65 phi = TMath::Tan(phiacop / 2) * sintheta;
66}
67
74void Kinematics::GetVHFAngles(const TLorentzVector &lep1, const int &charge1, const TLorentzVector &lep2, double &costh, double &phi)
75{
76
77 TLorentzVector boson = lep1 + lep2;
78 TVector3 boostV = boson.BoostVector();
79 TLorentzVector lep1_boosted = (charge1 > 0) ? lep2 : lep1;
80 lep1_boosted.Boost(-boostV);
81 phi = TVector2::Phi_mpi_pi(lep1_boosted.Phi() - boson.Phi());
82 double theta = lep1_boosted.Angle(boson.Vect());
83
84 costh = TMath::Cos(theta);
85}
86
91void Kinematics::GetAiPolynominals(double costh, double phi, std::vector<double> &aipols)
92{
93
94 aipols.resize(8);
95
96 double theta = TMath::ACos(costh);
97 double sintheta = TMath::Sin(theta);
98 double sin2theta = TMath::Sin(2.0 * theta);
99
100 double cosphi = TMath::Cos(phi);
101 double cos2phi = TMath::Cos(2.0 * phi);
102 double sinphi = TMath::Sin(phi);
103 double sin2phi = TMath::Sin(2.0 * phi);
104
105 aipols[0] = 0.5 - 1.5 * costh * costh;
106 aipols[1] = sin2theta * cosphi;
107 aipols[2] = sintheta * sintheta * cos2phi;
108 aipols[3] = sintheta * cosphi;
109 aipols[4] = costh;
110 aipols[5] = sintheta * sintheta * sin2phi;
111 aipols[6] = sin2theta * sinphi;
112 aipols[7] = sintheta * sinphi;
113}
114
119std::vector<double> Kinematics::GetAiPolynominals(double costh, double phi)
120{
121 std::vector<double> aipols(8, 0);
122
123 double theta = TMath::ACos(costh);
124 double sintheta = TMath::Sin(theta);
125 double sin2theta = TMath::Sin(2.0 * theta);
126
127 double cosphi = TMath::Cos(phi);
128 double cos2phi = TMath::Cos(2.0 * phi);
129 double sinphi = TMath::Sin(phi);
130 double sin2phi = TMath::Sin(2.0 * phi);
131
132 aipols[0] = 0.5 - 1.5 * costh * costh;
133 aipols[1] = sin2theta * cosphi;
134 aipols[2] = sintheta * sintheta * cos2phi;
135 aipols[3] = sintheta * cosphi;
136 aipols[4] = costh;
137 aipols[5] = sintheta * sintheta * sin2phi;
138 aipols[6] = sin2theta * sinphi;
139 aipols[7] = sintheta * sinphi;
140
141 return aipols;
142}
static void GetAiPolynominals(double costh, double phi, std::vector< double > &aipols)
Calculate angular terms corresponding to each angular coefficient.
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 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.