]> git.uio.no Git - u/mrichter/AliRoot.git/blob - SHUTTLE/Shuttle.C
small update
[u/mrichter/AliRoot.git] / SHUTTLE / Shuttle.C
1 void Shuttle(const char* param = "listen") {
2
3         // WARNING: if ldap is built with ssl support it may cause confilcts with the 
4         // AliEn interface. If this happens, grid storage activation must be done BEFORE 
5         // loading LDAP libraries!!!
6
7         gSystem->Load("libRLDAP.so");
8         gSystem->Load("libSHUTTLE");
9         gSystem->Load("$ROOTSYS/lib/libThread");
10         gSystem->Load("$ALICE_ROOT/SHUTTLE/test/libTest.so");
11
12 //      AliLog::SetGlobalDebugLevel(1);
13
14         // Setting local CDB and reference storage locations
15         AliShuttle::SetMainCDB("alien://DBFolder=ShuttleCDB");
16         AliShuttle::SetLocalCDB("local://LocalShuttleCDB");
17         AliShuttle::SetMainRefStorage("alien://DBFolder=GridReferenceStorage");
18         AliShuttle::SetLocalRefStorage("local://LocalReferenceStorage");
19
20         AliShuttle::SetProcessDCS(kTRUE);
21
22
23 //      AliCDBManager *man = AliCDBManager::Instance();
24 //      man->SetDefaultStorage("local://MainCDB");
25 //      man->SetDefaultStorage("alien://DBFolder=ShuttleMainCDB");
26
27
28         AliShuttleConfig config("pcalice290.cern.ch", 389, "o=alice,dc=cern,dc=ch");
29         config.SetProcessAll(kTRUE);
30         config.Print();
31
32         AliShuttleTrigger trigger(&config);
33
34         AliShuttle* shuttle = trigger.GetShuttle();
35
36         // Add here detectors preprocessor ...
37         TestTPCPreprocessor *tpcPrep = new TestTPCPreprocessor("TPC",shuttle);
38         TestITSPreprocessor *itsPrep = new TestITSPreprocessor("ITS",shuttle);
39         TestRICHPreprocessor *richPrep = new TestRICHPreprocessor("RICH",shuttle);
40
41         TString paramStr(param);
42         
43         if (paramStr.IsDigit()) {
44                 Int_t run = paramStr.Atoi();
45                 trigger.Collect(run);
46         } else if (paramStr == "new") {
47                 trigger.CollectNew();
48         } else if (paramStr == "all") {
49                 trigger.CollectAll();
50         } else if (paramStr == "listen") {
51                 trigger.Run();
52   } else if (paramStr.BeginsWith("lastrun=")) {
53     Int_t run = TString(paramStr(8, paramStr.Length()-7).Data()).Atoi();
54     cout << run << endl;
55     trigger.SetNewLastRun(run);
56         } else {
57                 cout<<"Bad parameter: "<<param<<endl;
58                 cout<<"Parameter options: "<<endl;
59                 cout<<"<run> - collect data for the given run"<<endl;
60                 cout<<"new - collect data only for the new runs"<<endl;
61                 cout<<"all - collect data for all runs"<<endl;
62                 cout<<"listen - start listening for DAQ notification"<<endl;
63                 cout<<"lastrun=<run> - sets last run manually. use with caution!" << endl;
64                 cout<<"<empty parameter> - the same as 'listen'"<<endl;
65         }
66
67         AliCDBManager::Destroy();
68 }
69
70