29 #include "StGlobals.hh"
30 #include "StLorentzVector.hh"
34 cout <<
"This program tests the StThreeVector and StLorentzVector classes" << endl;
35 cout <<
"----------------------------------------------------------------" << endl;
37 cout <<
"\nTesting StThreeVector:" << endl;
42 #ifdef ST_NO_TEMPLATE_DEF_ARGS
49 double *a =
new double[3];
50 a[0] = a[1] = a[2] = 42;
51 float *b =
new float[3];
52 b[0] = b[1] = b[2] = 99;
84 PR(vec4 = vec3-0.24*vec4);
103 PR(vec1.pseudoRapidity());
108 cout <<
"Testing exception handling." << endl;
109 cout <<
"Note that depending on your platform" << endl;
110 cout <<
"the resulting actions might differ." << endl;
111 #ifndef ST_NO_EXCEPTIONS
115 catch (out_of_range &e) {
116 cout <<
"Caught exception: " << e.what() << endl;
121 cout <<
"Done" << endl;
123 cout <<
"\nTesting StLorentzVector:" << endl;
128 #ifdef ST_NO_TEMPLATE_DEF_ARGS
169 PR(lvec1 = lvec2+lvec4);
170 PR(lvec2 = lvec1/2.33);
174 PR(lvec4 = lvec3-0.24*lvec4);
187 PR(lvec3.vect().unit());
190 PR(lvec1.cosTheta());
194 PR(lvec1.pseudoRapidity());
195 PR(lvec1.rapidity());
203 cout <<
"\nConstruct a 4-vector of a pion:" << endl;
205 cout <<
"with momentum: " << pionMomentum << endl;
206 cout <<
"Energy should be: " << pionMomentum.massHypothesis(139) << endl;;
209 cout <<
"pion is: " << pion << endl;
210 double mass = ::sqrt(sqr(pion.e()) - pion.vect().mag2());
211 cout <<
"Mass is: (" << pion.e() <<
")^2 - (" << pion.vect().mag() <<
")^2 = " << mass << endl;
214 cout <<
"\nTesting exception handling." << endl;
215 cout <<
"Note that depending on your platform" << endl;
216 cout <<
"the resulting actions might differ." << endl;
217 #ifndef ST_NO_EXCEPTIONS
221 catch (out_of_range &e) {
222 cout <<
"Caught exception: " << e.what() << endl;
227 cout <<
"Done" << endl;
228 cout <<
"Test finished" << endl;