1 |
#include "Angles.h"
|
2 |
#include <iostream>
|
3 |
|
4 |
//
|
5 |
//
|
6 |
//
|
7 |
|
8 |
void getAngles_SanityCheck( LabVectors &l, Angles &a ) {
|
9 |
|
10 |
//
|
11 |
// define the frames & coordinate systems
|
12 |
// --------------------------------------------------------------------------------------------------
|
13 |
|
14 |
TVector3 Xframe = l.vec4l.BoostVector();
|
15 |
TVector3 Z1frame = l.vecz1.BoostVector();
|
16 |
TVector3 Z2frame = l.vecz2.BoostVector();
|
17 |
|
18 |
// "partons" (pg6)
|
19 |
TLorentzVector kq( 0, 0, (l.vec4l.E()+l.vec4l.Pz())/2, (l.vec4l.E()+l.vec4l.Pz())/2 );
|
20 |
TLorentzVector kqbar( 0, 0, (l.vec4l.Pz()-l.vec4l.E())/2, (l.vec4l.E()-l.vec4l.Pz())/2 );
|
21 |
TLorentzVector veckq_in_Xframe(kq);
|
22 |
TLorentzVector veckqbar_in_Xframe(kqbar);
|
23 |
veckq_in_Xframe.Boost(-1*Xframe);
|
24 |
veckqbar_in_Xframe.Boost(-1*Xframe);
|
25 |
|
26 |
|
27 |
// Zn vectors
|
28 |
TLorentzVector vecz1_in_Xframe (l.vecz1);
|
29 |
TLorentzVector vecz2_in_Xframe (l.vecz2);
|
30 |
TLorentzVector vecz1_in_Z1frame (l.vecz1);
|
31 |
TLorentzVector vecz2_in_Z2frame (l.vecz2);
|
32 |
vecz1_in_Xframe.Boost(-1*Xframe);
|
33 |
vecz2_in_Xframe.Boost(-1*Xframe);
|
34 |
vecz1_in_Z1frame.Boost(-1*Z1frame);
|
35 |
vecz2_in_Z2frame.Boost(-1*Z2frame);
|
36 |
|
37 |
// coord system in the CM frame
|
38 |
TVector3 uz_in_Xframe = vecz1_in_Xframe.Vect().Unit();
|
39 |
TVector3 uy_in_Xframe = (veckq_in_Xframe.Vect().Unit().Cross(uz_in_Xframe.Unit())).Unit();
|
40 |
TVector3 ux_in_Xframe = (uy_in_Xframe.Unit().Cross(uz_in_Xframe.Unit())).Unit();
|
41 |
TRotation rotation;
|
42 |
rotation = rotation.RotateAxes( ux_in_Xframe,uy_in_Xframe,uz_in_Xframe ).Inverse();
|
43 |
|
44 |
// coords for Z2. rotate CM around y by pi
|
45 |
TVector3 ux_in_Xframe_z2(ux_in_Xframe);
|
46 |
TVector3 uy_in_Xframe_z2(uy_in_Xframe);
|
47 |
TVector3 uz_in_Xframe_z2(uz_in_Xframe);
|
48 |
TRotation aroundy;
|
49 |
aroundy.Rotate(TMath::Pi(),uy_in_Xframe_z2);
|
50 |
ux_in_Xframe_z2.Transform(aroundy);
|
51 |
uz_in_Xframe_z2.Transform(aroundy);
|
52 |
TRotation rotation2;
|
53 |
rotation2 = rotation2.RotateAxes( ux_in_Xframe_z2,uy_in_Xframe_z2,uz_in_Xframe_z2 ).Inverse();
|
54 |
|
55 |
//
|
56 |
// for going to the Z frames from the CM frame
|
57 |
//
|
58 |
TLorentzVector vecz1_in_Xframe_newcoords(vecz1_in_Xframe);
|
59 |
vecz1_in_Xframe_newcoords.Transform(rotation);
|
60 |
TVector3 Z1frame_from_Xframe_newcoords = vecz1_in_Xframe_newcoords.BoostVector();
|
61 |
TLorentzVector vecz2_in_Xframe_newcoords(vecz2_in_Xframe);
|
62 |
vecz2_in_Xframe_newcoords.Transform(rotation2);
|
63 |
TVector3 Z2frame_from_Xframe_newcoords = vecz2_in_Xframe_newcoords.BoostVector();
|
64 |
|
65 |
// check ...
|
66 |
TLorentzVector vecl1m_in_Z1(l.vecl1m );
|
67 |
TLorentzVector vecl1p_in_Z1(l.vecl1p );
|
68 |
vecl1m_in_Z1.Boost(-1*Xframe);
|
69 |
vecl1p_in_Z1.Boost(-1*Xframe);
|
70 |
vecl1m_in_Z1.Transform(rotation);
|
71 |
vecl1p_in_Z1.Transform(rotation);
|
72 |
vecl1m_in_Z1.Boost(-1*Z1frame_from_Xframe_newcoords);
|
73 |
vecl1p_in_Z1.Boost(-1*Z1frame_from_Xframe_newcoords);
|
74 |
|
75 |
std::cerr << "closure: " << vecl1m_in_Z1.Vect().Dot(vecl1p_in_Z1.Vect()) /
|
76 |
(vecl1m_in_Z1.Vect().Mag()*vecl1p_in_Z1.Vect().Mag())
|
77 |
<< std::endl;
|
78 |
// kq.Print();
|
79 |
// kqbar.Print();
|
80 |
std::cout << "closure1: " << veckq_in_Xframe.Vect().Unit().Dot(veckqbar_in_Xframe.Vect().Unit())
|
81 |
<< std::endl;
|
82 |
//std::cerr << "closure2: " << vecz1_in_Xframe_newcoords.Vect().Unit().Dot(uz_in_Xframe) << std::endl;
|
83 |
std::cerr << "closure2: " << vecz1_in_Xframe_newcoords.Vect().CosTheta() << std::endl;
|
84 |
|
85 |
//
|
86 |
TVector3 tmp = uz_in_Xframe;
|
87 |
std::cerr << "closure:: cosTheta(uz) wrt nominal z: " << tmp.CosTheta() << std::endl;
|
88 |
std::cerr << "closure:: cosTheta(uz) [from dot] wrt uz:" << tmp.Unit().Dot(uz_in_Xframe) << std::endl;
|
89 |
tmp.Print();
|
90 |
tmp = tmp.Transform(rotation);
|
91 |
tmp.Print();
|
92 |
std::cerr << "closure:: cosTheta(uz) wrt nominal z [after rot]: " << tmp.CosTheta() << std::endl;
|
93 |
std::cerr << "closure:: cosTheta(uz) [for dot] wrt uz [after rot]:" << tmp.Unit().Dot(uz_in_Xframe) << std::endl;
|
94 |
std::cerr << std::endl;
|
95 |
|
96 |
// more checks
|
97 |
TVector3 newx(0,1,0);
|
98 |
TVector3 newy(0,0,1);
|
99 |
TVector3 newz(1,0,0);
|
100 |
TRotation r;
|
101 |
r.RotateAxes(newx,newy,newz);
|
102 |
TVector3 test(0,0,1);
|
103 |
std::cerr << "test0: " << test.CosTheta() << std::endl;
|
104 |
test.Print();
|
105 |
test.Transform(r);
|
106 |
std::cerr << "test1: " << test.CosTheta() << std::endl;
|
107 |
test.Print();
|
108 |
|
109 |
|
110 |
|
111 |
}
|