//
TString offDetStr(GetOfflineDetName(detector));
- TString dir;
+ static TString dir;
if (offDetStr == "ITS" || offDetStr == "MUON" || offDetStr == "PHOS")
{
dir.Form("%s/%s/%s", base, offDetStr.Data(), detector);
}
return dir.Data();
-
-
}
//______________________________________________________________________________________________
}
// TODO Check field count!
- const UInt_t nCols = 25;
+ const UInt_t nCols = 26;
if (aResult->GetFieldCount() != (Int_t) nCols) {
Log("SHUTTLE", "Invalid SQL result field number!");
delete aResult;
if (detName == "ALL") whereClause = Form("where run=%d and time_processed IS NULL;",GetCurrentRun());
else whereClause = Form("where run=%d and detector=\"%s\" and time_processed IS NULL;",GetCurrentRun(), detector);
- Log("SHUTTLE",Form(" whereClause = %s ",whereClause.Data()));
+ //Log("SHUTTLE",Form(" whereClause = %s ",whereClause.Data()));
TString sqlQuery = Form("update %s set time_processed=%d %s", fConfig->GetFXSdbTable(system),
now.GetSec(), whereClause.Data());
body = Form("Dear %s FXS experts, \n\n",sys.Data());
body += Form("SHUTTLE couldn\'t retrieve data from the FXS for detector %s "
"in run %d!!\n\n", fCurrentDetector.Data(), GetCurrentRun());
+ body += Form("The contacted server was:\nDB: %s\nFXS:%s\n\n", fConfig->GetFXSdbHost(system), fConfig->GetFXSHost(system));
}
else {
subject = Form("%s %s Shuttle preprocessor FAILED in run %d (run type = %s)!",
if (result->GetRowCount() == 0)
{
- Log("SHUTTLE", "ERROR: Trigger configuration not found in logbook_trigger_config");
+ Log("SHUTTLE", "WARNING: Trigger configuration not found in logbook_trigger_config");
delete result;
return 0;
}
return triggerConfig;
}
+//______________________________________________________________________________________________
+const char* AliShuttle::GetCTPTimeParams()
+{
+ // Receives the CTP time parameters from the DAQ logbook for the current run
+
+ // check connection, if needed reconnect
+ if (!Connect(3))
+ return 0;
+
+ TString sqlQuery;
+ sqlQuery.Form("SELECT alignmentFile FROM logbook_trigger_config WHERE run = %d", GetCurrentRun());
+ TSQLResult* result = fServer[3]->Query(sqlQuery);
+ if (!result)
+ {
+ Log("SHUTTLE", Form("ERROR: Can't execute query <%s>!", sqlQuery.Data()));
+ return 0;
+ }
+
+ if (result->GetRowCount() == 0)
+ {
+ Log("SHUTTLE", "WARNING: CTP time params not found in logbook_trigger_config");
+ delete result;
+ return 0;
+ }
+
+ TSQLRow* row = result->Next();
+ if (!row)
+ {
+ Log("SHUTTLE", "ERROR: Could not receive logbook_trigger_config data");
+ delete result;
+ return 0;
+ }
+
+ // static, so that pointer remains valid when it is returned to the calling class
+ static TString triggerTimeParams(row->GetField(0));
+
+ delete row;
+ row = 0;
+
+ delete result;
+ result = 0;
+
+ Log("SHUTTLE", Form("Found trigger time parameters: %s", triggerTimeParams.Data()));
+
+ return triggerTimeParams;
+}
+
+//______________________________________________________________________________________________
+const char* AliShuttle::GetTriggerDetectorMask()
+{
+ // Receives the trigger detector mask from DAQ logbook
+
+ // check connection, if needed reconnect
+ if (!Connect(3))
+ return 0;
+
+ TString sqlQuery;
+ sqlQuery.Form("SELECT BIN(BIT_OR(inputDetectorMask)) from logbook_trigger_clusters WHERE run = %d;", GetCurrentRun());
+ TSQLResult* result = fServer[3]->Query(sqlQuery);
+ if (!result)
+ {
+ Log("SHUTTLE", Form("ERROR: Can't execute query <%s>!", sqlQuery.Data()));
+ return 0;
+ }
+
+ if (result->GetRowCount() == 0)
+ {
+ Log("SHUTTLE", "ERROR: Trigger Detector Mask not found in logbook_trigger_clusters");
+ delete result;
+ return 0;
+ }
+
+ TSQLRow* row = result->Next();
+ if (!row)
+ {
+ Log("SHUTTLE", "ERROR: Could not receive logbook_trigger_clusters data");
+ delete result;
+ return 0;
+ }
+
+ // static, so that pointer remains valid when it is returned to the calling class
+ static TString triggerDetectorMask(row->GetField(0));
+
+ delete row;
+ row = 0;
+
+ delete result;
+ result = 0;
+
+ Log("SHUTTLE", Form("Found Trigger Detector Mask: %s", triggerDetectorMask.Data()));
+
+ return triggerDetectorMask;
+}
+
//______________________________________________________________________________________________
void AliShuttle::SetShuttleTempDir(const char* tmpDir)
{