]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - SHUTTLE/AliShuttle.h
Implementation of TRD trigger flags (Jochen)
[u/mrichter/AliRoot.git] / SHUTTLE / AliShuttle.h
index 4d7126d34d03c305be37c1097d88833fe50ab907..d738d514f243e39d50adb5ccb86e17ee05f3433e 100644 (file)
@@ -32,7 +32,8 @@ class TMonaLisaWriter;
 class AliShuttle: public AliShuttleInterface {
 public:
        enum DCSType {kAlias=0, kDP};
-       enum returnCodes {kDCSErrCode=20051975, kStorErrCode=20051976};
+       enum TestMode { kNone = 0, kSkipDCS = 1, kErrorDCS = 2, kErrorFXSSources = 4, kErrorFXSFiles = 8, kErrorOCDB = 16, kErrorStorage = 32, kErrorGrid = 64 };
+       enum EMailTarget { kDCSEMail = 0, kFXSEMail, kPPEMail };
 
        AliShuttle(const AliShuttleConfig* config, UInt_t timeout = 5000, Int_t retries = 5);
        virtual ~AliShuttle();
@@ -50,21 +51,34 @@ public:
        Int_t GetCurrentRun() const;
        UInt_t GetCurrentStartTime() const;
        UInt_t GetCurrentEndTime() const;
+       UInt_t GetCurrentYear() const;
+       
+       const char* GetLHCPeriod() const;
 
        virtual Bool_t Store(const AliCDBPath& path, TObject* object, AliCDBMetaData* metaData,
                        Int_t validityStart = 0, Bool_t validityInfinite = kFALSE);
        virtual Bool_t StoreReferenceData(const AliCDBPath& path, TObject* object, AliCDBMetaData* metaData);
+       virtual Bool_t StoreReferenceFile(const char* detector, const char* localFile, const char* gridFileName);
+       virtual Bool_t StoreRunMetadataFile(const char* localFile, const char* gridFileName);
        virtual const char* GetFile(Int_t system, const char* detector,
                const char* id, const char* source);
-       virtual TList* GetFileSources(Int_t system, const char* detector, const char* id);
+       virtual TList* GetFileSources(Int_t system, const char* detector, const char* id = 0);
+       virtual TList* GetFileIDs(Int_t system, const char* detector, const char* source);
        virtual const char* GetRunParameter(const char* lbEntry);
-       virtual AliCDBEntry* GetFromOCDB(const AliCDBPath& path);
-       virtual const char* GetRunType(const char* detCode);
-       virtual void Log(const char* detector, const char* message);
+       virtual UInt_t GetStartTimeDCSQuery();
+       virtual UInt_t GetEndTimeDCSQuery();
+       virtual AliCDBEntry* GetFromOCDB(const char* detector, const AliCDBPath& path);
+       virtual const char* GetRunType();
+       virtual Bool_t GetHLTStatus();
+       virtual const char* GetTriggerConfiguration(); 
+       virtual const char* GetCTPTimeParams(); 
+       virtual const char* GetTriggerDetectorMask(); 
+       virtual void Log(const char* detector, const char* message, UInt_t level=3);
 
-       //TODO Test only, remove later !
-       void SetProcessDCS(Bool_t process) {fgkProcessDCS = process;}
        void SetLogbookEntry(AliShuttleLogbookEntry* entry) {fLogbookEntry=entry;}
+       
+       void SetTestMode(TestMode testMode) { fTestMode = testMode; }
+       void SetReadTestModeFromLog(Bool_t flag) { fReadTestMode = flag; }
 
        Bool_t Connect(Int_t system);
 
@@ -77,44 +91,57 @@ public:
        static void SetShuttleTempDir (const char* tmpDir);
        static void SetShuttleLogDir (const char* logDir);
 
+       virtual void SendMLFromDet(const char* value);
+       virtual TString* GetLTUConfig(const char* det);
+
 private:
        AliShuttle(const AliShuttle& other);
        AliShuttle& operator= (const AliShuttle& other);
 
-       UInt_t ProcessCurrentDetector();
+       Int_t ProcessCurrentDetector();
 
        AliShuttleLogbookEntry* QueryRunParameters(Int_t run);
        Bool_t QueryShuttleLogbook(const char* whereClause, TObjArray& entries);
+       void CountOpenRuns();
        Bool_t RetrieveConditionsData(const TObjArray& shuttleLogbookEntries);
 
-       Bool_t GetValueSet(const char* host, Int_t port, const char* alias,
-                               TObjArray* result, DCSType type);
+       TMap* GetValueSet(const char* host, Int_t port, const TSeqCollection* entries,
+                             DCSType type, Int_t valueSet);
 
        Bool_t RetrieveFile(UInt_t system, const char* daqFileName, const char* localFileName);
 
        Bool_t UpdateTable();
+       Bool_t UpdateTableSkippedCase(const char* detector="ALL");
        Bool_t UpdateTableFailCase();
 
        Bool_t StoreLocally(const TString& localUri, const AliCDBPath& path, TObject* object,
                                AliCDBMetaData* metaData, Int_t validityStart = 0, Bool_t validityInfinite = kFALSE);
 
        Bool_t StoreOCDB();
-       Bool_t StoreOCDB(const TString& uri);
+       Int_t StoreOCDB(const TString& uri);
+       Bool_t CopyFileLocally(const char* localFile, const TString& target);
+       Bool_t CopyFilesToGrid(const char* type);
        void CleanLocalStorage(const TString& uri);
+       Bool_t CleanReferenceStorage(const char* detector);
        void RemoveFile(const char* filename);
+       const char* GetRefFilePrefix(const char* base, const char* detector);
 
        AliShuttleStatus* ReadShuttleStatus();
        Bool_t WriteShuttleStatus(AliShuttleStatus* status);
        Bool_t ContinueProcessing();
        void UpdateShuttleStatus(AliShuttleStatus::Status newStatus, Bool_t increaseCount = kFALSE);
        Bool_t UpdateShuttleLogbook(const char* detector, const char* status=0);
-       Bool_t SendMail();
+       Bool_t SendMail(EMailTarget target, Int_t system = -1);
+       Int_t GetMem(Int_t pid);
+       
+       TString GetLogFileName(const char* detector) const;
 
        void SetLastAction(const char* action);
        
-       void SendMLInfo();
-
-       void SetRunType();
+       void SendAlive();
+       void SendMLDetInfo();
+       void SendMLRunInfo(const char* status);
+       virtual Bool_t TouchFile();
 
        const AliShuttleConfig* fConfig;        // pointer to configuration object
 
@@ -125,10 +152,12 @@ private:
 
        AliShuttleLogbookEntry* fLogbookEntry;   //! current Shuttle logbook entry
        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
 
@@ -140,8 +169,10 @@ private:
 
        TMonaLisaWriter* fMonaLisa;  // ML instance that sends the processing information
 
-       //TODO Test only, remove later !
-       static Bool_t fgkProcessDCS; // flag to enable DCS archive data processing
+       TestMode fTestMode;          // sets test mode flags, that e.g. simulate a dcs error etc.
+       Bool_t fReadTestMode;        // Reads the test mode from the log entry of the given run (only for test)
+       
+       Bool_t fOutputRedirected;    // is the output redirected to a file
 
        ClassDef(AliShuttle, 0);
 };