63 int entriesFilled = mTree.GetEntries();
64 if (mBranches.size() < mElements.size()) {
65 mBranches.resize(mElements.size());
69 TBranch* br =
nullptr;
70 for (
int i = 0; i < static_cast<int>(mElements.size());
i++) {
72 auto& element = mElements[
i];
76 name = element.name.data();
78 name = TString::Format(
"B%d",
i);
81 br = mTree.Branch(
name.Data(), element.cls->GetName(),
const_cast<void**
>(&element.ptr));
84 br->SetAddress(
nullptr);
85 for (
int ientry = 0; ientry < entriesFilled; ientry++) {
88 br->SetAddress(
const_cast<void**
>(&element.ptr));
92 if (element.type > 0) {
94 if (element.arsize > 1) {
95 nameC = TString::Format(
"%s[%d]/%c",
name.Data(), element.arsize,
98 nameC = TString::Format(
"%s/%c",
name.Data(), element.type);
100 br = mTree.Branch(
name.Data(),
const_cast<void*
>(element.ptr), nameC.Data());
102 br->SetAddress(
nullptr);
103 for (
int ientry = 0; ientry < entriesFilled; ientry++) {
106 br->SetAddress(
const_cast<void*
>(element.ptr));
158 if (
name[0] ==
'\n') {
163 if (mTree.GetEntries() > 0) {
171 for (last = 0;; last++) {
172 if (
name[last] == 0) {
176 if (last > 0 &&
name[last - 1] ==
'=') {
178 mNextName[last - 1] = 0;
179 mNextNameCounter = 0;
181 TString inName{
name};
182 auto brkStaPos = inName.Index(
'[');
184 if (brkStaPos != kNPOS) {
185 auto brkEndPos = inName.Index(
']');
186 if (brkEndPos != kNPOS && brkEndPos > brkStaPos + 1) {
187 TString
size = inName(brkStaPos + 1, brkEndPos - brkStaPos - 1);
188 arsize =
size.Atoi();
189 mNextName = inName(0, brkStaPos);
194 mNextArraySize = arsize;