New version (B.Yordanov)
[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
7 //      AliLog::SetGlobalDebugLevel(1);
8
9         AliShuttleConfig config("pcepalice60.cern.ch", 389,
10                         "cn=Shuttle,dc=alice,dc=cern,dc=ch", "passhuttle");
11         config.Print();
12
13         AliCDBStorage* cdbStorage = AliCDBManager::Instance()->
14                         GetStorage("local://~/temp/DCS");
15
16         AliShuttleTrigger trigger(&config, cdbStorage);
17
18         AliShuttle* shuttle = trigger.GetShuttle();
19         // Add here detectors preprocessor ...
20         //shuttle->RegisterCDBPreProcessor(new TestITSPreProcessor());
21
22         TString paramStr(param);
23         
24         if (paramStr.IsDigit()) {
25                 Int_t run = paramStr.Atoi();
26                 trigger.Collect(run);
27         } else if (paramStr == "new") {
28                 trigger.CollectNew();
29         } else if (paramStr == "all") {
30                 trigger.CollectAll();
31         } else if (paramStr == "listen") {
32                 trigger.Run();
33         } else {
34                 cout<<"Bad parameter: "<<param<<endl;
35                 cout<<"Parameter options: "<<endl;
36                 cout<<"<run> - collect data for the given run"<<endl;
37                 cout<<"new - collect data only for the new runs"<<endl;
38                 cout<<"all - collect data for all runs"<<endl;
39                 cout<<"listen - start listening for DAQ notification"<<endl;
40                 cout<<"<empty parameter> - the same as 'listen'"<<endl;
41         }
42
43         AliCDBManager::Destroy();
44 }
45
46