72 {
73 bool updated = false;
74 const TObjArray* fromBranches = fromTree->GetListOfBranches();
75 const TObjArray* toBranches = toTree->GetListOfBranches();
76 int nBranches = fromBranches->GetEntriesFast();
78 for (
int k = 0;
k < nBranches; ++
k) {
79 TBranch* branch = static_cast<TBranch*>(fromBranches->UncheckedAt(k));
80 if (toBranches->FindObject(branch->GetName()) == nullptr) {
81 TBranch* newBranch = nullptr;
82 TClass*
cl = TClass::GetClass(branch->GetClassName());
83 if (cl != nullptr) {
84 newBranch = toTree->Branch(branch->GetName(), branch->GetClassName(), nullptr, branch->GetBasketSize(), branch->GetSplitLevel());
86 newBranch->SetAddress(
empty);
87 } else {
88 TObjArray* outLeaves = branch->GetListOfLeaves();
89 TLeaf* leaf = static_cast<TLeaf*>(outLeaves->UncheckedAt(0));
90 std::string_view attr = leaf->GetName();
91 std::string_view
type = leaf->GetTypeName();
92 std::string branchSpec(attr);
93 branchSpec += '/';
94 if (type == "Int_t") branchSpec += 'I';
95 else if (type == "Short_t") branchSpec += 'S';
96 else if (type == "Long_t") branchSpec += 'L';
97 else if (type == "UInt_t") branchSpec +='i';
98 else if (type == "UShort_t") branchSpec+='s';
99 else if (type == "ULong_t") branchSpec +='l';
100 else if (type == "Float_t") branchSpec +='F';
101 else if (type == "Double_t") branchSpec+='D';
102 else if (type == "Char_t") branchSpec +='B';
103 else if (type == "UChar_t") branchSpec +='b';
104 else if (type == "Bool_t") branchSpec +='O';
105 else { branchSpec +=
type; }
106 newBranch = toTree->Branch(branch->GetName(), static_cast<void*>(nullptr), branchSpec.c_str(), 2048);
107 }
109 newBranch->BackFill();
110 }
111 updated = true;
112 }
113 }
114 return updated;
115 }
void * getCachedDummyAddress(TClass *cl, std::unordered_map< TClass *, void * > &cache)
static const Attributes_t empty