diff --git a/DataFormats/Detectors/Common/include/DetectorsCommonDataFormats/EncodedBlocks.h b/DataFormats/Detectors/Common/include/DetectorsCommonDataFormats/EncodedBlocks.h index ba6b853f7fb23..4011842fa7c97 100644 --- a/DataFormats/Detectors/Common/include/DetectorsCommonDataFormats/EncodedBlocks.h +++ b/DataFormats/Detectors/Common/include/DetectorsCommonDataFormats/EncodedBlocks.h @@ -725,6 +725,8 @@ inline size_t EncodedBlocks::fillTreeBranch(TTree& tree, const std::str if (!br) { br = tree.Branch(brname.c_str(), &dt, 512, splitLevel); br->SetCompressionLevel(compLevel); + } else { + br->SetObject(&dt); // dt may be a caller's local: never fill from where it was at the first call } return br->Fill(); }