]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliPreprocessor.cxx
Pre-allocate right amount of memory when used for de,manu storage (Laurent)
[u/mrichter/AliRoot.git] / STEER / AliPreprocessor.cxx
index b70dc3a97c1aaa628c8027ea403c6d236c704700..b35ba08d0c39181baf8f8577ea855fa1b3adb20a 100644 (file)
 
 /*
 $Log$
+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
+
+Revision 1.2  2006/06/06 16:36:49  jgrosseo
+minor changes in AliShuttleInterface and AliPreprocessor
+
+Revision 1.1  2006/06/02 14:14:36  hristov
+Separate library for CDB (Jan)
+
 Revision 1.2  2006/03/07 07:52:34  hristov
 New version (B.Yordanov)
 
@@ -71,20 +93,31 @@ some docs added
 
 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));
 
   if (!fShuttle)
+  {
     AliFatal("Initialized without Shuttle instance.");
+    return;
+  }
+
+  fShuttle->RegisterPreprocessor(this);
 }
 
+//______________________________________________________________________________________________
 AliPreprocessor::~AliPreprocessor()
 {
 }
 
+//______________________________________________________________________________________________
 void AliPreprocessor::Initialize(Int_t run, UInt_t startTime,  UInt_t endTime)
 {
   // Sets the information of the run which is currently processed
@@ -96,16 +129,54 @@ void AliPreprocessor::Initialize(Int_t run, UInt_t startTime,      UInt_t endTime)
   fEndTime = endTime;
 }
 
-Int_t AliPreprocessor::Store(TObject* object, AliCDBMetaData* metaData)
+//______________________________________________________________________________________________
+UInt_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
+  // offline reconstruction, but should be stored anyway (e.g. for debugging) should NOT be stored
+  // using this function. Use StoreReferenceData instead!
+  //
+  // This function should be called at the end of the preprocessor cycle
+  //
+  // 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"
+  //   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->Store(AliCDBPath(GetName(), pathLevel2, pathLevel3), object,
+               metaData, validityStart, validityInfinite);
+}
+
+//______________________________________________________________________________________________
+UInt_t AliPreprocessor::StoreReferenceData(const char* pathLevel2, const char* pathLevel3, TObject* object,
+               AliCDBMetaData* metaData)
 {
-  // Stores the CDB object
+  // 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!
+  //
   // This function should be called at the end of the preprocessor cycle
   //
+  // 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"
+  //   3) the object to be stored
+  //   4) the metaData to be associated with the object
+  //
   // The call is delegated to AliShuttleInterface
 
-  return fShuttle->Store(GetName(), object, metaData);
+  return fShuttle->StoreReferenceData(AliCDBPath(GetName(), pathLevel2, pathLevel3), object,
+               metaData);
 }
 
+//______________________________________________________________________________________________
 const char* AliPreprocessor::GetFile(Int_t system, const char* id, const char* source)
 {
   // This function retrieves a file from the given system (kDAQ, kDCS, kHLT) with the given file id
@@ -117,6 +188,7 @@ const char* AliPreprocessor::GetFile(Int_t system, const char* id, const char* s
   return fShuttle->GetFile(system, GetName(), id, source);
 }
 
+//______________________________________________________________________________________________
 TList* AliPreprocessor::GetFileSources(Int_t system, const char* id)
 {
   // Returns a list of sources in a given system that saved a file with the given id
@@ -126,6 +198,7 @@ TList* AliPreprocessor::GetFileSources(Int_t system, const char* id)
   return fShuttle->GetFileSources(system, GetName(), id);
 }
 
+//______________________________________________________________________________________________
 void AliPreprocessor::Log(const char* message)
 {
   // Adds a log message to the Shuttle log of this preprocessor