Do not delete AliCDBEntry if cache is active A.Colla)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 11 Apr 2006 15:26:05 +0000 (15:26 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 11 Apr 2006 15:26:05 +0000 (15:26 +0000)
RICH/AliRICHParam.cxx
RICH/AliRICHv1.cxx

index 863d913..c6f71e8 100644 (file)
@@ -83,7 +83,8 @@ void AliRICHParam::CdbRead(Int_t run,Int_t version)
 
   AliCDBEntry *pEntry=AliCDBManager::Instance()->Get("RICH/RICHConfig/RefIdxC6F14",run,0,version); //try to get from common local storage  
   if(pEntry){
-    fIdxC6F14=(TF2*)pEntry->GetObject(); delete pEntry;
+    fIdxC6F14=(TF2*)pEntry->GetObject(); 
+    if(!(AliCDBManager::Instance()->GetCacheFlag())) delete pEntry;
   }else{
     AliWarning("No valid calibarion, the hardcoded will be used!");
     fIdxC6F14=new TF2("RidxC4F14","sqrt(1+0.554*(1239.84e-9/x)^2/((1239.84e-9/x)^2-5796)-0.0005*(y-20))",5.5e-9,8.5e-9,0,50); //DiMauro mail
index d680bea..f6ad894 100644 (file)
@@ -79,7 +79,7 @@ void AliRICHv1::CreateMaterials()
   TF2 *pIdxC6F14;
   AliCDBEntry *pEntry=AliCDBManager::Instance()->Get("RICH/RICHConfig/RefIdxC6F14",0,0,0); //0-0-0 is for simulation
   if(pEntry){
-    pIdxC6F14=(TF2*)pEntry->GetObject(); delete pEntry;
+    pIdxC6F14=(TF2*)pEntry->GetObject(); // delete pEntry; // do not delete, entry is cached in CDB!
   }else{
     AliWarning("No valid calibarion, the hardcoded will be used!");
     pIdxC6F14=new TF2("RidxC4F14","sqrt(1+0.554*(1239.84e-9/x)^2/((1239.84e-9/x)^2-5796)-0.0005*(y-20))",5.5e-9,8.5e-9,0,50); //DiMauro mail