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