]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliPreprocessor.cxx
Additional getters (Haavard)
[u/mrichter/AliRoot.git] / STEER / AliPreprocessor.cxx
index 3b428dca8826ea017f9a3d70b1d50344cb39318f..bb1b57f188afa542d976364ee5e91e0c35998f09 100644 (file)
 
 /*
 $Log$
+Revision 1.12  2007/04/05 08:05:55  acolla
+Conversion from online to offline detector name in StoreReferenceFile
+
+Revision 1.11  2007/04/04 10:29:18  jgrosseo
+1) Storing of files to the Grid is now done _after_ your preprocessors succeeded. This is transparent, which means that you can still use the same functions (Store, StoreReferenceData) to store files to the Grid. However, the Shuttle first stores them locally and transfers them after the preprocessor finished. The return code of these two functions has changed from UInt_t to Bool_t which gives you the success of the storing.
+In case of an error with the Grid, the Shuttle will retry the storing later, the preprocessor does not need to be run again.
+
+2) The meaning of the return code of the preprocessor has changed. 0 is now success and any other value means failure. This value is stored in the log and you can use it to keep details about the error condition.
+
+3) New function StoreReferenceFile to _directly_ store a file (without opening it) to the reference storage.
+
+4) The memory usage of the preprocessor is monitored. If it exceeds 2 GB it is terminated.
+
+5) New function AliPreprocessor::ProcessDCS(). If you do not need to have DCS data in all cases, you can skip the processing by implemting this function and returning kFALSE under certain conditions. E.g. if there is a certain run type.
+If you always need DCS data (like before), you do not need to implement it.
+
+6) The run type has been added to the monitoring page
+
+Revision 1.9  2007/02/28 10:42:58  acolla
+Run type field added in SHUTTLE framework. Run type is read from "run type" logbook and retrieved by
+AliPreprocessor::GetRunType() function.
+
+Revision 1.7  2006/11/06 14:24:21  jgrosseo
+reading of run parameters from the logbook
+online offline naming conversion
+
+Revision 1.6  2006/10/02 12:57:48  jgrosseo
+Small interface change of function StoreReferenceData in Shuttle
+
+Revision 1.5  2006/09/04 17:42:34  hristov
+Changes required by Effective C++
+
+Revision 1.4  2006/08/08 14:20:49  jgrosseo
+Update to shuttle classes (Alberto)
+
+- Possibility to set the full object's path in the Preprocessor's and
+Shuttle's  Store functions
+- Possibility to extend the object's run validity in the same classes
+("startValidity" and "validityInfinite" parameters)
+- Implementation of the StoreReferenceData function to store reference
+data in a dedicated CDB storage.
+
 Revision 1.3  2006/07/11 12:42:43  jgrosseo
 adding parameters for extended validity range of data produced by preprocessor
 
@@ -76,6 +118,7 @@ some docs added
 #include "AliCDBStorage.h"
 #include "AliCDBId.h"
 #include "AliCDBPath.h"
+#include "AliCDBEntry.h"
 #include "AliShuttleInterface.h"
 
 ClassImp(AliPreprocessor)
@@ -83,6 +126,9 @@ ClassImp(AliPreprocessor)
 //______________________________________________________________________________________________
 AliPreprocessor::AliPreprocessor(const char* detector, AliShuttleInterface* shuttle) :
   TNamed(detector, ""),
+  fRun(-1),
+  fStartTime(0),
+  fEndTime(0),
   fShuttle(shuttle)
 {
        SetTitle(Form("AliPreprocessor for %s subdetector.", detector));
@@ -114,7 +160,7 @@ void AliPreprocessor::Initialize(Int_t run, UInt_t startTime,       UInt_t endTime)
 }
 
 //______________________________________________________________________________________________
-UInt_t AliPreprocessor::Store(const char* pathLevel2, const char* pathLevel3, TObject* object,
+Bool_t AliPreprocessor::Store(const char* pathLevel2, const char* pathLevel3, TObject* object,
                AliCDBMetaData* metaData, Int_t validityStart, Bool_t validityInfinite)
 {
   // Stores a CDB object in the storage for offline reconstruction. Objects that are not needed for
@@ -125,7 +171,7 @@ UInt_t AliPreprocessor::Store(const char* pathLevel2, const char* pathLevel3, TO
   //
   // The parameters are
   //   1, 2) the 2nd and 3rd level of the object's path. The first level is the detector name which is provided
-  //         by the Preprocessor. Thus the object's path is "DET/level2/level3"
+  //         by the Preprocessor and converted to the Offline name. Thus the object's path is "DET/level2/level3"
   //   3) the object to be stored
   //   4) the metaData to be associated with the object
   //   5) the validity start run number w.r.t. the current run,
@@ -135,13 +181,16 @@ UInt_t AliPreprocessor::Store(const char* pathLevel2, const char* pathLevel3, TO
   //
   // The call is delegated to AliShuttleInterface
 
-  return fShuttle->Store(AliCDBPath(GetName(), pathLevel2, pathLevel3), object,
+  const char* offlineDetName = AliShuttleInterface::GetOfflineDetName(GetName());
+  if(!offlineDetName) return 0;
+
+  return fShuttle->Store(AliCDBPath(offlineDetName, pathLevel2, pathLevel3), object,
                metaData, validityStart, validityInfinite);
 }
 
 //______________________________________________________________________________________________
-UInt_t AliPreprocessor::StoreReferenceData(const char* pathLevel2, const char* pathLevel3, TObject* object,
-               AliCDBMetaData* metaData, Int_t validityStart, Bool_t validityInfinite)
+Bool_t AliPreprocessor::StoreReferenceData(const char* pathLevel2, const char* pathLevel3, TObject* object,
+               AliCDBMetaData* metaData)
 {
   // Stores a CDB object in the storage for reference data. This objects will not be available during
   // offline reconstrunction. Use this function for reference data only!
@@ -150,18 +199,34 @@ UInt_t AliPreprocessor::StoreReferenceData(const char* pathLevel2, const char* p
   //
   // The parameters are
   //   1, 2) the 2nd and 3rd level of the object's path. The first level is the detector name which is provided
-  //         by the Preprocessor. Thus the object's path is "DET/level2/level3"
+  //         by the Preprocessor and converted to the Offline name. Thus the object's path is "DET/level2/level3"
   //   3) the object to be stored
   //   4) the metaData to be associated with the object
-  //   5) the validity start run number w.r.t. the current run,
-  //      if the data is valid only for this run leave the default 0
-  //   6) specifies if the calibration data is valid for infinity (this means until updated),
-  //      typical for calibration runs, the default is kFALSE
   //
   // The call is delegated to AliShuttleInterface
 
-  return fShuttle->StoreReferenceData(AliCDBPath(GetName(), pathLevel2, pathLevel3), object,
-               metaData, validityStart, validityInfinite);
+  const char* offlineDetName = AliShuttleInterface::GetOfflineDetName(GetName());
+  if(!offlineDetName) return 0;
+
+  return fShuttle->StoreReferenceData(AliCDBPath(offlineDetName, pathLevel2, pathLevel3), object,
+               metaData);
+}
+    
+//______________________________________________________________________________________________
+Bool_t AliPreprocessor::StoreReferenceFile(const char* localFile, const char* gridFileName)
+{
+       //
+       // Stores a file directly (without opening it) in the reference storage in the Grid
+       //
+       // The file is stored under the following location: 
+       // <base folder of reference storage>/<DET>/<RUN#>_<gridFileName>
+       // where <gridFileName> is the second parameter given to the function
+       //
+       // The call is delegated to AliShuttleInterface
+       
+       const char* offlineDetName = AliShuttleInterface::GetOfflineDetName(GetName());
+       if(!offlineDetName) return 0;
+       return fShuttle->StoreReferenceFile(GetName(), localFile, gridFileName);
 }
 
 //______________________________________________________________________________________________
@@ -195,3 +260,37 @@ void AliPreprocessor::Log(const char* message)
 
   fShuttle->Log(GetName(), message);
 }
+
+//______________________________________________________________________________________________
+const char* AliPreprocessor::GetRunParameter(const char* param)
+{
+  // Return run parameter read from run logbook
+  //
+  // The call is delegated to AliShuttleInterface
+
+  return fShuttle->GetRunParameter(param);
+}
+
+//______________________________________________________________________________________________
+AliCDBEntry* AliPreprocessor::GetFromOCDB(const char* pathLevel2, const char* pathLevel3)
+{
+  // Return object from OCDB valid for current run
+  //
+  // The call is delegated to AliShuttleInterface
+
+  const char* offlineDetName = AliShuttleInterface::GetOfflineDetName(GetName());
+  if (!offlineDetName) return 0;
+
+  return dynamic_cast<AliCDBEntry*>
+       (fShuttle->GetFromOCDB(GetName(), AliCDBPath(offlineDetName, pathLevel2, pathLevel3)));
+}
+
+//______________________________________________________________________________________________
+const char* AliPreprocessor::GetRunType()
+{
+  // Return run type string read from "run type" logbook
+  //
+  // The call is delegated to AliShuttleInterface
+
+  return fShuttle->GetRunType();
+}