1 | /* ======================================================================== *\
|
---|
2 | !
|
---|
3 | ! *
|
---|
4 | ! * This file is part of MARS, the MAGIC Analysis and Reconstruction
|
---|
5 | ! * Software. It is distributed to you in the hope that it can be a useful
|
---|
6 | ! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
|
---|
7 | ! * It is distributed WITHOUT ANY WARRANTY.
|
---|
8 | ! *
|
---|
9 | ! * Permission to use, copy, modify and distribute this software and its
|
---|
10 | ! * documentation for any purpose is hereby granted without fee,
|
---|
11 | ! * provided that the above copyright notice appear in all copies and
|
---|
12 | ! * that both that copyright notice and this permission notice appear
|
---|
13 | ! * in supporting documentation. It is provided "as is" without express
|
---|
14 | ! * or implied warranty.
|
---|
15 | ! *
|
---|
16 | !
|
---|
17 | !
|
---|
18 | ! Author(s): Thomas Bretz 12/2000 (tbretz@uni-sw.gwdg.de)
|
---|
19 | !
|
---|
20 | ! Copyright: MAGIC Software Development, 2000-2001
|
---|
21 | !
|
---|
22 | !
|
---|
23 | \* ======================================================================== */
|
---|
24 |
|
---|
25 | Bool_t isloaded()
|
---|
26 | {
|
---|
27 | TString str = gSystem->GetLibraries("*/mars.so");
|
---|
28 |
|
---|
29 | return !str.IsNull();
|
---|
30 | }
|
---|
31 |
|
---|
32 | void unload()
|
---|
33 | {
|
---|
34 | if (!isloaded())
|
---|
35 | return;
|
---|
36 |
|
---|
37 | cout << "Unloading 'mars.so'... " << flush;
|
---|
38 | if (gSystem->Unload("mars.so"))
|
---|
39 | cout << "error." << endl;
|
---|
40 | else
|
---|
41 | cout << "done." << endl << endl;
|
---|
42 | }
|
---|
43 |
|
---|
44 | void load()
|
---|
45 | {
|
---|
46 | if (isloaded())
|
---|
47 | return;
|
---|
48 |
|
---|
49 | cout << "Loading 'mars.so'... " << flush;
|
---|
50 |
|
---|
51 | if (gSystem->Load("mars.so")!=0)
|
---|
52 | cout << "error." << endl;
|
---|
53 | else
|
---|
54 | {
|
---|
55 | MParContainer::Class()->IgnoreTObjectStreamer();
|
---|
56 | MArray::Class()->IgnoreTObjectStreamer();
|
---|
57 | cout << "done." << endl;
|
---|
58 | }
|
---|
59 |
|
---|
60 | cout << endl;
|
---|
61 | }
|
---|
62 |
|
---|
63 | void make()
|
---|
64 | {
|
---|
65 | unload();
|
---|
66 |
|
---|
67 | if (gSystem->Exec("make"))
|
---|
68 | {
|
---|
69 | cout << "Error calling make..." << endl;
|
---|
70 | return;
|
---|
71 | }
|
---|
72 |
|
---|
73 | load();
|
---|
74 | }
|
---|
75 |
|
---|
76 | void rootlogon()
|
---|
77 | {
|
---|
78 | cout << endl;
|
---|
79 |
|
---|
80 | load();
|
---|
81 |
|
---|
82 | cout << "Welcome to the Mars Root environment." << endl;
|
---|
83 |
|
---|
84 | cout << endl;
|
---|
85 | }
|
---|