Run type field added in SHUTTLE framework. Run type is read from "run type" logbook...
[u/mrichter/AliRoot.git] / SHUTTLE / Shuttle.C
CommitLineData
441b0e9c 1Bool_t Shuttle(const char* param = "listen", const char* dets=0) {
d477ad88 2
4f0ab988 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
441b0e9c 7 gSystem->Load("libRAliEn.so");
4f0ab988 8 gSystem->Load("libRLDAP.so");
e7f62f16 9 gSystem->Load("libMonaLisa");
d477ad88 10 gSystem->Load("libSHUTTLE");
441b0e9c 11 gSystem->Load("libThread");
12// gSystem->Load("$ALICE_ROOT/SHUTTLE/test/libTest.so");
2bb7b766 13
441b0e9c 14 AliLog::SetGlobalDebugLevel(2);
2bb7b766 15
441b0e9c 16// Setting local CDB and reference storage locations
17 AliShuttle::SetMainCDB("alien://user=aliprod?folder=testShuttle/OCDB");
18 AliShuttle::SetMainRefStorage("alien://user=aliprod?folder=testShuttle/Reference");
4f0ab988 19
441b0e9c 20// AliShuttle::SetMainCDB("local://$SHUTTLE_DIR/LocalShuttleCDB");
21// AliShuttle::SetMainRefStorage("local://$SHUTTLE_DIR/LocalShuttleRefStorage");
4f0ab988 22
441b0e9c 23 AliShuttle::SetLocalCDB("local://$SHUTTLE_DIR/LocalShuttleCDB");
24 AliShuttle::SetLocalRefStorage("local://$SHUTTLE_DIR/LocalShuttleRefStorage");
4f0ab988 25
441b0e9c 26// Setting Shuttle log and temp folders
27 AliShuttle::SetShuttleLogDir("$SHUTTLE_DIR/log");
28 AliShuttle::SetShuttleTempDir("$SHUTTLE_DIR/temp");
29
30
31
32 AliShuttle::SetProcessDCS(kTRUE);
4f0ab988 33
441b0e9c 34// AliShuttleConfig config("pcalice290.cern.ch", 389, "o=alice,dc=cern,dc=ch");
35 AliShuttleConfig config("pcalishuttle01.cern.ch", 389, "", "", "o=alice,dc=cern,dc=ch");
4b4eb769 36 config.SetProcessAll(kTRUE);
37 config.Print();
d477ad88 38
441b0e9c 39 AliShuttleTrigger trigger(&config, 100000);
d477ad88 40
41 AliShuttle* shuttle = trigger.GetShuttle();
4b4eb769 42
d477ad88 43 // Add here detectors preprocessor ...
d477ad88 44
441b0e9c 45 TString detector = dets;
d477ad88 46
441b0e9c 47 printf ("Processing detectors: %s \n", detector.Data());
48
49 if (detector.Contains("SPD"))
50 new AliITSPreprocessorSPD(shuttle);
51 if (detector.Contains("SDD"))
52 new AliITSPreprocessorSDD(shuttle);
53 if (detector.Contains("SSD"))
54 new AliITSPreprocessorSSD(shuttle);
55 if (detector.Contains("TPC"))
56 new AliTPCPreprocessor(shuttle);
57 if (detector.Contains("TRD"))
58 new AliTRDPreprocessor(shuttle);
59 if (detector.Contains("TOF"))
60 new AliTOFPreprocessor(shuttle);
61 if (detector.Contains("PHS"))
62 {
63 gSystem->Load("libPHOSshuttle");
64 new AliPHOSPreprocessor(shuttle);
65 }
66 if (detector.Contains("CPV"))
67 new AliCPVPreprocessor(shuttle);
68 if (detector.Contains("HMP"))
69 new AliHMPIDPreprocessor(shuttle);
70 if (detector.Contains("EMC"))
71 new AliEMCALPreprocessor(shuttle);
72 if (detector.Contains("MCH"))
73 new AliMUONPreprocessor(shuttle);
74 if (detector.Contains("MTR"))
75 new AliMTRPreprocessor(shuttle);
76 if (detector.Contains("FMD"))
77 new AliFMDPreprocessor(shuttle);
78 if (detector.Contains("ZDC"))
79 new AliZDCPreprocessor(shuttle);
80 if (detector.Contains("PMD"))
81 new AliPMDPreprocessor("PMD", shuttle);
82 if (detector.Contains("T00"))
83 {
84 gSystem->Load("libT0shuttle");
85 new AliT0Preprocessor("T00", shuttle);
d477ad88 86 }
441b0e9c 87 if (detector.Contains("V00"))
88 new AliVZEROPreprocessor(shuttle);
89 if (detector.Contains("GRP"))
90 new AliGRPPreprocessor(shuttle);
91
92// AliTOFPreprocessor *tofPrep = new AliTOFPreprocessor(shuttle);
93// AliTRDPreprocessor *trdPrep = new AliTRDPreprocessor(shuttle);
94// AliGRPPreprocessor *grpPrep = new AliGRPPreprocessor(shuttle);
95
96 TString paramStr(param);
97
98 TStopwatch stopwatch;
99 stopwatch.Start();
100
101 if (paramStr.IsDigit() || paramStr == "-1") {
102 Int_t run = paramStr.Atoi();
103 trigger.Collect(run);
104 } else if (paramStr == "new") {
105 Bool_t result = trigger.Collect();
106 } else if (paramStr == "listen") {
107 trigger.Run();
108 } else {
109 cout<<"Bad parameter: "<<param<<endl;
110 cout<<"Parameter options: "<<endl;
111 cout<<"<run> - collect data for the given run"<<endl;
112 cout<<"new - collect data only for the new runs"<<endl;
113 cout<<"listen - start listening for DAQ notification"<<endl;
114 cout<<"<empty parameter> - the same as 'listen'"<<endl;
115 }
116
117 printf("Execution time: R:%.2fs C:%.2fs \n",
118 stopwatch.RealTime(),stopwatch.CpuTime());
d477ad88 119
120 AliCDBManager::Destroy();
121}
122
123