]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - SHUTTLE/AliShuttle.cxx
Allow fixing of local parameters for solver
[u/mrichter/AliRoot.git] / SHUTTLE / AliShuttle.cxx
index f83a4f49f1f70209e2b4f4a107834c961295bbeb..a9ead41837285ffaecc95715bcc2335a0b6e82e2 100644 (file)
@@ -1215,7 +1215,8 @@ Bool_t AliShuttle::ContinueProcessing()
                Bool_t increaseCount = kTRUE;
                if (status->GetStatus() == AliShuttleStatus::kDCSError || 
                    status->GetStatus() == AliShuttleStatus::kDCSStarted ||
-                   status->GetStatus() == AliShuttleStatus::kFXSError)
+                   status->GetStatus() == AliShuttleStatus::kFXSError ||
+                   status->GetStatus() == AliShuttleStatus::kOCDBError)
                                increaseCount = kFALSE;
                                
                UpdateShuttleStatus(AliShuttleStatus::kStarted, increaseCount);
@@ -1437,7 +1438,16 @@ Bool_t AliShuttle::Process(AliShuttleLogbookEntry* entry)
                                        AliShuttleStatus *currentStatus = ReadShuttleStatus();
                                        AliShuttleStatus::Status newStatus = AliShuttleStatus::kInvalid;
                                        
-                                       if (currentStatus->GetStatus() <= AliShuttleStatus::kPPDone)
+                                       if (currentStatus->GetStatus() == AliShuttleStatus::kDCSStarted)
+                                       {
+                                               // in case the pp goes in TimeOut while retrieving the DCS DPs
+                                               // set status to kDCSError
+                                               
+                                               logMsg.Form("Process - Process of %s timed out while retrieving the DCS DataPoints. Run time: %d seconds. Killing... and setting status to DCSError.",
+                                                               fCurrentDetector.Data(), expiredTime);
+                                               newStatus = AliShuttleStatus::kDCSError;
+                                       }
+                                       else if (currentStatus->GetStatus() <= AliShuttleStatus::kPPDone)
                                        {
                                                // in case pp not yet done set status to kPPTimeOut
                                        
@@ -1598,7 +1608,7 @@ Bool_t AliShuttle::Process(AliShuttleLogbookEntry* entry)
                        else if (success == 0)
                        {
                                Log("SHUTTLE", 
-                                       Form("\t\t\t****** run %d - %s: PP ERROR ******",
+                                       Form("\t\t\t****** run %d - %s: ERROR ******",
                                                GetCurrentRun(), aDetector->GetName()));
                        }
 
@@ -1696,6 +1706,15 @@ Int_t AliShuttle::ProcessCurrentDetector()
                return 2;
        }
        
+       // checking if OCDB is reachable
+       AliCDBEntry* testEntry = GetFromOCDB("SHUTTLE","GRP/CTP/DummyConfig");
+       if (!testEntry){
+               // OCDB is not accessible, going in OCDBError for current detector
+               AliError("OCDB Test entry not accessible");
+               UpdateShuttleStatus(AliShuttleStatus::kOCDBError);
+               return 0;
+       }
+
        TMap* dcsMap = new TMap();
        
        aPreprocessor->Initialize(GetCurrentRun(), GetCurrentStartTime(), GetCurrentEndTime());
@@ -2035,28 +2054,33 @@ AliShuttleLogbookEntry* AliShuttle::QueryRunParameters(Int_t run)
        //   a) runType is PHYSICS and ecsSuccess is set
        //   b) runType is not PHYSICS and (ecsSuccess is set or DAQ_time_start is non-0)
        // effectively this means that all runs are processed that started properly (ecsSucess behaviour is different for PHYSICS and non-PHYSICS runs (check with ECS!)
-       if (startTime != 0 && endTime != 0 && endTime > startTime) { 
-         if (endTime >= now - dcsDelay) {
-           Log("SHUTTLE", Form("Skipping run %d for now, because DCS buffer time is not yet expired", run));
-         } else {
-           if (runType == "PHYSICS") {
-             if (ecsSuccess) {
-               return entry;
-             } else {
-               Log("SHUTTLE", Form("QueryRunParameters - Run type for run %d is PHYSICS but ECS success flag not set (Reason = %s) - Skipping!", run, entry->GetRunParameter("eor_reason")));
-               skip = kTRUE;
-             } 
-           } else {
-             if (ecsSuccess || daqstartTime > 0) {
-               if (ecsSuccess == kFALSE)
-                 Log("SHUTTLE", Form("Processing run %d although in status ECS failure (Reason: %s), since run type != PHYSICS and DAQ_time_start != 0", run, entry->GetRunParameter("eor_reason")));
-               return entry;
-             } else {
-               Log("SHUTTLE", Form("QueryRunParameters - Run type for run %d is %s, ECS success flag was not set (Reason = %s) and DAQ_time_start was NULL - Skipping!", run, runType.Data(), entry->GetRunParameter("eor_reason")));
-               skip = kTRUE;
-             }
-           }
-         }
+       if (startTime != 0 && endTime != 0) {
+               if (endTime > startTime) { 
+                       if (endTime >= now - dcsDelay) {
+                               Log("SHUTTLE", Form("Skipping run %d for now, because DCS buffer time is not yet expired", run));
+                       } else {
+                               if (runType == "PHYSICS") {
+                                       if (ecsSuccess) {
+                                               return entry;
+                                       } else {
+                                               Log("SHUTTLE", Form("QueryRunParameters - Run type for run %d is PHYSICS but ECS success flag not set (Reason = %s) - Skipping!", run, entry->GetRunParameter("eor_reason")));
+                                               skip = kTRUE;
+                                       } 
+                               } else {
+                                       if (ecsSuccess || daqstartTime > 0) {
+                                               if (ecsSuccess == kFALSE)
+                                                       Log("SHUTTLE", Form("Processing run %d although in status ECS failure (Reason: %s), since run type != PHYSICS and DAQ_time_start != 0", run, entry->GetRunParameter("eor_reason")));
+                                               return entry;
+                                       } else {
+                                               Log("SHUTTLE", Form("QueryRunParameters - Run type for run %d is %s, ECS success flag was not set (Reason = %s) and DAQ_time_start was NULL - Skipping!", run, runType.Data(), entry->GetRunParameter("eor_reason")));
+                                               skip = kTRUE;
+                                       }
+                               }
+                       }
+               } else {
+                       Log("SHUTTLE", Form("QueryRunParameters - Invalid parameters for run %d: startTime equal to endTime: %d %d - Skipping!", run, startTime, endTime));
+                       skip = kTRUE;
+               }
        } else {
          Log("SHUTTLE", Form("QueryRunParameters - Invalid parameters for Run %d: "
                              "startTime = %d, endTime = %d. Skipping (Shuttle won't be marked as DONE)!",
@@ -2914,7 +2938,7 @@ const char* AliShuttle::GetLHCPeriod() const
 }
 
 //______________________________________________________________________________________________
-void AliShuttle::Log(const char* detector, const char* message)
+void AliShuttle::Log(const char* detector, const char* message, UInt_t level)
 {
        //
        // Fill log string with a message
@@ -2941,7 +2965,7 @@ void AliShuttle::Log(const char* detector, const char* message)
                toLog += Form("run %d - ", GetCurrentRun());
        toLog += Form("%s", message);
 
-       AliInfo(toLog.Data());
+       AliLog::Message(level, toLog, MODULENAME(), ClassName(), FUNCTIONNAME(), __FILE__, __LINE__);
        
        // if we redirect the log output already to the file, leave here
        if (fOutputRedirected && strcmp(detector, "SHUTTLE") != 0)