6 #include "HepMC/SimpleVector.h"
23 double p2 = v3.perp2();
24 double pt = v3.perp();
26 double th = v3.theta();
28 double mag = std::sqrt(x*x + y*y + z*z);
29 double pperp = std::sqrt(x*x + y*y);
40 if( fabs( mag - r ) > eps ) {
41 std::cout <<
"different ThreeVector magnitude: " << mag <<
" " << r << std::endl;
42 std::cout <<
"difference is : " << ( mag - r ) << std::endl;
45 if( fabs( pperp - pt ) > eps ) {
46 std::cout <<
"different ThreeVector Pt: " << pperp <<
" " << pt << std::endl;
47 std::cout <<
"difference is : " << ( pperp - pt ) << std::endl;
54 std::cout <<
"vectors v3 and vector3 are different" << std::endl;
58 std::cout <<
"vectors v3 and v3copy are different" << std::endl;
76 double t = vectorcopy.t();
83 double masssq1 = v4.m2();
84 double mass1 = v4.m();
85 double pr1 = v4.pseudoRapidity();
86 double eta1 = v4.eta();
87 double masssq2 = vector.
m2();
88 double mass2 = vector.
m();
90 double eta2 = vector.
eta();
92 vt.set(1., 2., 3., 5.5);
102 mag = std::sqrt(x*x + y*y + z*z);
103 pperp = std::sqrt(x*x + y*y);
104 if( fabs( mag - r ) > eps ) {
105 std::cout <<
"different FourVector magnitude: " << mag <<
" " << r << std::endl;
106 std::cout <<
"difference is : " << ( mag - r ) << std::endl;
109 if( fabs( pperp - pt ) > eps ) {
110 std::cout <<
"different FourVector Pt: " << pperp <<
" " << pt << std::endl;
111 std::cout <<
"difference is : " << ( pperp - pt ) << std::endl;
116 std::cout <<
"different X values: " << px <<
" " << x << std::endl;
120 std::cout <<
"different Y values: " << py <<
" " << y << std::endl;
124 std::cout <<
"different Z values: " << pz <<
" " << z << std::endl;
128 std::cout <<
"different E values: " << e <<
" " << t << std::endl;
131 if( fabs( masssq1 - masssq2 ) > eps ) {
132 std::cout <<
"different mass sq values: " << masssq1 <<
" " << masssq2 << std::endl;
133 std::cout <<
"difference is : " << ( masssq1 - masssq2 ) << std::endl;
136 if( fabs( mass1 - mass2 ) > eps ) {
137 std::cout <<
"different mass values: " << mass1 <<
" " << mass2 << std::endl;
138 std::cout <<
"difference is : " << ( mass1 - mass2 ) << std::endl;
141 if( fabs( pr1 - pr2 ) > eps ) {
142 std::cout <<
"different pseudorapidity values: " << pr1 <<
" " << pr2 << std::endl;
143 std::cout <<
"difference is : " << ( pr1 - pr2 ) << std::endl;
146 if( fabs( eta1 - eta2 ) > eps ) {
147 std::cout <<
"different eta values: " << eta1 <<
" " << eta2 << std::endl;
148 std::cout <<
"difference is : " << ( eta1 - eta2 ) << std::endl;
153 std::cout <<
"vectors v and vector are different" << std::endl;
156 if( v4 != vectorcopy ) {
157 std::cout <<
"vectors v and vectorcopy are different" << std::endl;
double m() const
Invariant mass. If m2() is negative then -sqrt(-m2()) is returned.
double px() const
return px
ThreeVector is a simple representation of a position or displacement 3 vector.
double eta() const
Pseudorapidity (of the space part)
FourVector is a simple representation of a physics 4 vector.
double m2() const
Invariant mass squared.
double pseudoRapidity() const
Returns the pseudo-rapidity, i.e. -ln(tan(theta/2))