From b93c2026f9620535bdc6ad47e2a869538f3f70da Mon Sep 17 00:00:00 2001 From: morsch Date: Thu, 12 Jul 2007 09:47:51 +0000 Subject: [PATCH] Same as prvious for old ESD structure. --- STEER/AliESDEvent.cxx | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/STEER/AliESDEvent.cxx b/STEER/AliESDEvent.cxx index a0c120573fa..9e8d9947fcc 100644 --- a/STEER/AliESDEvent.cxx +++ b/STEER/AliESDEvent.cxx @@ -467,13 +467,22 @@ void AliESDEvent::ReadFromTree(TTree *tree){ // if we find the "ESD" branch on the tree we do have the old structure if(tree->GetBranch("ESD")){ - printf("%s %d AliESDEvent::ReadFromTree() Reading old Tree \n",(char*)__FILE__,__LINE__); - tree->SetBranchAddress("ESD",&fESDOld); - CreateStdContent(); // create for copy - // when reading back we are not owner of the list - // must not delete it - fESDObjects->SetOwner(kFALSE); - return; + char ** address = (char **)(tree->GetBranch("ESD")->GetAddress()); + if (!address) { + printf("%s %d AliESDEvent::ReadFromTree() Reading old Tree \n",(char*)__FILE__,__LINE__); + tree->SetBranchAddress("ESD",&fESDOld); + } else { + printf("%s %d AliESDEvent::ReadFromTree() Reading old Tree \n",(char*)__FILE__,__LINE__); + printf("%s %d Branch already connected. Using existing branch address. \n",(char*)__FILE__,__LINE__); + fESDOld = (AliESD*) (*address); + } + + + CreateStdContent(); // create for copy + // when reading back we are not owner of the list + // must not delete it + fESDObjects->SetOwner(kFALSE); + return; } fESDOld = 0; -- 2.43.0