Adding functionality to retrieve logbook_trigger_config.alignmentFile from
authorzampolli <zampolli@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 13 Oct 2009 01:28:40 +0000 (01:28 +0000)
committerzampolli <zampolli@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 13 Oct 2009 01:28:40 +0000 (01:28 +0000)
daq logbook. Analogous method added for the Test Setup.

SHUTTLE/AliShuttle.cxx
SHUTTLE/AliShuttle.h
SHUTTLE/TestShuttle/AliTestShuttle.cxx
SHUTTLE/TestShuttle/AliTestShuttle.h
STEER/AliPreprocessor.cxx
STEER/AliPreprocessor.h
STEER/AliShuttleInterface.h

index c1019cc..5e5bdc4 100644 (file)
@@ -3477,6 +3477,53 @@ const char* AliShuttle::GetTriggerConfiguration()
 }
 
 //______________________________________________________________________________________________
+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", "ERROR: 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 configuration: %s", triggerTimeParams.Data()));
+       
+       return triggerTimeParams;
+}
+
+//______________________________________________________________________________________________
 const char* AliShuttle::GetTriggerDetectorMask()
 {
        // Receives the trigger detector mask from DAQ logbook
index b03751e..dda3df7 100644 (file)
@@ -71,6 +71,7 @@ public:
        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);
 
index 1380170..dec0be9 100644 (file)
@@ -140,7 +140,10 @@ AliTestShuttle::AliTestShuttle(Int_t run, UInt_t startTime, UInt_t endTime) :
   fRunParameters(0),
   fRunType(),
   fPreprocessors(0),
-  fDcsAliasMap(0)
+  fDcsAliasMap(0),
+  fTriggerConfiguration(""),
+  fTriggerDetectorMask(""),
+  fCTPtiming("")
 {
   // constructor
 
@@ -661,6 +664,15 @@ const char* AliTestShuttle::GetTriggerConfiguration()
        return NULL;
 }
 //______________________________________________________________________________________________
+const char* AliTestShuttle::GetCTPTimeParams()
+{
+       //returns trigger configuration
+       if (fCTPtiming.Length()>0){
+               return fCTPtiming;
+       }
+       return NULL;
+}
+//______________________________________________________________________________________________
 const char* AliTestShuttle::GetTriggerDetectorMask()
 {
        //returns trigger detector mask
index 04b4220..48175a8 100644 (file)
@@ -31,6 +31,7 @@ class AliTestShuttle : public AliShuttleInterface
     void SetInputRunType(const char* runType) { fRunType = runType; }
     void SetInputHLTStatus(Bool_t status) { fHLTStatus = status; }
     void SetInputTriggerConfiguration(const char* configuration) { fTriggerConfiguration = configuration; }
+    void SetInputCTPTimeParams(const char* ctptiming) { fCTPtiming = ctptiming; }
     void SetInputTriggerDetectorMask(const char* triggerDetectorMask) { fTriggerDetectorMask = triggerDetectorMask; }
     Bool_t AddInputCDBEntry(AliCDBEntry* entry);
     void SetTimeCreated(UInt_t timeCreated) { fTimeCreated = timeCreated;}
@@ -53,6 +54,7 @@ class AliTestShuttle : public AliShuttleInterface
     virtual const char* GetRunType();
     virtual Bool_t GetHLTStatus() {return fHLTStatus;}
     virtual const char* GetTriggerConfiguration();
+    virtual const char* GetCTPTimeParams();
     virtual const char* GetTriggerDetectorMask(); 
     virtual void Log(const char* detector, const char* message);
 
@@ -83,6 +85,7 @@ class AliTestShuttle : public AliShuttleInterface
     TMap* fDcsAliasMap; // DCS data for testing
     TString fTriggerConfiguration;  // trigger configuration for testing
     TString fTriggerDetectorMask;   // trigger detector mask for testing
+    TString fCTPtiming;         // CTP time paramters for testing 
 
   private:
     Bool_t CopyFileLocally(TString& targetDir, const char* localFile, const char* gridFileName);
index dcc6c42..0e60d2c 100644 (file)
@@ -374,6 +374,22 @@ const char* AliPreprocessor::GetTriggerConfiguration()
        return fShuttle->GetTriggerConfiguration();
 }
 //______________________________________________________________________________________________
+const char* AliPreprocessor::GetCTPTimeParams()
+{
+       // Returns the CTP timing parameters 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("GetCTPTimeParams - Only GRP can call this function.");
+               return 0;
+       }
+       
+       return fShuttle->GetCTPTimeParams();
+}
+//______________________________________________________________________________________________
 const char* AliPreprocessor::GetTriggerDetectorMask()
 {
        // Returns the trigger detector mask which is read from a table in the DAQ logbook
index a108544..ff7d9d3 100644 (file)
@@ -53,6 +53,7 @@ class AliPreprocessor : public TNamed
     const char* GetRunType();
     Bool_t GetHLTStatus();
     const char* GetTriggerConfiguration();
+    const char* GetCTPTimeParams();
     const char* GetTriggerDetectorMask();
     void Log(const char* message);
     UInt_t GetStartTimeDCSQuery();
index b7f8298..94f12ec 100644 (file)
@@ -42,6 +42,7 @@ class AliShuttleInterface : public TObject
     virtual const char* GetRunType() = 0;
     virtual Bool_t GetHLTStatus() = 0;
     virtual const char* GetTriggerConfiguration() = 0;
+    virtual const char* GetCTPTimeParams() = 0;
     virtual const char* GetTriggerDetectorMask() = 0;
 
     virtual AliCDBEntry* GetFromOCDB(const char* detector, const AliCDBPath& path) = 0;