00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "StGlobals.hh"
00022 #include "StHelix.hh"
00023 #include "SystemOfUnits.h"
00024 #include "PhysicalConstants.h"
00025
00026 #ifndef ST_NO_NAMESPACES
00027 using namespace units;
00028 #endif
00029
00030 int main()
00031 {
00032 double radius = 2*meter;
00033 double dipAngle = 7*degree;
00034 double phase = 124*degree;
00035 int H = -1;
00036
00037 StThreeVector<double> origin;
00038
00039 StHelix helix(1/(radius),
00040 dipAngle,
00041 phase,
00042 origin,
00043 H);
00044
00045 cout << "helix = " << helix << endl;
00046
00047 double s = 0;
00048 for (int i=0; i<20; i++) {
00049 cout << s << '\t' << helix.at(s) << endl;
00050 s += 20*centimeter;
00051 }
00052
00053
00054
00055
00056
00057
00058 double sprime = 1.2*meter;
00059 StThreeVector<double> r = helix.at(sprime);
00060
00061 StThreeVector<double> n(0,1,1);
00062
00063 double ss = helix.pathLength(r, n.unit());
00064
00065 cout << "path length at intersection s = " << ss << endl;
00066 cout << "precision = " << (sprime-ss)/micrometer << " um" << endl;
00067
00068 return 0;
00069 }