Bug fix in the order of the Ds cuts (Sadhana, Francesco)
[u/mrichter/AliRoot.git] / SHUTTLE / AliShuttleConfig.cxx
index da8998b..af7931e 100644 (file)
@@ -266,133 +266,6 @@ fIsValid(kFALSE)
        
        fIsValid = kTRUE;
 }
-
-//______________________________________________________________________________________________
-AliShuttleConfig::AliShuttleConfig(const AliShuttleConfig & other):
-       TObject(),
-       fConfigHost(other.fConfigHost),
-       fAlienPath(other.fAlienPath),
-       fDAQlbHost(other.fDAQlbHost),
-       fDAQlbPort(other.fDAQlbPort),
-       fDAQlbUser(other.fDAQlbUser),
-       fDAQlbPass(other.fDAQlbPass),
-       fDAQlbDB(other.fDAQlbDB),
-       fDAQlbTable(other.fDAQlbTable),
-       fShuttlelbTable(other.fShuttlelbTable),
-       fRunTypelbTable(other.fRunTypelbTable),
-       fPasswdFilePath(other.fPasswdFilePath),
-       fMaxRetries(other.fMaxRetries),
-       fPPTimeOut(other.fPPTimeOut),
-       fDCSTimeOut(other.fDCSTimeOut),
-       fDCSRetries(other.fDCSRetries),
-       fPPMaxMem(other.fPPMaxMem),
-       fMonitorHost(other.fMonitorHost),
-       fMonitorTable(other.fMonitorTable),
-       fTriggerWait(other.fTriggerWait),
-       fRunMode(other.fRunMode),
-       fDetectorMap(),
-       fDetectorList(other.fDetectorList),
-       fShuttleInstanceHost(other.fShuttleInstanceHost),
-       fProcessedDetectors(other.fProcessedDetectors),
-       fKeepDCSMap(other.fKeepDCSMap),
-       fKeepTempFolder(other.fKeepTempFolder),
-       fSendMail(other.fSendMail),
-       fProcessAll(other.fProcessAll),
-       fIsValid(other.fIsValid)
-{
-       //
-       // copy ctor
-       //
-       for (Int_t i = 0; i<3; i++){
-               fFXSHost[i]=other.fFXSHost[i];
-               fFXSPort[i]=other.fFXSPort[i];
-               fFXSUser[i]=other.fFXSUser[i];
-               fFXSPass[i]=other.fFXSPass[i];
-               fFXSBaseFolder[i]=other.fFXSBaseFolder[i];
-               fFXSdbHost[i]=other.fFXSdbHost[i];
-               fFXSdbPort[i]=other.fFXSdbPort[i];
-               fFXSdbUser[i]=other.fFXSdbUser[i];
-               fFXSdbPass[i]=other.fFXSdbPass[i];
-               fFXSdbName[i]=other.fFXSdbName[i];
-               fFXSdbTable[i]=other.fFXSdbTable[i];
-       }
-       for (Int_t i = 0; i<5; i++){
-               fAdmin[i] = new TObjArray();
-               fAdmin[i]->AddAt(other.fAdmin[i]->At(i),i);
-       }
-
-       TIter iter((other.fDetectorMap).GetTable());
-       TPair* aPair = 0;
-       
-       while ((aPair = (TPair*) iter.Next())) {
-               AliShuttleDetConfigHolder *holder =(AliShuttleDetConfigHolder *)aPair->Value();
-               TKey *key = (TKey*)aPair->Key();
-               fDetectorMap.Add(key,holder);
-       }
-
-
-} 
-//_____________________________________________________________________________________________                
-AliShuttleConfig& AliShuttleConfig::operator=(const AliShuttleConfig &other) 
-{
-       //
-       //assignment operator
-       //
-       this->fConfigHost=other.fConfigHost;
-       this->fDAQlbHost=other.fDAQlbHost;
-       this->fDAQlbPort=other.fDAQlbPort;
-       this->fDAQlbUser=other.fDAQlbUser;
-       this->fDAQlbPass=other.fDAQlbPass;
-       this->fDAQlbDB=other.fDAQlbDB;
-       this->fDAQlbTable=other.fDAQlbTable;
-       this->fShuttlelbTable=other.fShuttlelbTable;
-       this->fRunTypelbTable=other.fRunTypelbTable;
-       this->fPasswdFilePath=other.fPasswdFilePath;
-       this->fMaxRetries=other.fMaxRetries;
-       this->fPPTimeOut=other.fPPTimeOut;
-       this->fDCSTimeOut=other.fDCSTimeOut;
-       this->fDCSRetries=other.fDCSRetries;
-       this->fPPMaxMem=other.fPPMaxMem;
-       this->fMonitorHost=other.fMonitorHost;
-       this->fMonitorTable=other.fMonitorTable;
-       this->fTriggerWait=other.fTriggerWait;
-       this->fRunMode=other.fRunMode;
-       this->fDetectorList=other.fDetectorList;
-       this->fShuttleInstanceHost=other.fShuttleInstanceHost;
-       this->fProcessedDetectors=other.fProcessedDetectors;
-       this->fKeepDCSMap=other.fKeepDCSMap;
-       this->fKeepTempFolder=other.fKeepTempFolder;
-       this->fSendMail=other.fSendMail;
-       this->fProcessAll=other.fProcessAll;
-       this->fIsValid=other.fIsValid;
-       for (Int_t i = 0; i<3; i++){
-               this->fFXSHost[i]=other.fFXSHost[i];
-               this->fFXSPort[i]=other.fFXSPort[i];
-               this->fFXSUser[i]=other.fFXSUser[i];
-               this->fFXSPass[i]=other.fFXSPass[i];
-               this->fFXSBaseFolder[i]=other.fFXSBaseFolder[i];
-               this->fFXSdbHost[i]=other.fFXSdbHost[i];
-               this->fFXSdbPort[i]=other.fFXSdbPort[i];
-               this->fFXSdbUser[i]=other.fFXSdbUser[i];
-               this->fFXSdbPass[i]=other.fFXSdbPass[i];
-               this->fFXSdbName[i]=other.fFXSdbName[i];
-               this->fFXSdbTable[i]=other.fFXSdbTable[i];
-       }
-       for (Int_t i = 0; i<5; i++){
-               this->fAdmin[i] = new TObjArray();
-               this->fAdmin[i]->AddAt(other.fAdmin[i]->At(i),i);
-       }
-
-       TIter iter((other.fDetectorMap).GetTable());
-       TPair* aPair = 0;
-       
-       while ((aPair = (TPair*) iter.Next())) {
-               AliShuttleDetConfigHolder *holder =(AliShuttleDetConfigHolder *)aPair->Value();
-               TKey *key = (TKey*)aPair->Key();
-               this->fDetectorMap.Add(key,holder);
-       }
-       return *this;
-} 
 //______________________________________________________________________________________________
 void AliShuttleConfig::AliShuttleDCSConfigHolder::ExpandAndAdd(TObjArray* target, const char* entry)
 {
@@ -664,7 +537,8 @@ AliShuttleConfig::AliShuttleConfig(const char* host, Int_t port,
        fShuttlelbTable(""), 
        fRunTypelbTable(""),
        fPasswdFilePath(""),
-       fMaxRetries(0), 
+       fTerminateFilePath(""), 
+       fMaxRetries(0),
        fPPTimeOut(0), 
        fDCSTimeOut(0), 
        fDCSRetries(0), 
@@ -674,6 +548,9 @@ AliShuttleConfig::AliShuttleConfig(const char* host, Int_t port,
        fMonitorHost(""), 
        fMonitorTable(""), 
        fTriggerWait(3600),
+       fShuttleFileSystem("/"),
+       fFreeDiskWarningThreshold(20),
+       fFreeDiskFatalThreshold(10),
        fRunMode(kTest),
        fDetectorMap(), 
        fDetectorList(),
@@ -1114,6 +991,11 @@ UInt_t AliShuttleConfig::SetGlobalConfig(TList* list)
        TString tmpStr = anAttribute->GetValue();
        fMaxRetries = tmpStr.Atoi();
 
+       anAttribute = anEntry->GetAttribute("terminateFilePath");
+       if (anAttribute) {
+               fTerminateFilePath = anAttribute->GetValue();
+       }
+
        anAttribute = anEntry->GetAttribute("ppTimeOut");
        if (!anAttribute) {
                AliError("Can't find ppTimeOut attribute!");
@@ -1178,11 +1060,31 @@ UInt_t AliShuttleConfig::SetGlobalConfig(TList* list)
 
        anAttribute = anEntry->GetAttribute("triggerWait"); // MAY
        if (!anAttribute) {
-               AliWarning(Form("triggerWait not set! default = ", fTriggerWait));
+               AliWarning(Form("triggerWait not set! default = %d", fTriggerWait));
        }
        tmpStr = anAttribute->GetValue();
        fTriggerWait = tmpStr.Atoi();
-       
+
+        anAttribute = anEntry->GetAttribute("ShuttleFileSystem"); 
+       if (!anAttribute) {
+               AliWarning(Form("ShuttleFileSystem not set! default = %s", fShuttleFileSystem.Data()));
+       }
+       fShuttleFileSystem = anAttribute->GetValue();
+
+       anAttribute = anEntry->GetAttribute("FreeDiskWarningThreshold"); // MAY
+       if (!anAttribute) {
+               AliWarning(Form("FreeDiskWarningThreshold not set! default = %d", fFreeDiskWarningThreshold));
+       }
+       tmpStr = anAttribute->GetValue();
+       fFreeDiskWarningThreshold = tmpStr.Atoi();
+
+       anAttribute = anEntry->GetAttribute("FreeDiskFatalThreshold"); // MAY
+       if (!anAttribute) {
+               AliWarning(Form("FreeDiskFatalThreshold not set! default = %d", fFreeDiskFatalThreshold));
+       }
+       tmpStr = anAttribute->GetValue();
+       fFreeDiskFatalThreshold = tmpStr.Atoi();                
+
        anAttribute = anEntry->GetAttribute("mode");
        if (!anAttribute) {
                AliWarning("Run mode not set! Running in test mode.");
@@ -1622,11 +1524,11 @@ void AliShuttleConfig::Print(Option_t* option) const
        result += Form("Logbook Configuration \n\n \tHost: %s:%d; \tUser: %s; ",
                fDAQlbHost.Data(), fDAQlbPort, fDAQlbUser.Data());
 
-//     result += "Password: ";
-//     result.Append('*', fDAQlbPass.Length());
        result += Form("\tDB: %s; \tTables: %s, %s, %s\n",
                fDAQlbDB.Data(), fDAQlbTable.Data(), fShuttlelbTable.Data(), fRunTypelbTable.Data());
 
+       result += Form("Terminate file path: %s\n", fTerminateFilePath.Data());
+
        result += "\n\n";
        
        result += "------------------------------------------------------\n";
@@ -1637,10 +1539,8 @@ void AliShuttleConfig::Print(Option_t* option) const
                result += Form("\tDB  host: %s:%d; \tUser: %s; \tName: %s; \tTable: %s\n",
                                                fFXSdbHost[iSys].Data(), fFXSdbPort[iSys], fFXSdbUser[iSys].Data(),
                                                fFXSdbName[iSys].Data(), fFXSdbTable[iSys].Data());
-               // result += Form("DB Password:",fFXSdbPass[iSys].Data());
                result += Form("\tFXS host: %s:%d; \tUser: %s\n", fFXSHost[iSys].Data(), fFXSPort[iSys],
                                                fFXSUser[iSys].Data());
-               // result += Form("FXS Password:",fFXSPass[iSys].Data());
                const TObjArray* fxsAdmins = GetAdmins(iSys);
                if (fxsAdmins->GetEntries() != 0)
                {