TList* connectedList = (TList*) (tree->GetUserInfo()->FindObject("AODObjectsConnectedToTree"));
if (connectedList && (strcmp(opt, "reconnect"))) {
// If connected use the connected list of objects
- printf("Delete and reconnect \n");
-
fAODObjects->Delete();
fAODObjects = connectedList;
GetStdContent();
// Connect to tree
// prevent a memory leak when reading back the TList
if (!(strcmp(opt, "reconnect"))) fAODObjects->Delete();
- delete fAODObjects;
- fAODObjects = 0;
+
// create a new TList from the UserInfo TList...
// copy constructor does not work...
fAODObjects = (TList*)(aodEvent->GetList()->Clone());
- fAODObjects->SetOwner(kFALSE);
+ fAODObjects->SetOwner(kTRUE);
if(fAODObjects->GetEntries()<kAODListN){
printf("%s %d AliAODEvent::ReadFromTree() TList contains less than the standard contents %d < %d \n",
(char*)__FILE__,__LINE__,fAODObjects->GetEntries(),kAODListN);
GetStdContent();
// when reading back we are not owner of the list
// must not delete it
- fAODObjects->SetOwner(kFALSE);
+ fAODObjects->SetOwner(kTRUE);
fAODObjects->SetName("AODObjectsConnectedToTree");
// we are not owner of the list objects
// must not delete it
GetStdContent();
// when reading back we are not owner of the list
// must not delete it
- fAODObjects->SetOwner(kFALSE);
+ fAODObjects->SetOwner(kTRUE);
}
}
SwitchOnBranches();
if (!fEvent) fEvent = new AliESDEvent();
-
fEvent->ReadFromTree(fTree);
fNEvents = fTree->GetEntries();
fHLTEvent = 0;
}
if (fHLTTree) {
- fHLTEvent = new AliESDEvent();
- fHLTEvent->ReadFromTree(fHLTTree);
+ if (!fHLTEvent) fHLTEvent = new AliESDEvent();
+ fHLTEvent->ReadFromTree(fHLTTree);
}
}
-
return kTRUE;
}