StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
units.cc
1 /***************************************************************************
2  *
3  * $Id: units.cc,v 1.2 2003/09/02 17:59:38 perev Exp $
4  *
5  * Author: bl, June 1998
6  ***************************************************************************
7  *
8  * Description:
9  *
10  ***************************************************************************
11  *
12  * $Log: units.cc,v $
13  * Revision 1.2 2003/09/02 17:59:38 perev
14  * gcc 3.2 updates + WarnOff
15  *
16  * Revision 1.1 1999/02/17 12:44:03 ullrich
17  * New Revision
18  *
19  * Revision 1.1 1999/01/23 00:26:53 ullrich
20  * Initial Revision
21  *
22  **************************************************************************/
23 #include <Stiostream.h>
24 #include "StGlobals.hh"
25 
26 #define ST_ADD_OLD_CLHEP_SYSTEM_OF_UNITS
27 #include "SystemOfUnits.h"
28 
29 #ifndef ST_NO_NAMESPACES
30 using namespace units;
31 #endif
32 
33 int main()
34 {
35  cout << "This program illustrates the use of SystemOfUnits and PhysicalContants" << endl;
36  cout << "--------------------------------------------------------------------" << endl;
37 
38  cout << "1 millimeter = " << (1*millimeter) << endl;
39  cout << "1 meter = " << (1*meter) << endl;
40  cout << "1 centimeter = " << (1*centimeter) << endl;
41  cout << "1 fermi = " << (1*fermi) << endl;
42 
43  cout << "1 barn = " << (1*barn) << endl;
44 
45  cout << "1 degree = " << (1*degree) << endl;
46 
47  cout << "1 second = " << (1*second) << endl;
48  cout << "1 nanosecond = " << (1*nanosecond) << endl;
49 
50  cout << "1 kHz = " << (1*kHz) << endl;
51 
52  cout << "1 newton = " << (1*newton) << endl;
53  cout << "1 joule = " << (1*joule) << endl;
54 
55  cout << "1 GeV = " << (1*GeV) << endl;
56  cout << "1 Gigaelectronvolt = " << (1*Gigaelectronvolt) << endl;
57 
58 
59 #ifdef ST_ADD_OLD_CLHEP_SYSTEM_OF_UNITS
60  cout << "The old CLHEP definitions are also supported:" << endl;
61  cout << "---------------------------------------------" << endl;
62  cout << "1 mm = " << (1*mm) << endl;
63  cout << "1 m = " << (1*m) << endl;
64  cout << "1 cm = " << (1*cm) << endl;
65 
66  cout << "1 s = " << (1*s) << endl;
67  cout << "1 ns = " << (1*ns) << endl;
68 #else
69  cout << "\nTo use the old CLHEP definitions the flag:" << endl;
70  cout << " ST_ADD_OLD_CLHEP_SYSTEM_OF_UNITS" << endl;
71  cout << "must be defined" << endl;
72  cout << "**This is an obselete file and should NOT be used**" << endl;
73 #endif
74 
75  return 0;
76 }