5 |
|
#include <TObject.h> |
6 |
|
#include <TSystem.h> |
7 |
|
#include <TProcessID.h> |
8 |
+ |
#include <TBranchRef.h> |
9 |
|
#include "MitAna/DataUtil/interface/Debug.h" |
10 |
|
|
11 |
|
using namespace mithep; |
229 |
|
for (Int_t i=0;i<fTrees.GetEntries();++i) { |
230 |
|
MyTree *mt = static_cast<MyTree*>(fTrees.At(i)); |
231 |
|
mt->Write(mt->GetName(),TObject::kOverwrite); |
232 |
< |
mt->Reset(); |
232 |
> |
//backup and restore list of branch pointers from TRefTable (needed for autoloading) |
233 |
> |
if (mt->GetBranchRef()) { |
234 |
> |
TObjArray *parents = mt->GetBranchRef()->GetRefTable()->GetParents(); |
235 |
> |
TObjArray parentsBak(*parents); |
236 |
> |
mt->Reset(); |
237 |
> |
for (Int_t j=0; j<parentsBak.GetEntries(); ++j) |
238 |
> |
parents->Add(parentsBak.At(j)); |
239 |
> |
} |
240 |
> |
else |
241 |
> |
mt->Reset(); |
242 |
|
mt->SetDirectory(0); |
243 |
|
} |
244 |
|
|