]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Bug fix: savannah 99025
authorsgorbuno <sgorbuno@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 26 Nov 2012 17:52:16 +0000 (17:52 +0000)
committersgorbuno <sgorbuno@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 26 Nov 2012 17:52:16 +0000 (17:52 +0000)
Put clones of OCDB objects to AliRecoParam to avoid double delete of these objects

HLT/TPCLib/AliHLTTPCClusterTransformation.cxx

index 783e801570168c39bb8effdb30428568b35e09fe..b3658c77be3a69676d201c2a755a17c1a7a05334 100644 (file)
@@ -69,7 +69,7 @@ AliHLTTPCClusterTransformation::~AliHLTTPCClusterTransformation()
 int  AliHLTTPCClusterTransformation::Init( double FieldBz, Long_t TimeStamp )
 {
   // Initialisation
-  
   if(!AliGeomManager::GetGeometry()){
     AliGeomManager::LoadGeometry();
   }
@@ -124,12 +124,14 @@ int  AliHLTTPCClusterTransformation::Init( double FieldBz, Long_t TimeStamp )
 
   if (dynamic_cast<TObjArray*>(recoParamObj)) {
     //cout<<"\n\nSet reco param from AliHLTTPCClusterTransformation: TObjArray found \n"<<endl;
-    fOfflineRecoParam.AddDetRecoParamArray(1,dynamic_cast<TObjArray*>(recoParamObj));
+    TObjArray *copy = (TObjArray*)( static_cast<TObjArray*>(recoParamObj)->Clone() );
+    fOfflineRecoParam.AddDetRecoParamArray(1,copy);
   }
   else if (dynamic_cast<AliDetectorRecoParam*>(recoParamObj)) {
     //cout<<"\n\nSet reco param from AliHLTTPCClusterTransformation: AliDetectorRecoParam found \n"<<endl;
-    fOfflineRecoParam.AddDetRecoParam(1,dynamic_cast<AliDetectorRecoParam*>(recoParamObj));
-  } else {
+    AliDetectorRecoParam *copy = (AliDetectorRecoParam*)static_cast<AliDetectorRecoParam*>(recoParamObj)->Clone();
+    fOfflineRecoParam.AddDetRecoParam(1,copy);
+  } else {    
     return Error(-8,"AliHLTTPCClusterTransformation::Init: Unknown format of the TPC Reco Param entry in the data base");
   }
   
@@ -146,9 +148,8 @@ int  AliHLTTPCClusterTransformation::Init( double FieldBz, Long_t TimeStamp )
   pCalib->GetTransform()->SetCurrentRecoParam(recParam);
 
   // set current time stamp and initialize the fast transformation
   int err = fFastTransform.Init( pCalib->GetTransform(), TimeStamp );
-  
+
   if( err!=0 ){
     return Error(-10,Form( "AliHLTTPCClusterTransformation::Init: Initialisation of Fast Transformation failed with error %d :%s",err,fFastTransform.GetLastError()) );
   }