CMS 3D CMS Logo

ColinsSoperVariables.h
Go to the documentation of this file.
1 #ifndef PhysicsTools_TagAndProbe_ColinsSuperVariables
2 #define PhysicsTools_TagAndProbe_ColinsSuperVariables
3 
4 #define CM_ENERGY 7000.0
5 #include "TLorentzVector.h"
6 #include "TVector3.h"
7 
8 // calculate the Colins-Soper variables;
9 // everything is in the lab frame
10 inline void calCSVariables(TLorentzVector mu, TLorentzVector mubar, double *res, bool swap) {
11  // convention. beam direction is on the positive Z direction.
12  // beam contains quark flux.
13  TLorentzVector Pbeam(0, 0, CM_ENERGY / 2.0, CM_ENERGY / 2.0);
14  TLorentzVector Ptarget(0, 0, -CM_ENERGY / 2.0, CM_ENERGY / 2.0);
15 
16  TLorentzVector Q(mu + mubar);
17  /************************************************************************
18  *
19  * 1) cos(theta) = 2 Q^-1 (Q^2+Qt^2)^-1 (mu^+ mubar^- - mu^- mubar^+)
20  *
21  *
22  ************************************************************************/
23  double muplus = 1.0 / sqrt(2.0) * (mu.E() + mu.Z());
24  double muminus = 1.0 / sqrt(2.0) * (mu.E() - mu.Z());
25 
26  double mubarplus = 1.0 / sqrt(2.0) * (mubar.E() + mubar.Z());
27  double mubarminus = 1.0 / sqrt(2.0) * (mubar.E() - mubar.Z());
28 
29  double costheta =
30  2.0 / Q.Mag() / sqrt(pow(Q.Mag(), 2) + pow(Q.Pt(), 2)) * (muplus * mubarminus - muminus * mubarplus);
31  if (swap)
32  costheta = -costheta;
33 
34  /************************************************************************
35  *
36  * 2) sin2(theta) = Q^-2 Dt^2 - Q^-2 (Q^2 + Qt^2)^-1 * (Dt dot Qt)^2
37  *
38  ************************************************************************/
39  TLorentzVector D(mu - mubar);
40  double dt_qt = D.X() * Q.X() + D.Y() * Q.Y();
41  double sin2theta =
42  pow(D.Pt() / Q.Mag(), 2) - 1.0 / pow(Q.Mag(), 2) / (pow(Q.Mag(), 2) + pow(Q.Pt(), 2)) * pow(dt_qt, 2);
43 
44  /************************************************************************
45  *
46  * 3) tanphi = (Q^2 + Qt^2)^1/2 / Q (Dt dot R unit) /(Dt dot Qt unit)
47  *
48  ************************************************************************/
49  // unit vector on R direction
50  TVector3 R = Pbeam.Vect().Cross(Q.Vect());
51  TVector3 Runit = R.Unit();
52 
53  // unit vector on Qt
54  TVector3 Qt = Q.Vect();
55  Qt.SetZ(0);
56  TVector3 Qtunit = Qt.Unit();
57 
58  TVector3 Dt = D.Vect();
59  Dt.SetZ(0);
60  double tanphi = sqrt(pow(Q.Mag(), 2) + pow(Q.Pt(), 2)) / Q.Mag() * Dt.Dot(Runit) / Dt.Dot(Qtunit);
61  if (swap)
62  tanphi = -tanphi;
63 
64  res[0] = costheta;
65  res[1] = sin2theta;
66  res[2] = tanphi;
67 }
68 
69 #endif
constexpr int pow(int x)
Definition: conifer.h:24
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:112
Definition: Electron.h:6
#define CM_ENERGY
T sqrt(T t)
Definition: SSEVec.h:19
const int mubar
Definition: Constants.h:23
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:141
void calCSVariables(TLorentzVector mu, TLorentzVector mubar, double *res, bool swap)