source: tags/Mars-V0.6/mars.cc@ 10107

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