fcf848753d40ca23ff173819f50a3ad4ba955f56
[u/mrichter/AliRoot.git] / SHUTTLE / Shuttle.C
1 void Shuttle(const char* param = "listen") {
2
3         gSystem->Load("libSHUTTLE");
4         gSystem->Load("$ROOTSYS/lib/libThread");
5         gSystem->Load("$ALICE_ROOT/SHUTTLE/test/libTest.so");
6
7 //      AliLog::SetGlobalDebugLevel(1);
8
9         AliCDBManager *man = AliCDBManager::Instance();
10         man->SetDefaultStorage("local://MainCDB");
11 //      man->SetDefaultStorage("alien://DBFolder=ShuttleMainCDB");
12
13         AliShuttleConfig config("pcalice290.cern.ch", 389,
14                         "o=alice,dc=cern,dc=ch");
15         config.SetProcessAll(kTRUE);
16         config.Print();
17
18         AliShuttleTrigger trigger(&config);
19
20         AliShuttle* shuttle = trigger.GetShuttle();
21
22         // Add here detectors preprocessor ...
23         //TestTPCPreprocessor *tpcPrep = new TestTPCPreprocessor("TPC",shuttle);
24         //TestITSPreprocessor *itsPrep = new TestITSPreprocessor("ITS",shuttle);
25         TestRICHPreprocessor *richPrep = new TestRICHPreprocessor("RICH",shuttle);
26
27         TString paramStr(param);
28         
29         if (paramStr.IsDigit()) {
30                 Int_t run = paramStr.Atoi();
31                 trigger.Collect(run);
32         } else if (paramStr == "new") {
33                 trigger.CollectNew();
34         } else if (paramStr == "all") {
35                 trigger.CollectAll();
36         } else if (paramStr == "listen") {
37                 trigger.Run();
38         } else {
39                 cout<<"Bad parameter: "<<param<<endl;
40                 cout<<"Parameter options: "<<endl;
41                 cout<<"<run> - collect data for the given run"<<endl;
42                 cout<<"new - collect data only for the new runs"<<endl;
43                 cout<<"all - collect data for all runs"<<endl;
44                 cout<<"listen - start listening for DAQ notification"<<endl;
45                 cout<<"<empty parameter> - the same as 'listen'"<<endl;
46         }
47
48         AliCDBManager::Destroy();
49 }
50
51