1 | #include <TROOT.h>
|
---|
2 | #include <TApplication.h>
|
---|
3 |
|
---|
4 | #include "MAGIC.h"
|
---|
5 |
|
---|
6 | #include "MLog.h"
|
---|
7 | #include "MLogManip.h"
|
---|
8 |
|
---|
9 | #include "MMars.h"
|
---|
10 | #include "MArray.h"
|
---|
11 | #include "MParContainer.h"
|
---|
12 |
|
---|
13 | #ifdef HAVE_XPM
|
---|
14 | #include "MLogo.h"
|
---|
15 | #endif
|
---|
16 |
|
---|
17 | using namespace std;
|
---|
18 |
|
---|
19 | // **********************************************************************
|
---|
20 | //
|
---|
21 | // MARS main program
|
---|
22 | //
|
---|
23 | // The only job of the main program is the initialisation of ROOT and
|
---|
24 | // the start of the guiinterface for the mars program
|
---|
25 | //
|
---|
26 | // started by h. kornmayer january, 3rd 2001
|
---|
27 |
|
---|
28 | void Usage()
|
---|
29 | {
|
---|
30 | gLog << "Sorry the usage is:" << endl;
|
---|
31 | gLog << " mars [-v#]" << endl << endl;
|
---|
32 | gLog << " -v0: verbosity level: as less as possible" << endl;
|
---|
33 | gLog << " -v1: errors only" << endl;
|
---|
34 | gLog << " -v2: errors and warnings <default>" << endl;
|
---|
35 | gLog << " -v3: errors, warnings and infos" << endl;
|
---|
36 | }
|
---|
37 |
|
---|
38 | int main(int argc, char **argv)
|
---|
39 | {
|
---|
40 | #ifdef HAVE_XPM
|
---|
41 | MLogo logo;
|
---|
42 | logo.Popup();
|
---|
43 | #endif
|
---|
44 |
|
---|
45 | gLog << all << endl;
|
---|
46 |
|
---|
47 | // 1 2 3 4 5
|
---|
48 | // 12345678901234567890123456789012345678901234567890
|
---|
49 | gLog << "==================================================" << endl;
|
---|
50 | gLog << " MARS V" << MARSVER << " " << endl;
|
---|
51 | gLog << " Magic Analysis and Reconstruction Software " << endl;
|
---|
52 | gLog << " Compiled on <" << __DATE__ << ">" << endl;
|
---|
53 | gLog << " Using ROOT v" << ROOTVER << endl;
|
---|
54 | gLog << "==================================================" << endl;
|
---|
55 | gLog << endl;
|
---|
56 |
|
---|
57 | //
|
---|
58 | // check for the right usage of the program
|
---|
59 | //
|
---|
60 | if (argc<1 || argc>2)
|
---|
61 | {
|
---|
62 | Usage();
|
---|
63 | return -1;
|
---|
64 | }
|
---|
65 |
|
---|
66 | if (argc==2)
|
---|
67 | {
|
---|
68 | if (argv[1][0]!='-' || argv[1][1]!='v')
|
---|
69 | {
|
---|
70 | Usage();
|
---|
71 | return -1;
|
---|
72 | }
|
---|
73 |
|
---|
74 | switch (argv[1][2])
|
---|
75 | {
|
---|
76 | case '0':
|
---|
77 | gLog.SetDebugLevel(0);
|
---|
78 | break;
|
---|
79 | case '1':
|
---|
80 | gLog.SetDebugLevel(1);
|
---|
81 | break;
|
---|
82 | case '2':
|
---|
83 | gLog.SetDebugLevel(2);
|
---|
84 | break;
|
---|
85 | case '3':
|
---|
86 | gLog.SetDebugLevel(3);
|
---|
87 | break;
|
---|
88 | default:
|
---|
89 | Usage();
|
---|
90 | return -1;
|
---|
91 | }
|
---|
92 | }
|
---|
93 | else
|
---|
94 | gLog.SetDebugLevel(2);
|
---|
95 |
|
---|
96 | //
|
---|
97 | // Swtich of TObjectStreamer in our base classes derived from TObject
|
---|
98 | //
|
---|
99 | MArray::Class()->IgnoreTObjectStreamer();
|
---|
100 | MParContainer::Class()->IgnoreTObjectStreamer();
|
---|
101 |
|
---|
102 | //
|
---|
103 | // initialise ROOT
|
---|
104 | //
|
---|
105 | TROOT simple("mars", "MARS - Magic Analysis and Reconstruction Software");
|
---|
106 |
|
---|
107 | TApplication app("MarsApp", &argc, argv);
|
---|
108 |
|
---|
109 | #ifdef HAVE_XPM
|
---|
110 | logo.Popdown();
|
---|
111 | #endif
|
---|
112 |
|
---|
113 | //
|
---|
114 | // start the main window
|
---|
115 | //
|
---|
116 | new MMars;
|
---|
117 |
|
---|
118 | //
|
---|
119 | // run the application
|
---|
120 | //
|
---|
121 | app.Run();
|
---|
122 |
|
---|
123 | gLog << all << endl;
|
---|
124 |
|
---|
125 | return 0;
|
---|
126 | }
|
---|
127 |
|
---|
128 |
|
---|