00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include <Stiostream.h>
00024 #include <math.h>
00025 #include "StGlobals.hh"
00026 #include "StLorentzVector.hh"
00027 #include "SystemOfUnits.h"
00028 #include "PhysicalConstants.h"
00029 #include "Randomize.h"
00030
00031 int main()
00032 {
00033 HepJamesRandom engine;
00034 RandFlat rflat(engine);
00035
00036
00037
00038
00039 cout << "This programs generates a phi meson with random momentum px, py, pz" << endl;
00040 cout << "and lets it decay into electrons. Their momenta are then calculated" << endl;
00041 cout << "in the lab frame. Tests essentially StLorentzVector<>::boost()" << endl;
00042
00043
00044
00045
00046
00047 StThreeVector<double> p(rflat.shoot()*GeV, rflat.shoot()*GeV, rflat.shoot()*GeV);
00048 StLorentzVector<double> parent(p, p.massHypothesis(1020*MeV));
00049
00050 cout << "parent particle: " << endl;
00051 cout << "\t4-momentum: " << parent << endl;
00052 cout << "\tinvariant mass: " << abs(parent) << endl;
00053
00054
00055
00056
00057
00058 double mass1 = electron_mass_c2;
00059 double mass2 = electron_mass_c2;
00060 double massParent = abs(parent);
00061 double E1 = (massParent*massParent + mass1*mass1 - mass2*mass2)/(2.*massParent);
00062 double E2 = massParent - E1;
00063 double p1 = ::sqrt((E1 + mass1)*(E1 - mass1));
00064 double p2 = ::sqrt((massParent*massParent-(mass1+mass2)*(mass1+mass2))*
00065 (massParent*massParent-(mass1-mass2)*(mass1-mass2)))/(2.*massParent);
00066
00067
00068
00069
00070 double costheta = 2*rflat.shoot() - 1;
00071 double sintheta = ::sqrt((1 + costheta)*(1 - costheta));
00072 double phi = 2*pi*rflat.shoot();
00073
00074
00075
00076
00077 StThreeVector<double> momentum(p1*sintheta*cos(phi),
00078 p1*sintheta*sin(phi),
00079 p1*costheta);
00080 StLorentzVector<double> daughter1(E1, momentum);
00081 StLorentzVector<double> daughter2(E2, -momentum);
00082
00083 cout << "decay particles in CM frame of parent: " << endl;
00084 cout << "daughter1: " << endl;
00085 cout << "\t4-momentum: " << daughter1 << endl;
00086 cout << "\tinvariant mass: " << abs(daughter1) << endl;
00087 cout << "daughter2: " << endl;
00088 cout << "\t4-momentum: " << daughter2 << endl;
00089 cout << "\tinvariant mass: " << abs(daughter2) << endl;
00090
00091
00092
00093
00094 daughter1 = daughter1.boost(parent);
00095 daughter2 = daughter2.boost(parent);
00096
00097 cout << "decay particles in lab frame: " << endl;
00098 cout << "daughter1: " << endl;
00099 cout << "\t4-momentum: " << daughter1 << endl;
00100 cout << "\tinvariant mass: " << abs(daughter1) << endl;
00101 cout << "daughter2: " << endl;
00102 cout << "\t4-momentum: " << daughter2 << endl;
00103 cout << "\tinvariant mass: " << abs(daughter2) << endl;
00104
00105
00106
00107
00108 StLorentzVector<double> check = daughter1+daughter2;
00109 cout << "cross-check: reconstructed parent" << endl;
00110 cout << "\t4-momentum: " << check << endl;
00111 cout << "\tinvariant mass: " << abs(check) << endl;
00112
00113 return 0;
00114 }