Class Reference for E1039 Core & Analysis Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
UtilDimuon.cc
Go to the documentation of this file.
1 #include <TLorentzVector.h>
3 #include "UtilDimuon.h"
4 using namespace std;
5 
6 void UtilDimuon::GetX1X2(const SQDimuon* dim, double& x1, double& x2)
7 {
8  const double M_P = 0.938;
9  const double E_BEAM = 120.0;
10  const TLorentzVector p_beam (0, 0, sqrt(E_BEAM*E_BEAM - M_P*M_P), E_BEAM);
11  const TLorentzVector p_target(0, 0, 0, M_P);
12  const TLorentzVector p_cms = p_beam + p_target;
13  TLorentzVector p_sum = dim->get_mom_pos() + dim->get_mom_neg();
14  x1 = (p_target*p_sum)/(p_target*p_cms);
15  x2 = (p_beam *p_sum)/(p_beam *p_cms);
16 }
17 
18 void UtilDimuon::GetX1X2(const SQDimuon* dim, float& x1, float& x2)
19 {
20  double x1d, x2d;
21  GetX1X2(dim, x1d, x2d);
22  x1 = x1d;
23  x2 = x2d;
24 }
25 
26 double UtilDimuon::GetX1(const SQDimuon* dim)
27 {
28  double x1, x2;
29  GetX1X2(dim, x1, x2);
30  return x1;
31 }
32 
33 double UtilDimuon::GetX2(const SQDimuon* dim)
34 {
35  double x1, x2;
36  GetX1X2(dim, x1, x2);
37  return x2;
38 }
39 
41 
52 void UtilDimuon::CalcVar(const SQDimuon* dim, double& mass, double& pT, double& x1, double& x2, double& xF, double& costh, double& phi)
53 {
54  CalcVar(dim->get_mom_pos(), dim->get_mom_neg(),
55  mass, pT, x1, x2, xF, costh, phi);
56 }
57 
59 void UtilDimuon::CalcVar(const TLorentzVector& p_pos, const TLorentzVector& p_neg, double& mass, double& pT, double& x1, double& x2, double& xF, double& costh, double& phi)
60 {
61  const Double_t mp = 0.938;
62  const Double_t ebeam = 120.;
63  const TLorentzVector p_beam (0., 0., sqrt(ebeam*ebeam - mp*mp), ebeam);
64  const TLorentzVector p_target(0., 0., 0., mp);
65  const TLorentzVector p_cms = p_beam + p_target;
66 
67  TLorentzVector p_sum = p_pos + p_neg;
68  mass = p_sum.M();
69  pT = p_sum.Perp();
70  x1 = (p_target*p_sum)/(p_target*p_cms);
71  x2 = (p_beam *p_sum)/(p_beam *p_cms);
72 
73  Double_t s = p_cms.M2();
74  Double_t sqrts = p_cms.M();
75  TVector3 bv_cms = p_cms.BoostVector();
76  p_sum.Boost(-bv_cms);
77 
78  xF = 2 * p_sum.Pz() / sqrts / (1 - pow(mass,2) / s);
79  costh = 2 * (p_neg.E() * p_pos.Pz() - p_pos.E() * p_neg.Pz()) / mass / TMath::Sqrt(pow(mass,2) + pow(pT,2));
80  phi = TMath::ATan(2*TMath::Sqrt(pow(mass,2) + pow(pT,2)) / mass * (p_neg.Px()*p_pos.Py() - p_pos.Px()*p_neg.Py()) / (p_pos.Px()*p_pos.Px() - p_neg.Px()*p_neg.Px() + p_pos.Py()*p_pos.Py() - p_neg.Py()*p_neg.Py()));
81 }
const double s
void GetX1X2(const SQDimuon *dim, double &x1, double &x2)
Definition: UtilDimuon.cc:6
const double ebeam
void CalcVar(const SQDimuon *dim, double &mass, double &pT, double &x1, double &x2, double &xF, double &costh, double &phi)
Calculate the key kinematic variables of dimuon.
Definition: UtilDimuon.cc:52
const double mp
virtual TLorentzVector get_mom_neg() const =0
Return the momentum of the negative track at vertex.
double GetX1(const SQDimuon *dim)
Definition: UtilDimuon.cc:26
const double sqrts
const TLorentzVector p_beam(0., 0., TMath::Sqrt(ebeam *ebeam-mp *mp), ebeam)
virtual TLorentzVector get_mom_pos() const =0
Return the momentum of the positive track at vertex.
double GetX2(const SQDimuon *dim)
Definition: UtilDimuon.cc:33
const TLorentzVector p_cms
const TLorentzVector p_target(0., 0., 0., mp)
#define E_BEAM
Definition: GlobalConsts.h:14
An SQ interface class to hold one true or reconstructed dimuon.
Definition: SQDimuon.h:8
#define M_P
Definition: GlobalConsts.h:13
const TVector3 bv_cms