updated test classes (alberto)
[u/mrichter/AliRoot.git] / SHUTTLE / Shuttle.C
1 void Shuttle(const char* param = "listen") {
2
3         gSystem->Load("libSHUTTLE");
4         gSystem->Load("$ROOTSYS/lib/libRLDAP");
5         gSystem->Load("$ROOTSYS/lib/libThread");
6         gSystem->Load("test/libTest.so");
7
8 //      AliLog::SetGlobalDebugLevel(1);
9
10         AliCDBManager *man = AliCDBManager::Instance();
11         man->SetDefaultStorage("local://MainCDB");
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
26         TString paramStr(param);
27         
28         if (paramStr.IsDigit()) {
29                 Int_t run = paramStr.Atoi();
30                 trigger.Collect(run);
31         } else if (paramStr == "new") {
32                 trigger.CollectNew();
33         } else if (paramStr == "all") {
34                 trigger.CollectAll();
35         } else if (paramStr == "listen") {
36                 trigger.Run();
37         } else {
38                 cout<<"Bad parameter: "<<param<<endl;
39                 cout<<"Parameter options: "<<endl;
40                 cout<<"<run> - collect data for the given run"<<endl;
41                 cout<<"new - collect data only for the new runs"<<endl;
42                 cout<<"all - collect data for all runs"<<endl;
43                 cout<<"listen - start listening for DAQ notification"<<endl;
44                 cout<<"<empty parameter> - the same as 'listen'"<<endl;
45         }
46
47         AliCDBManager::Destroy();
48 }
49
50