00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "StPhysicalHelix.hh"
00022 #include "SystemOfUnits.h"
00023
00024 #ifndef ST_NO_NAMESPACES
00025 using namespace units;
00026 #endif
00027
00028 int main(int, char*)
00029 {
00030 StThreeVector<double> p(1*GeV, 1.2*GeV, 0.03*GeV);
00031 StThreeVector<double> o;
00032 const double B = 0.5*tesla;
00033 const double q = -1;
00034
00035 cout << "Creating helix with:" << endl;
00036 cout << "momentum = " << p << endl;
00037 cout << "origin = " << o << endl;
00038 cout << "charge = " << q << endl;
00039 cout << "B field = " << B << endl;
00040
00041 StPhysicalHelix track(p, o, B, q);
00042
00043 cout << "The helix parameters are:" << endl;
00044 cout << track << endl;
00045
00046 cout << "Scanning from s=0 to s=2 m:" << endl;
00047
00048 for (double s=0; s<=2*meter; s+=40*centimeter) {
00049 p = track.momentumAt(s, B);
00050 cout << "s=" << s << " mm " << "\t-> p = " << p
00051 << " MeV" << "\t |p| = " << abs(p) << endl;
00052 }
00053
00054 return 0;
00055 }