26 #define M_PI 3.14159265358979312e+00
29 #include "StGlobals.hh"
30 #include "StLorentzVector.hh"
31 #include "SystemOfUnits.h"
32 #include "PhysicalConstants.h"
33 #include "Randomize.h"
43 cout <<
"This programs generates a phi meson with random momentum px, py, pz" << endl;
44 cout <<
"and lets it decay into electrons. Their momenta are then calculated" << endl;
45 cout <<
"in the lab frame. Tests essentially StLorentzVector<>::boost()" << endl;
54 cout <<
"parent particle: " << endl;
55 cout <<
"\t4-momentum: " << parent << endl;
56 cout <<
"\tinvariant mass: " << abs(parent) << endl;
62 double mass1 = electron_mass_c2;
63 double mass2 = electron_mass_c2;
64 double massParent = abs(parent);
65 double E1 = (massParent*massParent + mass1*mass1 - mass2*mass2)/(2.*massParent);
66 double E2 = massParent - E1;
67 double p1 = ::sqrt((E1 + mass1)*(E1 - mass1));
68 double p2 = ::sqrt((massParent*massParent-(mass1+mass2)*(mass1+mass2))*
69 (massParent*massParent-(mass1-mass2)*(mass1-mass2)))/(2.*massParent);
74 double costheta = 2*rflat.shoot() - 1;
75 double sintheta = ::sqrt((1 + costheta)*(1 - costheta));
76 double phi = 2*pi*rflat.shoot();
87 cout <<
"decay particles in CM frame of parent: " << endl;
88 cout <<
"daughter1: " << endl;
89 cout <<
"\t4-momentum: " << daughter1 << endl;
90 cout <<
"\tinvariant mass: " << abs(daughter1) << endl;
91 cout <<
"daughter2: " << endl;
92 cout <<
"\t4-momentum: " << daughter2 << endl;
93 cout <<
"\tinvariant mass: " << abs(daughter2) << endl;
98 daughter1 = daughter1.boost(parent);
99 daughter2 = daughter2.boost(parent);
101 cout <<
"decay particles in lab frame: " << endl;
102 cout <<
"daughter1: " << endl;
103 cout <<
"\t4-momentum: " << daughter1 << endl;
104 cout <<
"\tinvariant mass: " << abs(daughter1) << endl;
105 cout <<
"daughter2: " << endl;
106 cout <<
"\t4-momentum: " << daughter2 << endl;
107 cout <<
"\tinvariant mass: " << abs(daughter2) << endl;
113 cout <<
"cross-check: reconstructed parent" << endl;
114 cout <<
"\t4-momentum: " << check << endl;
115 cout <<
"\tinvariant mass: " << abs(check) << endl;