]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONCalibrationData.cxx
Completing commit 45100 - .h file was missing
[u/mrichter/AliRoot.git] / MUON / AliMUONCalibrationData.cxx
index 64ce1efe3ab16ce8bab2ca31c891f0807f95d87e..50bcd1ec8acba8382c888f40e239ab413b0e5a5b 100644 (file)
@@ -54,8 +54,8 @@
 ClassImp(AliMUONCalibrationData)
 /// \endcond
 
-AliMUONVStore* AliMUONCalibrationData::fBypassPedestals(0x0);
-AliMUONVStore* AliMUONCalibrationData::fBypassGains(0x0);
+AliMUONVStore* AliMUONCalibrationData::fgBypassPedestals(0x0);
+AliMUONVStore* AliMUONCalibrationData::fgBypassGains(0x0);
 
 //_____________________________________________________________________________
 AliMUONCalibrationData::AliMUONCalibrationData(Int_t runNumber, 
@@ -108,9 +108,9 @@ fConfig(0x0)
 //_____________________________________________________________________________
 AliMUONCalibrationData::~AliMUONCalibrationData()
 {
-  /// Destructor. Note that we're the owner of our pointers.
-  //PH The owner of the objects is CDB, do not delete them!
-  //  Reset();
+  /// Destructor. Note that we're the owner of our pointers if the OCDB cache
+  /// is not set. Otherwise the cache is supposed to take care of them...
+  if (!(AliCDBManager::Instance()->GetCacheFlag())) Reset();
 }
 
 //_____________________________________________________________________________
@@ -194,7 +194,7 @@ AliMUONCalibrationData::CreateObject(Int_t runNumber, const char* path, Int_t* s
   /// Access the CDB for a given path (e.g. MUON/Calib/Pedestals),
   /// and return the corresponding TObject.
   
-  AliCodeTimerAutoClass(Form("%d : %s",runNumber,path),);
+  AliCodeTimerAutoClass(Form("%d : %s",runNumber,path),0);
   
   AliCDBManager* man = AliCDBManager::Instance();
   
@@ -205,8 +205,11 @@ AliMUONCalibrationData::CreateObject(Int_t runNumber, const char* path, Int_t* s
                if ( startOfValidity ) *startOfValidity = entry->GetId().GetFirstRun();
                
     TObject* object = entry->GetObject();
-    entry->SetOwner(kFALSE);
-    if (!(man->GetCacheFlag())) delete entry;
+    if (!(man->GetCacheFlag()))
+    {
+      entry->SetOwner(kFALSE);
+      delete entry;      
+    }
     return object;
   }
        else
@@ -216,7 +219,7 @@ AliMUONCalibrationData::CreateObject(Int_t runNumber, const char* path, Int_t* s
        
   {
     
-    AliCodeTimerAutoClass(Form("Failed to get %s for run %d",path,runNumber),0);
+    AliCodeTimerAutoClass(Form("Failed to get %s for run %d",path,runNumber),1);
 
   }
   
@@ -288,7 +291,7 @@ AliMUONVStore*
 AliMUONCalibrationData::Gains() const
 {
   /// Create (if needed) and return the internal store for gains.
-  if (fBypassGains) return fBypassGains;
+  if (fgBypassGains) return fgBypassGains;
   
   if (!fGains)
   {
@@ -419,8 +422,8 @@ void
 AliMUONCalibrationData::BypassStores(AliMUONVStore* ped, AliMUONVStore* gain)
 {
   /// Force the use of those pedestals and gains
-  fBypassPedestals = ped;
-  fBypassGains = gain;
+  fgBypassPedestals = ped;
+  fgBypassGains = gain;
   
 }
 
@@ -430,7 +433,7 @@ AliMUONCalibrationData::Pedestals() const
 {
   /// Return pedestals
   
-  if (fBypassPedestals) return fBypassPedestals;
+  if (fgBypassPedestals) return fgBypassPedestals;
   
   if (!fPedestals)
   {
@@ -536,6 +539,8 @@ AliMUONCalibrationData::Reset()
 {
 /// Reset all data
 
+  AliCodeTimerAuto("",0);
+  
   delete fConfig;
   fConfig = 0x0;
   delete fPedestals;