25 #include "StGlobals.hh"
26 #include "StLorentzVector.hh"
27 #include "SystemOfUnits.h"
28 #include "PhysicalConstants.h"
29 #include "Randomize.h"
39 cout <<
"This programs generates a phi meson with random momentum px, py, pz" << endl;
40 cout <<
"and lets it decay into electrons. Their momenta are then calculated" << endl;
41 cout <<
"in the lab frame. Tests essentially StLorentzVector<>::boost()" << endl;
50 cout <<
"parent particle: " << endl;
51 cout <<
"\t4-momentum: " << parent << endl;
52 cout <<
"\tinvariant mass: " << abs(parent) << endl;
58 double mass1 = electron_mass_c2;
59 double mass2 = electron_mass_c2;
60 double massParent = abs(parent);
61 double E1 = (massParent*massParent + mass1*mass1 - mass2*mass2)/(2.*massParent);
62 double E2 = massParent - E1;
63 double p1 = ::sqrt((E1 + mass1)*(E1 - mass1));
64 double p2 = ::sqrt((massParent*massParent-(mass1+mass2)*(mass1+mass2))*
65 (massParent*massParent-(mass1-mass2)*(mass1-mass2)))/(2.*massParent);
70 double costheta = 2*rflat.shoot() - 1;
71 double sintheta = ::sqrt((1 + costheta)*(1 - costheta));
72 double phi = 2*pi*rflat.shoot();
83 cout <<
"decay particles in CM frame of parent: " << endl;
84 cout <<
"daughter1: " << endl;
85 cout <<
"\t4-momentum: " << daughter1 << endl;
86 cout <<
"\tinvariant mass: " << abs(daughter1) << endl;
87 cout <<
"daughter2: " << endl;
88 cout <<
"\t4-momentum: " << daughter2 << endl;
89 cout <<
"\tinvariant mass: " << abs(daughter2) << endl;
94 daughter1 = daughter1.boost(parent);
95 daughter2 = daughter2.boost(parent);
97 cout <<
"decay particles in lab frame: " << endl;
98 cout <<
"daughter1: " << endl;
99 cout <<
"\t4-momentum: " << daughter1 << endl;
100 cout <<
"\tinvariant mass: " << abs(daughter1) << endl;
101 cout <<
"daughter2: " << endl;
102 cout <<
"\t4-momentum: " << daughter2 << endl;
103 cout <<
"\tinvariant mass: " << abs(daughter2) << endl;
109 cout <<
"cross-check: reconstructed parent" << endl;
110 cout <<
"\t4-momentum: " << check << endl;
111 cout <<
"\tinvariant mass: " << abs(check) << endl;