source: tags/Mars-V0.8/mars.cc@ 18558

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