]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - SHUTTLE/AliShuttle.cxx
in AliShuttleTrigger:
[u/mrichter/AliRoot.git] / SHUTTLE / AliShuttle.cxx
index 5e80876b98264740d3170f6f73152b26136d38c8..17a60660c7144422ec7800ac5b1a0112c80d3b51 100644 (file)
 
 /*
 $Log$
+Revision 1.66  2007/12/05 10:45:19  jgrosseo
+changed order of arguments to TMonaLisaWriter
+
+Revision 1.65  2007/11/26 16:58:37  acolla
+Monalisa configuration added: host and table name
+
 Revision 1.64  2007/11/13 16:15:47  acolla
 DCS map is stored in a file in the temp folder where the detector is processed.
 If the preprocessor fails, the temp folder is not removed. This will help the debugging of the problem.
@@ -1393,10 +1399,7 @@ Bool_t AliShuttle::Process(AliShuttleLogbookEntry* entry)
                                        GetCurrentRun()));
 
        // create ML instance that monitors this run
-       fMonaLisa = new TMonaLisaWriter(Form("%d", GetCurrentRun()), fConfig->GetMonitorTable(),
-                                               fConfig->GetMonitorHost());
-       // disable monitoring of other parameters that come e.g. from TFile
-       gMonitoringWriter = 0;
+       fMonaLisa = new TMonaLisaWriter(fConfig->GetMonitorHost(), fConfig->GetMonitorTable(), Form("%d", GetCurrentRun()));
 
        // Send the information to ML
        TMonaLisaText  mlStatus("SHUTTLE_status", "Processing");
@@ -1458,8 +1461,8 @@ Bool_t AliShuttle::Process(AliShuttleLogbookEntry* entry)
        TString lhcPeriod(GetLHCPeriod());
        if (lhcPeriod.Length() == 0) 
        {
-               Log("SHUTTLE","StoreRunMetaDataFile - LHCPeriod not found in logbook!");
-               return 0;
+               Log("SHUTTLE","Process - LHCPeriod not found in logbook!");
+               return 0; 
        }       
        
        if (fgkMainCDB.Length() == 0)
@@ -2764,9 +2767,13 @@ void AliShuttle::Log(const char* detector, const char* message)
        // Fill log string with a message
        //
 
-       void* dir = gSystem->OpenDirectory(GetShuttleLogDir());
+       TString logRunDir = GetShuttleLogDir();
+       if (GetCurrentRun() >=0)
+               logRunDir += Form("/%d", GetCurrentRun());
+       
+       void* dir = gSystem->OpenDirectory(logRunDir.Data());
        if (dir == NULL) {
-               if (gSystem->mkdir(GetShuttleLogDir(), kTRUE)) {
+               if (gSystem->mkdir(logRunDir.Data(), kTRUE)) {
                        AliError(Form("Can't open directory <%s>", GetShuttleLogDir()));
                        return;
                }
@@ -2813,9 +2820,12 @@ TString AliShuttle::GetLogFileName(const char* detector) const
        TString fileName;
        
        if (GetCurrentRun() >= 0) 
-               fileName.Form("%s/%s_%d.log", GetShuttleLogDir(), detector, GetCurrentRun());
-       else
+       {
+               fileName.Form("%s/%d/%s_%d.log", GetShuttleLogDir(), GetCurrentRun(), 
+                       detector, GetCurrentRun());
+       } else {
                fileName.Form("%s/%s.log", GetShuttleLogDir(), detector);
+       }
 
        return fileName;
 }
@@ -3075,12 +3085,20 @@ Bool_t AliShuttle::SendMail()
        TString body = Form("Dear %s expert(s), \n\n", fCurrentDetector.Data());
        body += Form("SHUTTLE just detected that your preprocessor "
                        "failed processing run %d!!\n\n", GetCurrentRun());
-       body += Form("Please check %s status on the SHUTTLE monitoring page: \n\n", fCurrentDetector.Data());
+       body += Form("Please check %s status on the SHUTTLE monitoring page: \n\n", 
+                               fCurrentDetector.Data());
        body += Form("\thttp://pcalimonitor.cern.ch:8889/shuttle.jsp?time=168 \n\n");
+       
+       TString logFolder = "logs";
+       if (fConfig->GetRunMode() == AliShuttleConfig::kProd) 
+               logFolder += "_PROD";
+       
+       
        body += Form("Find the %s log for the current run on \n\n"
-               "\thttp://pcalishuttle01.cern.ch:8880/logs/%s_%d.log \n\n", 
-               fCurrentDetector.Data(), fCurrentDetector.Data(), GetCurrentRun());
-       body += Form("The last 10 lines of %s log file are following:\n\n");
+               "\thttp://pcalishuttle01.cern.ch:8880/%s/%d/%s_%d.log \n\n", 
+               fCurrentDetector.Data(), logFolder.Data(), GetCurrentRun(), 
+                               fCurrentDetector.Data(), GetCurrentRun());
+       body += Form("The last 10 lines of %s log file are following:\n\n", fCurrentDetector.Data());
 
        AliDebug(2, Form("Body begin: %s", body.Data()));
 
@@ -3088,7 +3106,8 @@ Bool_t AliShuttle::SendMail()
        mailBody.close();
        mailBody.open(bodyFileName, ofstream::out | ofstream::app);
 
-       TString logFileName = Form("%s/%s_%d.log", GetShuttleLogDir(), fCurrentDetector.Data(), GetCurrentRun());
+       TString logFileName = Form("%s/%d/%s_%d.log", GetShuttleLogDir(), 
+               GetCurrentRun(), fCurrentDetector.Data(), GetCurrentRun());
        TString tailCommand = Form("tail -n 10 %s >> %s", logFileName.Data(), bodyFileName.Data());
        if (gSystem->Exec(tailCommand.Data()))
        {
@@ -3173,12 +3192,20 @@ Bool_t AliShuttle::SendMailToDCS()
        TString body = Form("Dear DCS experts, \n\n");
        body += Form("SHUTTLE couldn\'t retrieve the data points for detector %s "
                        "in run %d!!\n\n", fCurrentDetector.Data(), GetCurrentRun());
-       body += Form("Please check %s status on the SHUTTLE monitoring page: \n\n", fCurrentDetector.Data());
+       body += Form("Please check %s status on the SHUTTLE monitoring page: \n\n", 
+                               fCurrentDetector.Data());
        body += Form("\thttp://pcalimonitor.cern.ch:8889/shuttle.jsp?time=168 \n\n");
+
+       TString logFolder = "logs";
+       if (fConfig->GetRunMode() == AliShuttleConfig::kProd) 
+               logFolder += "_PROD";
+       
+       
        body += Form("Find the %s log for the current run on \n\n"
-               "\thttp://pcalishuttle01.cern.ch:8880/logs/%s_%d.log \n\n", 
-               fCurrentDetector.Data(), fCurrentDetector.Data(), GetCurrentRun());
-       body += Form("The last 10 lines of %s log file are following:\n\n");
+               "\thttp://pcalishuttle01.cern.ch:8880/%s/%d/%s_%d.log \n\n", 
+               fCurrentDetector.Data(), logFolder.Data(), GetCurrentRun(), 
+                               fCurrentDetector.Data(), GetCurrentRun());
+       body += Form("The last 10 lines of %s log file are following:\n\n", fCurrentDetector.Data());
 
        AliDebug(2, Form("Body begin: %s", body.Data()));
 
@@ -3186,7 +3213,8 @@ Bool_t AliShuttle::SendMailToDCS()
        mailBody.close();
        mailBody.open(bodyFileName, ofstream::out | ofstream::app);
 
-       TString logFileName = Form("%s/%s_%d.log", GetShuttleLogDir(), fCurrentDetector.Data(), GetCurrentRun());
+       TString logFileName = Form("%s/%d/%s_%d.log", GetShuttleLogDir(), GetCurrentRun(),
+               fCurrentDetector.Data(), GetCurrentRun());
        TString tailCommand = Form("tail -n 10 %s >> %s", logFileName.Data(), bodyFileName.Data());
        if (gSystem->Exec(tailCommand.Data()))
        {