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