StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
physicalHelixTest.cc
1 /***************************************************************************
2  *
3  * $Id: physicalHelixTest.cc,v 1.1 1999/02/17 12:44:00 ullrich Exp $
4  *
5  * Author: Thomas Ullrich, April 1998
6  ***************************************************************************
7  *
8  * Description:
9  * Program to test StPhysicalHelix
10  *
11  ***************************************************************************
12  *
13  * $Log: physicalHelixTest.cc,v $
14  * Revision 1.1 1999/02/17 12:44:00 ullrich
15  * New Revision
16  *
17  * Revision 1.1 1999/01/23 00:26:48 ullrich
18  * Initial Revision
19  *
20  **************************************************************************/
21 #include "StPhysicalHelix.hh"
22 #include "SystemOfUnits.h"
23 
24 #ifndef ST_NO_NAMESPACES
25 using namespace units;
26 #endif
27 
28 int main(int, char*)
29 {
30  StThreeVector<double> p(1*GeV, 1.2*GeV, 0.03*GeV);
31  StThreeVector<double> o; // defaults to (0,0,0)
32  const double B = 0.5*tesla;
33  const double q = -1;
34 
35  cout << "Creating helix with:" << endl;
36  cout << "momentum = " << p << endl;
37  cout << "origin = " << o << endl;
38  cout << "charge = " << q << endl;
39  cout << "B field = " << B << endl;
40 
41  StPhysicalHelix track(p, o, B, q);
42 
43  cout << "The helix parameters are:" << endl;
44  cout << track << endl;
45 
46  cout << "Scanning from s=0 to s=2 m:" << endl;
47 
48  for (double s=0; s<=2*meter; s+=40*centimeter) {
49  p = track.momentumAt(s, B);
50  cout << "s=" << s << " mm " << "\t-> p = " << p
51  << " MeV" << "\t |p| = " << abs(p) << endl;
52  }
53 
54  return 0;
55 }