X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=blobdiff_plain;f=SHUTTLE%2FShuttle.C;h=d9285d75747d73faa610d04fcd86e4119de3eca3;hp=d449cf2abd3281a5c039553081e527bd9037bb2c;hb=83f5f7585270f77ef9c5ce3d83de77699e624f76;hpb=4f0ab9885f257d215b743887f62be6fe5eea547e diff --git a/SHUTTLE/Shuttle.C b/SHUTTLE/Shuttle.C index d449cf2abd3..d9285d75747 100644 --- a/SHUTTLE/Shuttle.C +++ b/SHUTTLE/Shuttle.C @@ -1,68 +1,131 @@ -void Shuttle(const char* param = "listen") { +Bool_t Shuttle(const char* param = "listen", const char* dets=0) { // WARNING: if ldap is built with ssl support it may cause confilcts with the // AliEn interface. If this happens, grid storage activation must be done BEFORE // loading LDAP libraries!!! + gSystem->Load("libRAliEn.so"); gSystem->Load("libRLDAP.so"); + gSystem->Load("libMonaLisa"); gSystem->Load("libSHUTTLE"); - gSystem->Load("$ROOTSYS/lib/libThread"); - gSystem->Load("$ALICE_ROOT/SHUTTLE/test/libTest.so"); + gSystem->Load("libThread"); +// gSystem->Load("$ALICE_ROOT/SHUTTLE/test/libTest.so"); -// AliLog::SetGlobalDebugLevel(1); - - // Setting local CDB and reference storage locations - AliShuttle::SetMainCDB("alien://DBFolder=ShuttleCDB"); - AliShuttle::SetLocalCDB("local://LocalShuttleCDB"); - AliShuttle::SetMainRefStorage("alien://DBFolder=GridReferenceStorage"); - AliShuttle::SetLocalRefStorage("local://LocalReferenceStorage"); + AliLog::SetGlobalDebugLevel(2); + + const char* pwd = gSystem->pwd(); + + if( !gSystem->Getenv("SHUTTLE_DIR")) + { + printf("Setting base SHUTTLE folder to %s\n", pwd); + gSystem->Setenv("SHUTTLE_DIR", pwd); + } else { + printf("Shuttle base folder is %s\n", gSystem->Getenv("SHUTTLE_DIR")); + } - AliShuttle::SetProcessDCS(kTRUE); +// Setting local CDB and reference storage locations + AliShuttle::SetMainCDB("alien://user=aliprod?folder=testShuttle/OCDB"); + AliShuttle::SetMainRefStorage("alien://user=aliprod?folder=testShuttle/Reference"); +// AliShuttle::SetMainCDB("local://$SHUTTLE_DIR/LocalShuttleCDB"); +// AliShuttle::SetMainRefStorage("local://$SHUTTLE_DIR/LocalShuttleRefStorage"); -// AliCDBManager *man = AliCDBManager::Instance(); -// man->SetDefaultStorage("local://MainCDB"); -// man->SetDefaultStorage("alien://DBFolder=ShuttleMainCDB"); + AliShuttle::SetLocalCDB("local://$SHUTTLE_DIR/LocalShuttleCDB"); + AliShuttle::SetLocalRefStorage("local://$SHUTTLE_DIR/LocalShuttleRefStorage"); +// Setting Shuttle log and temp folders + AliShuttle::SetShuttleLogDir("$SHUTTLE_DIR/log"); + AliShuttle::SetShuttleTempDir("$SHUTTLE_DIR/temp"); + + + + AliShuttle::SetProcessDCS(kTRUE); - AliShuttleConfig config("pcalice290.cern.ch", 389, "o=alice,dc=cern,dc=ch"); +// AliShuttleConfig config("pcalice290.cern.ch", 389, "o=alice,dc=cern,dc=ch"); + AliShuttleConfig config("pcalishuttle01.cern.ch", 389, "", "", "o=alice,dc=cern,dc=ch"); config.SetProcessAll(kTRUE); config.Print(); - AliShuttleTrigger trigger(&config); + AliShuttleTrigger trigger(&config, 100000); AliShuttle* shuttle = trigger.GetShuttle(); // Add here detectors preprocessor ... - TestTPCPreprocessor *tpcPrep = new TestTPCPreprocessor("TPC",shuttle); - TestITSPreprocessor *itsPrep = new TestITSPreprocessor("ITS",shuttle); - TestRICHPreprocessor *richPrep = new TestRICHPreprocessor("RICH",shuttle); - TString paramStr(param); + TString detector = dets; - if (paramStr.IsDigit()) { - Int_t run = paramStr.Atoi(); - trigger.Collect(run); - } else if (paramStr == "new") { - trigger.CollectNew(); - } else if (paramStr == "all") { - trigger.CollectAll(); - } else if (paramStr == "listen") { - trigger.Run(); - } else if (paramStr.BeginsWith("lastrun=")) { - Int_t run = TString(paramStr(8, paramStr.Length()-7).Data()).Atoi(); - cout << run << endl; - trigger.SetNewLastRun(run); - } else { - cout<<"Bad parameter: "< - collect data for the given run"< - sets last run manually. use with caution!" << endl; - cout<<" - the same as 'listen'"<Load("libPHOSshuttle"); + new AliPHOSPreprocessor(shuttle); } + if (detector.Contains("CPV")) + new AliCPVPreprocessor(shuttle); + if (detector.Contains("HMP")) + new AliHMPIDPreprocessor(shuttle); + if (detector.Contains("EMC")) + new AliEMCALPreprocessor(shuttle); + if (detector.Contains("MCH")) + new AliMUONPreprocessor(shuttle); + if (detector.Contains("MTR")) + new AliMTRPreprocessor(shuttle); + if (detector.Contains("FMD")) + new AliFMDPreprocessor(shuttle); + if (detector.Contains("ZDC")) + new AliZDCPreprocessor(shuttle); + if (detector.Contains("PMD")) + new AliPMDPreprocessor("PMD", shuttle); + if (detector.Contains("T00")) + { + gSystem->Load("libT0shuttle"); + new AliT0Preprocessor("T00", shuttle); + } + if (detector.Contains("V00")) + new AliVZEROPreprocessor(shuttle); + if (detector.Contains("GRP")) + new AliGRPPreprocessor(shuttle); + +// AliTOFPreprocessor *tofPrep = new AliTOFPreprocessor(shuttle); +// AliTRDPreprocessor *trdPrep = new AliTRDPreprocessor(shuttle); +// AliGRPPreprocessor *grpPrep = new AliGRPPreprocessor(shuttle); + + TString paramStr(param); + + TStopwatch stopwatch; + stopwatch.Start(); + + if (paramStr.IsDigit() || paramStr == "-1") { + Int_t run = paramStr.Atoi(); + trigger.Collect(run); + } else if (paramStr == "new") { + Bool_t result = trigger.Collect(); + } else if (paramStr == "listen") { + trigger.Run(); + } else { + cout<<"Bad parameter: "< - collect data for the given run"< - the same as 'listen'"<