]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MONITOR/onlineReco.C
Adding base classes for zmq networking and modificiations to event server
[u/mrichter/AliRoot.git] / MONITOR / onlineReco.C
index 46da2166255b594bdb1631cf824fcabe57e9215b..8d29b1bf99c845f93aa5ad5bd35ac9629a0d6822 100644 (file)
@@ -10,6 +10,7 @@ UInt_t onlineReco(const char* param = "listen",const char *recMacroPath = "$ALIC
   if (paramStr.IsDigit()) {
     run = paramStr.Atoi();
   } else if (paramStr == "listen") {
+    gSystem->Load("libMONITOR");
     AliOnlineRecoTrigger trigger;
     run = trigger.Run();
   } else {
@@ -21,28 +22,29 @@ UInt_t onlineReco(const char* param = "listen",const char *recMacroPath = "$ALIC
   }
 
   if (run > 0) {
-    TString gdcList;
-    if (grp(run) > 0) {
+    TString gdc;
+    if (grp(run,gdc) > 0) {
 
       // "t" stores the token on this disk, otherwise the alien connection is not thread/process-safe
       TGrid::Connect("alien://", 0, 0, "t");
 
-      TObjArray *gdcs = gdcList.Tokenize(" ");
-      Int_t ngdcs = tokens->GetEntriesFast();
-      if (ngdcs > 0) {
+      if (!gdc.IsNull()) {
 
-       TString dataSource = ((TObjString*)gdcs->At(0))->String();
+       gSystem->Setenv("DATE_RUN_NUMBER",Form("%d",run));
+
+       TString dataSource = "*";
        dataSource.Prepend("mem://@");
-       datasource.Append(":");
+       dataSource.Append(":");
 
        // Setting CDB
        AliCDBManager * man = AliCDBManager::Instance();
-       man->SetDefaultStorage("raw://");
+       //      man->SetDefaultStorage("raw://");
+       man->SetDefaultStorage("local:///local/cdb");
        man->SetSpecificStorage("GRP/GRP/Data",
                              Form("local://%s",gSystem->pwd()));
        man->SetSpecificStorage("GRP/CTP/Config",
                              Form("local://%s",gSystem->pwd()));
-       man->Lock();
+       man->SetLock(kTRUE);
 
        gSystem->mkdir(Form("run%d",run));
        gSystem->cd(Form("run%d",run));
@@ -55,7 +57,6 @@ UInt_t onlineReco(const char* param = "listen",const char *recMacroPath = "$ALIC
       else {
        cout << "No GDCs defined in the logbook entry for run " << run << endl;
       }
-      delete gdcs;
     }
   }
 
@@ -66,11 +67,11 @@ UInt_t onlineReco(const char* param = "listen",const char *recMacroPath = "$ALIC
 
 }
 
-Int_t grp(UInt_t run, TString &gdcList) {
+Int_t grp(UInt_t run, TString &gdc) {
 
   Int_t ret=AliGRPPreprocessor::ReceivePromptRecoParameters(run, "aldaqdb", 0, "LOGBOOK", "logbook", "alice",
                                                            Form("local://%s",gSystem->pwd()),
-                                                           gdcList);
+                                                           gdc);
   if(ret>0) cout << "Last run of the same type is: " << ret << endl;
   else if(ret==0) cout << "No previous run of the same type found" << endl;
   else if(ret<0) cout << "Error code while retrieving GRP parameters returned: " << ret << endl;