00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include <Stiostream.h>
00024 #include "StGlobals.hh"
00025
00026 #define ST_ADD_OLD_CLHEP_SYSTEM_OF_UNITS
00027 #include "SystemOfUnits.h"
00028
00029 #ifndef ST_NO_NAMESPACES
00030 using namespace units;
00031 #endif
00032
00033 int main()
00034 {
00035 cout << "This program illustrates the use of SystemOfUnits and PhysicalContants" << endl;
00036 cout << "--------------------------------------------------------------------" << endl;
00037
00038 cout << "1 millimeter = " << (1*millimeter) << endl;
00039 cout << "1 meter = " << (1*meter) << endl;
00040 cout << "1 centimeter = " << (1*centimeter) << endl;
00041 cout << "1 fermi = " << (1*fermi) << endl;
00042
00043 cout << "1 barn = " << (1*barn) << endl;
00044
00045 cout << "1 degree = " << (1*degree) << endl;
00046
00047 cout << "1 second = " << (1*second) << endl;
00048 cout << "1 nanosecond = " << (1*nanosecond) << endl;
00049
00050 cout << "1 kHz = " << (1*kHz) << endl;
00051
00052 cout << "1 newton = " << (1*newton) << endl;
00053 cout << "1 joule = " << (1*joule) << endl;
00054
00055 cout << "1 GeV = " << (1*GeV) << endl;
00056 cout << "1 Gigaelectronvolt = " << (1*Gigaelectronvolt) << endl;
00057
00058
00059 #ifdef ST_ADD_OLD_CLHEP_SYSTEM_OF_UNITS
00060 cout << "The old CLHEP definitions are also supported:" << endl;
00061 cout << "---------------------------------------------" << endl;
00062 cout << "1 mm = " << (1*mm) << endl;
00063 cout << "1 m = " << (1*m) << endl;
00064 cout << "1 cm = " << (1*cm) << endl;
00065
00066 cout << "1 s = " << (1*s) << endl;
00067 cout << "1 ns = " << (1*ns) << endl;
00068 #else
00069 cout << "\nTo use the old CLHEP definitions the flag:" << endl;
00070 cout << " ST_ADD_OLD_CLHEP_SYSTEM_OF_UNITS" << endl;
00071 cout << "must be defined" << endl;
00072 cout << "**This is an obselete file and should NOT be used**" << endl;
00073 #endif
00074
00075 return 0;
00076 }