]> git.uio.no Git - u/mrichter/AliRoot.git/blob - SHUTTLE/Shuttle.C
last run is stored after each run
[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 if (paramStr.BeginsWith("lastrun=")) {
39     Int_t run = TString(paramStr(8, paramStr.Length()-7).Data()).Atoi();
40     cout << run << endl;
41     trigger.SetNewLastRun(run);
42         } else {
43                 cout<<"Bad parameter: "<<param<<endl;
44                 cout<<"Parameter options: "<<endl;
45                 cout<<"<run> - collect data for the given run"<<endl;
46                 cout<<"new - collect data only for the new runs"<<endl;
47                 cout<<"all - collect data for all runs"<<endl;
48                 cout<<"listen - start listening for DAQ notification"<<endl;
49     cout<<"lastrun=<run> - sets last run manually. use with caution!" << endl
50                 cout<<"<empty parameter> - the same as 'listen'"<<endl;
51         }
52
53         AliCDBManager::Destroy();
54 }
55
56