EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ayk.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ayk.h
1 /* -------------------------------------------------------------------------- */
2 /* ayk.h */
3 /* */
4 /* Just a few defines; all the rest is now moved to other header files. */
5 /* */
6 /* A.Kisselev, PNPI, St.Petersburg, Russia. */
7 /* e-mail: kisselev@hermes.desy.de */
8 /* -------------------------------------------------------------------------- */
9 
10 #ifndef _AYK_H
11 #define _AYK_H
12 
13 // Used everywhere;
14 #define _X_ 0
15 #define _Y_ 1
16 #define _Z_ 2
17 
18 // PI should be handy;
19 #ifndef PI
20 //#include <math.h>
21 #include <cmath>
22 #define PI M_PI
23 #endif
24 
25 // Yes, a macro;
26 #ifndef SQR
27 #define SQR(x) ((x)*(x))
28 #endif
29 
30 // Few trivial but useful defines;
31 #define mm2cm(val) ((val)/10.)
32 #define m2cm(val) ((val)*100.)
33 #define inch2cm(val) ((val)*2.54)
34 #define m2mm(val) ((val)*1000.)
35 #define cm2mm(val) ((val)*10.)
36 #define cm2m(val) ((val)/100.)
37 #define gev2mev(val) ((val)*1000.)
38 #define mev2gev(val) ((val)/1000.)
39 #define deg2rad(val) ((val)*PI/180.)
40 #define deg2mrad(val) ((val)*PI/.18)
41 #define rad2deg(val) ((val)*180./PI)
42 #define mrad2deg(val) ((val)*.18/PI)
43 #define tesla2kgs(val) ((val)*10.)
44 
45 #endif