]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
adding functionality to retrieve trigger configuration from the DAQ logbook
authorjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 6 May 2008 13:35:01 +0000 (13:35 +0000)
committerjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 6 May 2008 13:35:01 +0000 (13:35 +0000)
SHUTTLE/AliShuttle.cxx
SHUTTLE/AliShuttle.h
SHUTTLE/TestShuttle/AliTestShuttle.h
STEER/AliPreprocessor.cxx
STEER/AliPreprocessor.h
STEER/AliShuttleInterface.h

index 604a90a4f7e2a6df733cef52a871c2ab0f641dd6..adf38f7a9fb6545f75dd30c13cc186bd10c4e2fb 100644 (file)
@@ -3207,6 +3207,54 @@ Bool_t AliShuttle::GetHLTStatus()
                return kFALSE;
        }
 }
+
+//______________________________________________________________________________________________
+const char* AliShuttle::GetTriggerConfiguration()
+{
+       // Receives the trigger configuration from the DAQ logbook for the current run
+       
+       // check connection, if needed reconnect
+       if (!Connect(3)) 
+               return 0;
+
+       TString sqlQuery;
+       sqlQuery.Form("SELECT configFile 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", "ERROR: Trigger configuration 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 triggerConfig(row->GetField(0));
+       
+       delete row;
+       row = 0;
+       
+       delete result;
+       result = 0;
+       
+       Log("SHUTTLE", Form("Found trigger configuration: %s", triggerConfig.Data()));
+       
+       return triggerConfig;
+}
+
 //______________________________________________________________________________________________
 void AliShuttle::SetShuttleTempDir(const char* tmpDir)
 {
index 643168e4c6b0a310e84676b994694071593372d4..786973bace620155553bf7c0fafd0c0644454ebb 100644 (file)
@@ -68,6 +68,7 @@ public:
        virtual AliCDBEntry* GetFromOCDB(const char* detector, const AliCDBPath& path);
        virtual const char* GetRunType();
        virtual Bool_t GetHLTStatus();
+       virtual const char* GetTriggerConfiguration(); 
        virtual void Log(const char* detector, const char* message);
 
        void SetLogbookEntry(AliShuttleLogbookEntry* entry) {fLogbookEntry=entry;}
index 9daf8c11e6fabce9f25b4655f79bd9204f683b95..1e411a092dac500b047569c3986bf7edd8475a1d 100644 (file)
@@ -30,6 +30,7 @@ class AliTestShuttle : public AliShuttleInterface
     void AddInputRunParameter(const char* key, const char* value);
     void SetInputRunType(const char* runType) { fRunType = runType; }
     void SetInputHLTStatus(Bool_t status) { fHLTStatus = status; }
+    void SetInputTriggerConfiguration(const char* configuration) { fTriggerConfiguration = configuration; }
     Bool_t AddInputCDBEntry(AliCDBEntry* entry);
 
     void Process();
@@ -47,6 +48,7 @@ class AliTestShuttle : public AliShuttleInterface
     virtual AliCDBEntry* GetFromOCDB(const char* detector, const AliCDBPath& path);
     virtual const char* GetRunType();
     virtual Bool_t GetHLTStatus() {return fHLTStatus;}
+    virtual const char* GetTriggerConfiguration() { return fTriggerConfiguration; } 
     virtual void Log(const char* detector, const char* message);
 
     virtual void RegisterPreprocessor(AliPreprocessor* preprocessor);
@@ -72,6 +74,7 @@ class AliTestShuttle : public AliShuttleInterface
     Bool_t fHLTStatus;             // HLT status for current run (on=1/off=0)
     TObjArray* fPreprocessors; // list of preprocessors that are to be tested
     TMap* fDcsAliasMap; // DCS data for testing
+    TString fTriggerConfiguration;  // trigger configuration for testing
 
   private:
     Bool_t CopyFileLocally(TString& targetDir, const char* localFile, const char* gridFileName);
index 7b36361b85de3ad1cc6aa2c5e963bf52bfe7f9f6..048696e796e97b6a120fdfa0ce7f4e7ba1197c33 100644 (file)
@@ -263,7 +263,7 @@ Bool_t AliPreprocessor::StoreRunMetadataFile(const char* localFile, const char*
        TString detName(GetName());
        if (detName != "GRP") 
        {
-               Log("StoreRunMetadataFile - Sorry, only Panos has this privilege.");
+               Log("StoreRunMetadataFile - Only GRP can call this function.");
                return kFALSE;
        }
        return fShuttle->StoreRunMetadataFile(localFile, gridFileName);
@@ -357,6 +357,23 @@ Bool_t AliPreprocessor::GetHLTStatus()
 
 }
     
+//______________________________________________________________________________________________
+const char* AliPreprocessor::GetTriggerConfiguration()
+{
+       // Returns the trigger configuration which is read from a table in the DAQ logbook
+       // The call is delegated to AliShuttleInterface
+       // Only GRP can call this function.
+       
+       TString detName(GetName());
+       if (detName != "GRP") 
+       {
+               Log("GetTriggerConfiguration - Only GRP can call this function.");
+               return 0;
+       }
+       
+       return fShuttle->GetTriggerConfiguration();
+}
+
 //______________________________________________________________________________________________
 void AliPreprocessor::AddRunType(const char* runType)
 {
index 2b15131a61bf912a72468d54d350e57fdce1d033..6bd861ef14b1550fc82f86a161c3cb6c1c5abb0e 100644 (file)
@@ -52,6 +52,7 @@ class AliPreprocessor : public TNamed
     AliCDBEntry* GetFromOCDB(const char* pathLevel2, const char* pathLevel3);
     const char* GetRunType();
     Bool_t GetHLTStatus();
+    const char* GetTriggerConfiguration();
     void Log(const char* message);
     
     void AddRunType(const char* runType);
index bf209cb0e8f86139435c318ac19d7b5cbf5d4d66..cd12315f1d286479a63f892bb62baa553810662b 100644 (file)
@@ -39,6 +39,7 @@ class AliShuttleInterface : public TObject
     virtual const char* GetRunParameter(const char* lbEntry) = 0;
     virtual const char* GetRunType() = 0;
     virtual Bool_t GetHLTStatus() = 0;
+    virtual const char* GetTriggerConfiguration() = 0;
 
     virtual AliCDBEntry* GetFromOCDB(const char* detector, const AliCDBPath& path) = 0;