Implementing the necessary changes in the SHUTTLE Framework (to be tested in the nightly tests), and a
"trivial" example in the GRP pp reading the "TriggerClassesAndHistosToClone" entry to test the
new FXS (the processing is always successful for testing purposes).
//
if (!fConfig->IsValid()) AliFatal("********** !!!!! Invalid configuration !!!!! **********");
- for(int iSys=0;iSys<4;iSys++) {
+ for(int iSys=0;iSys<5;iSys++) {
fServer[iSys]=0;
- if (iSys < 3)
+ if (iSys < 4)
fFXSlist[iSys].SetOwner(kTRUE);
}
fPreprocessorMap.SetOwner(kTRUE);
//
fPreprocessorMap.DeleteAll();
- for(int iSys=0;iSys<4;iSys++)
+ for(int iSys=0;iSys<5;iSys++)
if(fServer[iSys]) {
fServer[iSys]->Close();
delete fServer[iSys];
if (!dirList) return kTRUE;
- if (dirList->GetEntries() < 3)
+ if (dirList->GetEntries() < 3) // to be changed to 4?
{
delete dirList;
return kTRUE;
SendAlive();
// check connection, in case connect
- if (!Connect(3))
+ if (!Connect(4))
return;
TString sqlQuery;
sqlQuery = Form("select count(*) from %s where shuttle_done=0", fConfig->GetShuttlelbTable());
- TSQLResult* aResult = fServer[3]->Query(sqlQuery);
+ TSQLResult* aResult = fServer[4]->Query(sqlQuery);
if (!aResult) {
AliError(Form("Can't execute query <%s>!", sqlQuery.Data()));
return;
entries.SetOwner(1);
// check connection, in case connect
- if (!Connect(3)) return kFALSE;
+ if (!Connect(4)) return kFALSE;
TString sqlQuery;
sqlQuery = Form("select * from %s %s order by run", fConfig->GetShuttlelbTable(), whereClause);
- TSQLResult* aResult = fServer[3]->Query(sqlQuery);
+ TSQLResult* aResult = fServer[4]->Query(sqlQuery);
if (!aResult) {
AliError(Form("Can't execute query <%s>!", sqlQuery.Data()));
return kFALSE;
//
// check connection, in case connect
- if (!Connect(3))
+ if (!Connect(4))
return 0;
TString sqlQuery;
sqlQuery.Form("select * from %s where run=%d", fConfig->GetDAQlbTable(), run);
- TSQLResult* aResult = fServer[3]->Query(sqlQuery);
+ TSQLResult* aResult = fServer[4]->Query(sqlQuery);
if (!aResult) {
Log("SHUTTLE", Form("Can't execute query <%s>!", sqlQuery.Data()));
return 0;
TString whereClause = Form("run=%d and detector=\"%s\" and fileId=\"%s\"",
GetCurrentRun(), detector, id);
- if (system == kDAQ)
+ if (system == kDAQ || system == kDQM)
{
whereClause += Form(" and DAQsource=\"%s\"", source);
}
}
TString sourceName = "";
- if (system == kDAQ)
+ if (system == kDAQ || system == kDQM)
{
sourceName = "DAQsource";
} else if (system == kHLT)
TString dbHost, dbUser, dbPass, dbName;
- if (system < 3) // FXS db servers
+ if (system < 4) // FXS db servers
{
dbHost = Form("mysql://%s:%d", fConfig->GetFXSdbHost(system), fConfig->GetFXSdbPort(system));
dbUser = fConfig->GetFXSdbUser(system);
}
fServer[system] = TSQLServer::Connect(dbHost.Data(), dbUser.Data(), dbPass.Data());
- if (!fServer[system] || !fServer[system]->IsConnected()) {
- if(system < 3)
+ if (!fServer[system] || !fServer[system]->IsConnected()) {
+ if(system < 4)
{
AliError(Form("Can't establish connection to FXS database for %s",
AliShuttleInterface::GetSystemName(system)));
case kHLT:
aResult = fServer[kHLT]->GetTables(dbName.Data());
break;
+ case kDQM:
+ aResult = fServer[kDQM]->GetTables(dbName.Data());
+ break;
default:
- aResult = fServer[3]->GetTables(dbName.Data());
+ aResult = fServer[4]->GetTables(dbName.Data());
break;
}
const char* source = ((TObjString*) aFXSarray->At(1))->GetName();
TString whereClause;
- if (system == kDAQ)
+ if (system == kDAQ || system == kDQM)
{
whereClause = Form("where run=%d and detector=\"%s\" and fileId=\"%s\" and DAQsource=\"%s\";",
GetCurrentRun(), fCurrentDetector.Data(), fileId, source);
//
// check connection, in case connect
- if(!Connect(3)){
+ if(!Connect(4)){
Log("SHUTTLE", "UpdateShuttleLogbook - Couldn't connect to DAQ Logbook.");
return kFALSE;
}
// Query execution
TSQLResult* aResult;
- aResult = dynamic_cast<TSQLResult*> (fServer[3]->Query(sqlQuery));
+ aResult = dynamic_cast<TSQLResult*> (fServer[4]->Query(sqlQuery));
if (!aResult) {
Log("SHUTTLE", Form("UpdateShuttleLogbook - Can't execute query <%s>", sqlQuery.Data()));
return kFALSE;
// Receives the trigger configuration from the DAQ logbook for the current run
// check connection, if needed reconnect
- if (!Connect(3))
+ if (!Connect(4))
return 0;
TString sqlQuery;
sqlQuery.Form("SELECT configFile FROM logbook_trigger_config WHERE run = %d", GetCurrentRun());
- TSQLResult* result = fServer[3]->Query(sqlQuery);
+ TSQLResult* result = fServer[4]->Query(sqlQuery);
if (!result)
{
Log("SHUTTLE", Form("ERROR: Can't execute query <%s>!", sqlQuery.Data()));
// Receives the CTP time parameters from the DAQ logbook for the current run
// check connection, if needed reconnect
- if (!Connect(3))
+ if (!Connect(4))
return 0;
TString sqlQuery;
sqlQuery.Form("SELECT alignmentFile FROM logbook_trigger_config WHERE run = %d", GetCurrentRun());
- TSQLResult* result = fServer[3]->Query(sqlQuery);
+ TSQLResult* result = fServer[4]->Query(sqlQuery);
if (!result)
{
Log("SHUTTLE", Form("ERROR: Can't execute query <%s>!", sqlQuery.Data()));
// Receives the trigger detector mask from DAQ logbook
// check connection, if needed reconnect
- if (!Connect(3))
+ if (!Connect(4))
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);
+ TSQLResult* result = fServer[4]->Query(sqlQuery);
if (!result)
{
Log("SHUTTLE", Form("ERROR: Can't execute query <%s>!", sqlQuery.Data()));
// Getting ltuFineDelay1, ltuFineDelay2, ltuBCDelay for detector det from logbook_detectors table in logbook
//
- if (!Connect(3))
+ if (!Connect(4))
return 0;
TString sqlQuery;
sqlQuery.Form("select LTUFineDelay1, LTUFineDelay2, LTUBCDelayAdd from logbook_detectors WHERE run_number = %d and detector = \"%s\";", GetCurrentRun(),det);
- TSQLResult* result = fServer[3]->Query(sqlQuery);
+ TSQLResult* result = fServer[4]->Query(sqlQuery);
if (!result){
Log("SHUTTLE","ERROR: No result found for the LTU configuration query");
return 0x0;
TString fCurrentDetector; // current detector
Bool_t fFirstProcessing; // processing this detector the first time in this run
- TSQLServer *fServer[4]; // pointer to the three FXS + Run & Shuttle logbook servers
- Bool_t fFXSCalled[3]; // FXS call status
- TList fFXSlist[3]; // List of files retrieved from each FXS
+ TSQLServer *fServer[5]; // pointer to the four FXS + Run & Shuttle logbook servers
+ Bool_t fFXSCalled[4]; // FXS call status
+ TList fFXSlist[4]; // List of files retrieved from each FXS
Int_t fFXSError; // Variable to keep track of any FXS errors; contains -1 for no error, kDAQ, kDCS, kHLT otherwise
AliCDBEntry* fStatusEntry; // last CDB entry containing a AliShuttleStatus retrieved
fDetectorList.SetOwner(0); //fDetectorList and fDetectorMap share the same object!
fProcessedDetectors.SetOwner();
- for (int i=0; i<5; i++)
+ for (int i=0; i<6; i++)
{
fAdmin[i] = new TObjArray();
fAdmin[i]->SetOwner();
{
//
// returns collection of TObjString which represents the list of mail addresses
- // of the system's administrator(s) (DAQ, DCS, HLT, Global, Amanda)
+ // of the system's administrator(s) (DAQ, DCS, HLT, Global, Amanda, DQM)
//
- if (sys < 0 || sys > 4) return 0;
+ if (sys < 0 || sys > 5) return 0;
return fAdmin[sys];
}
//______________________________________________________________________________________________
UInt_t AliShuttleConfig::SetSysConfig(TList* list)
{
- // Set the online FXS configuration (DAQ + DCS + HLT)
+ // Set the online FXS configuration (DAQ + DCS + HLT + DQM)
TLDAPEntry* anEntry = 0;
TLDAPAttribute* anAttribute = 0;
- if (list->GetEntries() != 3)
+ if (list->GetEntries() != 4)
{
AliError(Form("Wrong number of online systems found: %d !", list->GetEntries()));
return 1;
iSys = kHLT;
count += 100;
}
+ else if (sysName == "DQM")
+ {
+ iSys = kDQM;
+ count += 1000;
+ }
anAttribute = anEntry->GetAttribute("dbHost");
if (!anAttribute) {
}
- if(count != 111) {
+ if(count != 1111) {
AliError(Form("Wrong system configuration! (code = %d)", count));
return 6;
}
AliInfo("Setting Passwords");
- // Retrieving Passwords for DAQ lb, DAQ/DCS/HLT FXS
+ // Retrieving Passwords for DAQ lb, DAQ/DCS/HLT/DQM FXS
ifstream *inputfile = new ifstream(fPasswdFilePath.Data());
if (!*inputfile) {
nPwd++;
AliDebug(3,Form("HLT_DB: Password %s for %s found", password.Data(), system.Data()));
}
+ else if (system.Contains("DQM_DB")){
+ fFXSdbPass[3]=password;
+ nPwd++;
+ AliDebug(3,Form("DQM_DB: Password %s for %s found", password.Data(), system.Data()));
+ }
else {
nPwdFake++;
AliDebug(3,Form("%i fake line(s) found in file %s", nPwdFake, fPasswdFilePath.Data()));
inputfile->close();
delete inputfile;
- if (nPwd!=4){
+ if (nPwd!=5){
AliError(Form("Wrong file for DAQ Logbook password found %s (some passwors missing), please Check!", fPasswdFilePath.Data()));
return 2;
}
result += "------------------------------------------------------\n";
result += "FXS configuration\n\n";
- for(int iSys=0;iSys<3;iSys++){
+ for(int iSys=0;iSys<4;iSys++){
result += Form("*** %s ***\n", AliShuttleInterface::GetSystemName(iSys));
result += Form("\tDB host: %s:%d; \tUser: %s; \tName: %s; \tTable: %s\n",
fFXSdbHost[iSys].Data(), fFXSdbPort[iSys], fFXSdbUser[iSys].Data(),
class AliShuttleConfig: public TObject {
public:
enum RunMode {kTest=0, kProd};
- enum SystemCode { kDAQ = 0, kDCS, kHLT, kGlobal, kAmanda };
+ enum SystemCode { kDAQ = 0, kDCS, kHLT, kDQM, kGlobal, kAmanda};
AliShuttleConfig(const char* host, Int_t port = LDAP_PORT,
const char* binddn = 0, const char* password = 0,
TString fRunTypelbTable; // Table name of the Run typr logbook
TString fPasswdFilePath; // Path for the local file where the passwords are stored
- TString fFXSHost[3]; // Host of the [DAQ, DCS, HLT] File eXchange Server
- UInt_t fFXSPort[3]; // Port of the [DAQ, DCS, HLT] File eXchange Server
- TString fFXSUser[3]; // username of the [DAQ, DCS, HLT] File eXchange Server
- TString fFXSPass[3]; // password of the [DAQ, DCS, HLT] File eXchange Server
- TString fFXSBaseFolder[3]; // base folder of the [DAQ, DCS, HLT] File eXchange Server
+ TString fFXSHost[4]; // Host of the [DAQ, DCS, HLT, DQM] File eXchange Server
+ UInt_t fFXSPort[4]; // Port of the [DAQ, DCS, HLT, DQM] File eXchange Server
+ TString fFXSUser[4]; // username of the [DAQ, DCS, HLT, DQM] File eXchange Server
+ TString fFXSPass[4]; // password of the [DAQ, DCS, HLT, DQM] File eXchange Server
+ TString fFXSBaseFolder[4]; // base folder of the [DAQ, DCS, HLT, DQM] File eXchange Server
- TString fFXSdbHost[3]; // Host of the [DAQ, DCS, HLT] FXS database
- UInt_t fFXSdbPort[3]; // Port of the [DAQ, DCS, HLT] FXS database
- TString fFXSdbUser[3]; // username of the [DAQ, DCS, HLT] FXS database
- TString fFXSdbPass[3]; // password of the [DAQ, DCS, HLT] FXS database
- TString fFXSdbName[3]; // name of the [DAQ, DCS, HLT] FXS database
- TString fFXSdbTable[3]; // Table name of the [DAQ, DCS, HLT] FXS database
+ TString fFXSdbHost[4]; // Host of the [DAQ, DCS, HLT, DQM] FXS database
+ UInt_t fFXSdbPort[4]; // Port of the [DAQ, DCS, HLT, DQM] FXS database
+ TString fFXSdbUser[4]; // username of the [DAQ, DCS, HLT, DQM] FXS database
+ TString fFXSdbPass[4]; // password of the [DAQ, DCS, HLT, DQM] FXS database
+ TString fFXSdbName[4]; // name of the [DAQ, DCS, HLT, DQM] FXS database
+ TString fFXSdbTable[4]; // Table name of the [DAQ, DCS, HLT, DQM] FXS database
TString fTerminateFilePath; // File for inter-process communcation to terminate the Shuttle
TMap fDetectorMap; // Map of the detector-by-detector configuration
TObjArray fDetectorList; // List of detectors with valid configuration
- TObjArray *fAdmin[5]; // Array of system administrators' email addresses (DAQ, DCS, HLT, Global, Amanda)
+ TObjArray *fAdmin[6]; // Array of system administrators' email addresses (DAQ, DCS, HLT, DQM, Global, Amanda)
TString fShuttleInstanceHost; // Instance of the SHUTTLE
TObjArray fProcessedDetectors; // list of the detector to be processed by this machine
//______________________________________________________________________________________________
const char* AliTestShuttle::GetFile(Int_t system, const char* detector, const char* id, const char* source)
{
- // This function retrieves a file from the given system (kDAQ, kDCS, kHLT) with the given file id
+ // This function retrieves a file from the given system (kDAQ, kDCS, kHLT, kDQM) with the given file id
// and from the given source in the system.
// The function returnes the path to the local file.
//
--- /dev/null
+version: 1
+
+# LDIF Export for: system=DQM,o=shuttle,dc=cern,dc=ch
+# Generated by phpLDAPadmin ( http://phpldapadmin.sourceforge.net/ ) on September 26, 2011 5:59 pm
+# Server: SHUTTLE (pcalishuttle02.cern.ch)
+# Search Scope: sub
+# Search Filter: (objectClass=*)
+# Total Entries: 1
+
+dn: system=DQM,o=shuttle,dc=cern,dc=ch
+dbHost: alice-logbook-copy.cern.ch
+dbName: TEST_FXS_DQM
+dbTable: daqFES_files
+dbUser: shuttle_test_rw
+fxsBaseFolder: /home/shuttle_test_rw/TEST_FXS_DQM
+fxsHost: alice-logbook-copy.cern.ch
+fxsUser: shuttle_test_rw
+system: DQM
+dbPort: 3306
+fxsAdmin: bartolomeu.rodrigues.fernandes.rabacal@cern.ch
+fxsPort: 22
+objectClass: fxsConfig
+objectClass: top
--- /dev/null
+version: 1
+
+# LDIF Export for: system=DQM,o=shuttle_prod,dc=cern,dc=ch
+# Generated by phpLDAPadmin ( http://phpldapadmin.sourceforge.net/ ) on September 26, 2011 6:00 pm
+# Server: SHUTTLE (pcalishuttle02.cern.ch)
+# Search Scope: sub
+# Search Filter: (objectClass=*)
+# Total Entries: 1
+
+dn: system=DQM,o=shuttle_prod,dc=cern,dc=ch
+dbHost: aldaqgw01-gpn.cern.ch
+dbName: FES
+dbTable: daqFES_files
+dbUser: shuttle
+fxsBaseFolder: /home/shuttle/FES
+fxsHost: aldaqgw01-gpn.cern.ch
+fxsUser: shuttle
+system: DQM
+dbPort: 1447
+fxsAdmin: bartolomeu.rodrigues.fernandes.rabacal@cern.ch
+fxsPort: 1448
+objectClass: fxsConfig
+objectClass: top
{
public:
- enum { kDAQ = 0, kDCS, kHLT };
+ enum { kDAQ = 0, kDCS, kHLT, kDQM };
AliPreprocessor(const char* detector, AliShuttleInterface* shuttle);
virtual ~AliPreprocessor();
ClassImp(AliShuttleInterface)
-const char* AliShuttleInterface::fkSystemNames[3] = { "DAQ", "DCS", "HLT" };
+ const char* AliShuttleInterface::fkSystemNames[4] = { "DAQ", "DCS", "HLT", "DQM" };
// names of the detectors preprocessors
const char* AliShuttleInterface::fgkDetName[kNDetectors] = {"SPD", "SDD", "SSD", "TPC", "TRD", "TOF",
class AliShuttleInterface : public TObject
{
public:
- enum System { kDAQ = 0, kDCS, kHLT };
+ enum System { kDAQ = 0, kDCS, kHLT, kDQM };
enum { kNDetectors = 21 }; // number of subdetectors in ALICE
virtual Bool_t Store(const AliCDBPath& path, TObject* object, AliCDBMetaData* metaData,
virtual void RegisterPreprocessor(AliPreprocessor* preprocessor) = 0;
- static const char* GetSystemName(UInt_t system) {return (system < 3) ? fkSystemNames[system] : 0;}
+ static const char* GetSystemName(UInt_t system) {return (system < 4) ? fkSystemNames[system] : 0;}
static const char* GetOfflineDetName(const char* detName);
static const char* GetDetName(UInt_t detPos);
protected:
- static const char* fkSystemNames[3]; // names of the systems providing data to the shuttle
+ static const char* fkSystemNames[4]; // names of the systems providing data to the shuttle
static const char* fgkDetName[kNDetectors]; // names of detectors' preprocessors (3-letter code convention)
static const char* fgkOfflineDetName[kNDetectors]; // names of detectors in OCDB (AliRoot naming convention)
"(DCS FXS Error for LHC Data)",
"(LHC Data Error)",
"(LHC Clock Phase Error (from LHC Data))",
- "(LTU Configuration Error)"
+ "(LTU Configuration Error)",
+ "(DQM Failure)"
};
//_______________________________________________________________
Log("SPD Mean Vertex not processed since runType != PHYSICS");
}
+ //=================//
+ // DQM FXS //
+ //=================//
+
+ Log("*************** Processing DQM FXS");
+
+ UInt_t iDqmFxs = ProcessDqmFxs();
+ if( iDqmFxs == 1 ) {
+ Log(Form("DQM FXS, successful!"));
+ } else {
+ Log(Form("DQM FXS failed!!!"));
+ error |= 4096;
+ }
+
// storing AliGRPObject in OCDB
AliCDBMetaData md;
Log("GRP Preprocessor Success");
return 0;
} else {
- Log( Form("GRP Preprocessor FAILS!!! %s%s%s%s%s%s%s%s%s%s%s%s",
+ Log( Form("GRP Preprocessor FAILS!!! %s%s%s%s%s%s%s%s%s%s%s%s%s",
kppError[(error&1)?1:0],
kppError[(error&2)?2:0],
kppError[(error&4)?3:0],
kppError[(error&256)?9:0],
kppError[(error&512)?10:0],
kppError[(error&1024)?11:0],
- kppError[(error&2048)?12:0]
+ kppError[(error&2048)?12:0],
+ kppError[(error&4096)?12:0]
));
return error;
}
return storeResult;
}
+//_______________________________________________________________
+
+UInt_t AliGRPPreprocessor::ProcessDqmFxs()
+{
+ //
+ // Processing DQM fxs information
+ //
+
+ TList* list = GetFileSources(kDQM, "TriggerClassesAndHistosToClone");
+ Bool_t storeResult = kTRUE;
+ if (list !=0x0 && list->GetEntries()!=0){
+ AliInfo("The following sources produced files with the id TriggerClassesAndHistosToClone for GRP");
+ list->Print();
+ for (Int_t jj=0;jj<list->GetEntries();jj++){
+ TObjString * str = dynamic_cast<TObjString*> (list->At(jj));
+ if (!str){
+ AliError(Form("Expecting a TObjString in the list for the %d-th source, but something else was found.",jj));
+ continue;
+ }
+ AliInfo(Form("found source %s", str->String().Data()));
+ TString fileNameRun = GetFile(kDQM, "TriggerClassesAndHistosToClone", str->GetName());
+ if (fileNameRun.Length()>0){
+ AliInfo(Form("Got the file %s", fileNameRun.Data()));
+ TFile dqmFile(fileNameRun.Data(),"READ");
+ if (dqmFile.IsOpen()) {
+ dqmFile.ls();
+ }
+ else {
+ AliError("Can't open file");
+ storeResult = kFALSE;
+ }
+ }
+ else{
+ AliWarning("No file found for current source for DQM TriggerClassesAndHistosToClone");
+ }
+ }
+ }
+ else {
+ AliWarning("No list found for DQM TriggerClassesAndHistosToClone");
+ }
+
+ if (list) delete list;
+
+ // return storeResult;
+ return kTRUE; // temporary!!
+}
//_______________________________________________________________
return nparameter;
}
-
//_______________________________________________________________
UInt_t AliGRPPreprocessor::ProcessDaqFxs()
Int_t ProcessDaqLB(AliGRPObject* grpobj);
UInt_t ProcessDaqFxs();
+ UInt_t ProcessDqmFxs();
UInt_t ProcessSPDMeanVertex();
UInt_t ProcessLHCData(AliGRPObject* grpobj);
UInt_t ProcessDcsFxs(TString partition="", TString detector="");