]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliPreprocessor.cxx
Fix for Savannah bug report 59287
[u/mrichter/AliRoot.git] / STEER / AliPreprocessor.cxx
index a1119639179e455052787c66ec43ec86316ec3f7..0e60d2c0acfd5a472922fb988ca9e2d14add27bb 100644 (file)
 
 /*
 $Log$
+Revision 1.17  2007/08/28 16:03:30  acolla
+Restored to v1.14:
+
+
+Function Bool_t GetHLTStatus() added to preprocessor interface. It will return
+the status of HLT read from the run logbook.
+
 Revision 1.16  2007/08/22 09:20:50  hristov
 Updated QA classes (Yves)
 
@@ -123,8 +130,8 @@ some docs added
 #include "AliPreprocessor.h"
 
 #include <TString.h>
-#include <TList.h>
 #include <TMap.h>
+#include <TObjString.h>
 
 #include "AliLog.h"
 #include "AliCDBMetaData.h"
@@ -142,7 +149,8 @@ AliPreprocessor::AliPreprocessor(const char* detector, AliShuttleInterface* shut
   fRun(-1),
   fStartTime(0),
   fEndTime(0),
-  fShuttle(shuttle)
+  fShuttle(shuttle),
+  fRunTypes()
 {
        SetTitle(Form("AliPreprocessor for %s subdetector.", detector));
 
@@ -153,6 +161,8 @@ AliPreprocessor::AliPreprocessor(const char* detector, AliShuttleInterface* shut
   }
 
   fShuttle->RegisterPreprocessor(this);
+  
+  fRunTypes.SetOwner(kTRUE);
 }
 
 //______________________________________________________________________________________________
@@ -241,6 +251,23 @@ Bool_t AliPreprocessor::StoreReferenceFile(const char* localFile, const char* gr
        if(!offlineDetName) return 0;
        return fShuttle->StoreReferenceFile(GetName(), localFile, gridFileName);
 }
+    
+//______________________________________________________________________________________________
+Bool_t AliPreprocessor::StoreRunMetadataFile(const char* localFile, const char* gridFileName)
+{
+       //
+       // Stores Run metadata file to the Grid, in the run folder
+       //
+       // Only GRP can call this function.
+               
+       TString detName(GetName());
+       if (detName != "GRP") 
+       {
+               Log("StoreRunMetadataFile - Only GRP can call this function.");
+               return kFALSE;
+       }
+       return fShuttle->StoreRunMetadataFile(localFile, gridFileName);
+}
 
 //______________________________________________________________________________________________
 const char* AliPreprocessor::GetFile(Int_t system, const char* id, const char* source)
@@ -329,3 +356,106 @@ Bool_t AliPreprocessor::GetHLTStatus()
   return fShuttle->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();
+}
+//______________________________________________________________________________________________
+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
+       // The call is delegated to AliShuttleInterface
+       // Only TRI can call this function.
+       
+       TString detName(GetName());
+       if (detName != "TRI") 
+       {
+               Log("GetTriggerDetectorMask - Only TRI can call this function.");
+               return 0;
+       }
+       
+       return fShuttle->GetTriggerDetectorMask();
+}
+
+//______________________________________________________________________________________________
+void AliPreprocessor::AddRunType(const char* runType)
+{
+       // adds the given run type to the list of run types that are processed
+       // this function should be called in the constructor of the derived preprocessor
+       
+       if (!runType)
+               return;
+       
+       fRunTypes.Add(new TObjString(runType));
+}
+    
+//______________________________________________________________________________________________
+Bool_t AliPreprocessor::AliPreprocessor::ProcessRunType()
+{
+       // searches for the current run type in the list of run types that are processed by this
+       // preprocessor. The list is populated by AddRunType
+       
+       const char* runType = GetRunType();
+
+       Log(Form("Checking if run type %s is in the list of run types to be processed by this preprocessor...", runType));
+       
+       if (fRunTypes.GetEntries() == 0)
+               Log("WARNING! There are no run types defined. This preprocessor will never run.");
+
+       if (fRunTypes.FindObject(runType))
+       {
+               Log("Run type found. Processing this run.");
+               return kTRUE;
+       }
+       
+       Log("Run type not found. Skipping this run.");
+       return kFALSE;
+}
+//______________________________________________________________________________________________
+UInt_t AliPreprocessor::GetStartTimeDCSQuery()
+{
+       // Return Start Time for the DCS query
+       //
+       // The call is delegated to AliShuttleInterface
+
+       return fShuttle->GetStartTimeDCSQuery();
+}
+//______________________________________________________________________________________________
+UInt_t AliPreprocessor::GetEndTimeDCSQuery()
+{
+       // Return End Time for the DCS query
+       //
+       // The call is delegated to AliShuttleInterface
+
+       return fShuttle->GetEndTimeDCSQuery();
+}
+