source: JEM-EUSO/esaf_cc_at_lal/rootlogon.C @ 114

Last change on this file since 114 was 114, checked in by moretto, 11 years ago

actual version of ESAF at CCin2p3

File size: 3.2 KB
Line 
1{
2    enum ERootMode { kUser, kDevelop };
3    const ERootMode gMode = kDevelop;
4
5
6    new TMinuit;
7    TString appName = gROOT->GetName();
8
9    // root specific settings
10    if ( appName == "Rint" ) {
11        TString gEusoDirectory = gSystem->WorkingDirectory();
12        TString gEusoMacrosDirectory = gEusoDirectory + "/macros";
13        TString gEusoOutputDirectory = gEusoDirectory + "/output";
14
15        cout << "Adding additional paths:" << endl;
16        // set macro path to include esaf macros
17        TString macropath = gROOT->GetMacroPath();
18        if (!macropath.Contains("$PWD/macros")) {
19//             macropath += ":";
20            macropath += gSystem->ExpandPathName(":$PWD/macros");
21            macropath += gSystem->ExpandPathName(":$PWD/doc");
22            gROOT->SetMacroPath(macropath);
23            cout << "   esaf/macros" << endl; 
24        }
25 
26        if ( gMode == kUser ) {
27           
28            Bool_t first = kTRUE;
29           
30            cout << "Loading additional libraries:\n   " << flush;
31            // check to see if the event class is in the dictionary
32            // if it is not load the definition in libEvent.so
33            if (!TClassTable::GetDict("TVector3")) {
34                if ( first )  first = kFALSE; else  cout << ", ";
35                cout << "libPhysics" << flush;
36                gSystem->Load("libPhysics");
37            }
38            if (!TClassTable::GetDict("TGeoManager")) {
39                if ( first )  first = kFALSE; else  cout << ", ";
40                cout << "libGeom" << flush;
41                gSystem->Load("libGeom");
42            }
43            if (!TClassTable::GetDict("TGWindow")) {
44                if ( first )  first = kFALSE; else  cout << ", ";
45                cout << "libGui" << flush;
46                gSystem->Load("libGui");
47            }
48            if (!TClassTable::GetDict("TGedFrame")) {
49                if ( first )  first = kFALSE; else  cout << ", ";
50                cout << "libGed" << flush;
51                gSystem->Load("libGed");
52            }
53
54            if (!TClassTable::GetDict("EEvent")) {
55                if ( first )  first = kFALSE; else  cout << ", ";
56                cout << "libSimuEvent" << flush;
57                gSystem->Load("libSimuEvent");
58            }
59
60            if (!TClassTable::GetDict("EAnimator")) {
61                if ( first )  first = kFALSE; else  cout << ", ";
62                cout << "libEventViewer" << flush;
63                gSystem->Load("libEventViewer");
64            }
65
66            if (!TClassTable::GetDict("")) {
67                if ( first )  first = kFALSE; else  cout << ", ";
68                cout << "libRecoRootEvent" << flush;
69                gSystem->Load("libRecoRootEvent");
70                        }
71
72            gROOT->ProcessLine(".include packages/common/root/include");
73            gROOT->ProcessLine(".include packages/common/root/eventviewer");
74            cout << endl;
75        } else {
76            cout << "ROOT running in ESAF Developer's mode" << endl;
77            gROOT->ProcessLine(".include include");
78
79            gROOT->ProcessLine(".x doc/loadlibs.C"); 
80        }
81            gROOT->ProcessLine(".include packages/common/root/include");
82            gROOT->ProcessLine(".include packages/common/root/eventviewer");
83
84    }
85} 
Note: See TracBrowser for help on using the repository browser.