59 && (str.Data()[prefix.
Length()] ==
'.' || (prefix[prefix.
Length()-1]==
'.')))
61 if (!str.Index(prefix))
62 str.Remove(0, prefix.
Length());
67 TVirtualArray *fOnfileObject;
69 R__PushCache(TBuffer &
b, TVirtualArray *in,
UInt_t size) : fBuffer(
b), fOnfileObject(in)
72 fOnfileObject->SetSize(
size);
73 fBuffer.PushDataCache( fOnfileObject );
77 if (fOnfileObject) fBuffer.PopDataCache();
87 bool IsAssociativeContainer(
Int_t stltype)
108 void RecursiveResetReadEntry(
TBranch *br)
112 RecursiveResetReadEntry(
static_cast<TBranch *
>(sub));
121 for (
Int_t i = 0; i < nbranches; ++i) {
124 case 31: br->
SetType(41);
break;
141 bool CanSelfReference(
TClass *cl) {
146 return CanSelfReference(inside);
151 const static TClassRef stringClass(
"std::string");
251 Init(tree,
nullptr, bname,sinfo,
id,pointer,basketsize,splitlevel,btype);
296 Init(parent ? parent->
GetTree() :
nullptr, parent, bname,sinfo,
id,pointer,basketsize,splitlevel,btype);
315 if (
fTree ==
nullptr)
return;
337 if (
fTree->GetDirectory()) {
338 TFile* bfile =
fTree->GetDirectory()->GetFile();
398 bool hasCustomStreamer =
false;
405 hasCustomStreamer = !
fBranchClass.GetClass()->GetCollectionProxy() && (
fBranchClass.GetClass()->GetStreamer() !=
nullptr ||
fBranchClass.GetClass()->HasCustomStreamerMember());
407 if (hasCustomStreamer) {
460 if (splitlevel > 0) {
490 Unroll(
"",
fBranchClass.GetClass(), clOfElement, pointer, basketsize, splitlevel+splitSTLP, 0);
508 Unroll(
name, clOfElement, clOfElement, pointer, basketsize, splitlevel+splitSTLP, 0);
509 if (strchr(bname,
'.')) {
524 if (nbranches ==
fBranches.GetEntriesFast()) {
526 const auto bnamelen = strlen(bname);
528 name.Form(
"%s%s%s", bname, bname[bnamelen-1]==
'.' ?
"" :
".", clOfElement->
GetName());
543 char **ppointer =
reinterpret_cast<char**
>(pointer);
554 fTree->GetListOfLeaves()->Add(leaf);
587 Unroll(
name, clOfClones, clOfClones, pointer, basketsize, splitlevel+splitSTLP, 31);
594 TClass* contCl = elementClass;
598 bool cansplit =
true;
620 fTree->GetListOfLeaves()->Add(leaf);
642 Unroll(
name, valueClass, valueClass, pointer, basketsize, splitlevel+splitSTLP, 41);
655 TClass* clm = elementClass;
676 fTree->GetListOfLeaves()->Add(leaf);
715 Init(tree,
nullptr, bname, clones, basketsize, splitlevel, compress);
742 Init(parent ? parent->
GetTree() :
nullptr, parent, bname, clones, basketsize, splitlevel, compress);
781 if (compress == -1 &&
fTree->GetDirectory()) {
782 TFile *bfile =
fTree->GetDirectory()->GetFile();
786 if (basketsize < 100) basketsize = 100;
806 Error(
"Init",
"Missing class object of the TClonesArray %s\n",clones->
GetName());
814 fTree->GetListOfLeaves()->Add(leaf);
819 if (branchname[branchname.
Length()-1]==
'.') {
826 Unroll(
name, clonesClass, clonesClass,
nullptr, basketsize, splitlevel, 31);
840 fTree->GetListOfLeaves()->Add(leaf);
869 Init(tree,
nullptr, bname, cont, basketsize, splitlevel, compress);
895 Init(parent ? parent->
GetTree() :
nullptr, parent, bname, cont, basketsize, splitlevel, compress);
942 if ((compress == -1) &&
fTree->GetDirectory()) {
943 TFile* bfile =
fTree->GetDirectory()->GetFile();
949 if (basketsize < 100) {
977 fTree->GetListOfLeaves()->Add(leaf);
990 Unroll(
name, valueClass, valueClass,
nullptr, basketsize, splitlevel, 41);
1001 fTree->GetListOfLeaves()->Add(leaf);
1069 if (nbranches > 0) {
1070 TList persistentBranches;
1073 while((branch=
static_cast<TBranch*
>(iB()))) {
1074 if (branch->
IsFolder()) persistentBranches.
Add(branch);
1091 && info->IsCompiled()
1092 && ((element=info->GetElement(
fID)))
1101 mempos=strMember.
First(
'[');
1105 if (!
m ||
m->IsPersistent()) persistentBranches.
Add(branch);
1106 }
else persistentBranches.
Add(branch);
1130 pos = mothername.
First(
'[');
1136 if (mothername(len-1) !=
'.') {
1141 TString doublename = mothername;
1143 Int_t isthere = (
name.Index(doublename) == 0);
1145 name.Prepend(doublename);
1148 doublename.
Append(mothername);
1149 isthere = (
name.Index(doublename) == 0);
1152 name.Prepend(mothername);
1163 name.Prepend(mothername);
1186 if (indexname[indexname.
Length()-1]==
'.') {
1191 for (
Int_t i = 0; i < nbranches; ++i) {
1197 }
else if (
fType == 4) {
1200 Error(
"BuildTitle",
"This cannot happen, fType of parent is not 3 or 4!");
1204 const char* fin = strrchr(bre->
GetTitle(),
'.');
1205 if (fin ==
nullptr) {
1237 if ((stype > 40) && (stype < 61)) {
1279 Error(
"Fill",
"attempt to fill branch %s while address is not set",
GetName());
1302 Error(
"Fill",
"Failed filling branch:%s, nbytes=%d",
GetName(), nwrite);
1314 Error(
"Fill",
"Failed filling branch:%s, nbytes=%d",
GetName(), nwrite);
1322 for (
Int_t i = 0; i < nbranches; ++i) {
1325 nwrite = branch->
FillImpl(imtHelper);
1327 Error(
"Fill",
"Failed filling branch:%s.%s, nbytes=%d",
GetName(), branch->
GetName(), nwrite);
1336 if (
fTree->Debug() > 0) {
1339 if ((entry >=
fTree->GetDebugMin()) && (entry <= fTree->GetDebugMax())) {
1340 printf(
"Fill: %lld, branch=%s, nbytes=%d\n", entry,
GetName(), nbytes);
1375 b.ForceWriteInfo(si,
false);
1378 }
else if (
fType == 31) {
1399 Error(
"FillLeaves",
"The branch counter address was zero!");
1405 Error(
"FillLeaves",
"Clonesa: %s, n=%d, sorry not supported yet",
GetName(),
n);
1428 for (
Int_t ii = 0; ii <
n; ++ii) {
1429 b.WriteDouble32(&(xx[ii]),se);
1438 for (
Int_t ii = 0; ii <
n; ++ii) {
1439 b.WriteFloat16(&(xx[ii]),se);
1491 if (IsAssociativeContainer(*proxy)) {
1521 Error(
"FillLeaves",
"Cannot get streamer info for branch '%s'",
GetName());
1552 Error(
"FillLeaves",
"Cannot get streamer info for branch '%s'",
GetName());
1582 Error(
"FillLeaves",
"Cannot get streamer info for branch '%s'",
GetName());
1613 Error(
"FillLeaves",
"Cannot get streamer info for branch '%s'",
GetName());
1668 Error(
"FillLeaves",
"Cannot get streamer info for branch '%s'",
GetName());
1672 char **arr =
reinterpret_cast<char **
>(clones->
GetObjectRef(
nullptr));
1673 char **end = arr +
n;
1750 Error(
"FillLeaves",
"Cannot get streamer info for branch '%s'",
GetName());
1794 Error(
"FillLeaves",
"Cannot get streamer info for branch '%s'",
GetName());
1809 std::size_t dim =
name.find_first_of(
'[');
1810 if (dim != std::string::npos) {
1833 if (se && se->
IsBase()) {
1837 longnm.reserve(
fName.Length()+len+3);
1838 longnm =
fName.Data();
1841 std::string longnm_parent;
1842 longnm_parent.reserve(
fName.Length()+len+3);
1845 longnm_parent +=
name;
1851 for(
Int_t i = 0; i < nbranches; ++i) {
1854 const char *brname = branch->
GetName();
1855 UInt_t brlen = strlen(brname);
1856 if (brname[brlen-1]==
']') {
1857 const char *dim = strchr(brname,
'[');
1859 brlen = dim - brname;
1862 if (namelen == brlen
1863 && strncmp(
name,brname,brlen) == 0) {
1866 if (brlen == longnm.length()
1867 && strncmp(longnm.c_str(),brname,brlen) == 0) {
1871 if (brlen == longnm_parent.length()
1872 && strncmp(longnm_parent.c_str(),brname,brlen) == 0) {
1876 if (namelen>brlen &&
name[brlen]==
'.' && strncmp(
name,brname,brlen)==0) {
1887 for(
Int_t i = 0; i < nbranches; ++i) {
1889 if(obj->
IsA() != TBranchElement :: Class() )
1893 if (si && br->
GetID() >= 0) {
1895 if (se && se->
IsBase()) {
1917 if (parent==
this || parent->
GetID()<0 )
return nullptr;
1922 if (! se->
IsBase() )
return nullptr;
1930 std::string longname( grand_parent->
GetName() );
1936 if ( longname == leafname ) {
1977 if (valueClass == subbe->fInfo->
GetClass()) {
1978 localInfo = subbe->fInfo;
1985 if (file && file->GetSeekInfo()) {
2005 TClass *targetValueClass =
fInfo->GetClass()->GetCollectionProxy()
2006 ?
fInfo->GetClass()->GetCollectionProxy()->GetValueClass()
2013 if (targetValueClass && localInfo->
GetClass() != targetValueClass) {
2024 for (
size_t i =0; i < ndata; ++i) {
2039 ename = ename.
Remove(pos);
2047 ids.back().fElement = nextel;
2048 ids.back().fInfo = info;
2054 if (!be && nextel->
IsBase()) {
2059 if (subprefix.Length() && subprefix[subprefix.Length()-1] ==
'.')
2060 subprefix.Remove(subprefix.Length()-1);
2066 TClass *expectedClass =
nullptr;
2073 for (
Int_t bi = 0; bi < nbranches; ++bi) {
2075 if (subprefix != branch->
GetName())
2089 if (elementClass && (!be || be->
GetType() == -2)) {
2103 subprefix = ename +
".";
2105 auto nbranches = search->GetEntriesFast();
2106 bool foundRelatedSplit =
false;
2107 for (
Int_t bi = 0; bi < nbranches; ++bi) {
2110 if (!foundRelatedSplit)
2111 foundRelatedSplit = matchSubPrefix;
2122 if (!foundRelatedSplit) {
2132 ids.emplace_back(nextinfo, offset + nextel->
GetOffset());
2135 ids.back().fNestedIDs->fOwnOnfileObject =
true;
2137 ids.back().fNestedIDs->fOnfileObject = onfileObject;
2138 GatherArtificialElements(branches, ids.back().fNestedIDs->fIDs, subprefix, nextinfo, offset + nextel->
GetOffset());
2139 if (ids.back().fNestedIDs->fIDs.empty())
2163 TClass* targetClass =
nullptr;
2173 if ( !targetClass ) {
2174 Error(
"InitInfo",
"Branch '%s': missing dictionary for target class '%s'!",
2193 target +=
"@@emulated";
2202 if( targetClass != cl ) {
2219 if( targetClass != cl )
2256 if (!
fInfo->IsCompiled()) {
2259 Error(
"InitInfo",
"StreamerInfo is not compiled.");
2280 bool seenExisting =
false;
2299 Int_t firstindex = 0;
2300 Int_t lastindex = nbranches - 1;
2307 if (!subbranch->
fInfo)
2311 for(
Int_t i = index - 1; i >= 0; --i) {
2314 if ( ! subbranch_name.
BeginsWith(thisprefix)) {
2319 if (!subbranch->
fInfo)
2322 for(
Int_t i = index; i < nbranches; ++i) {
2325 if ( ! subbranch_name.
BeginsWith(thisprefix)) {
2337 for(
Int_t i = 0; i < nbranches; ++i) {
2340 if ( ! subbranch_name.
BeginsWith(thisprefix)) {
2347 for (
Int_t i = firstindex; i <= lastindex; ++i) {
2350 if (
this != subbranch) {
2352 if (!subbranch->
fInfo)
2364 }
else if (subbranch->
fInfo ==
nullptr && subbranch->
fBranchClass == currentClass) {
2380 Error(
"SetOnfileObject (lambda)",
"2 distincts fOnfileObject are in the hierarchy of %s for type %s",
2385 seenExisting =
true;
2389 lastbranch = subbranch;
2394 if (lastbranch !=
this)
2403 size_t pos = s.rfind(
'.');
2404 if (pos != std::string::npos) {
2405 s = s.substr(pos+1);
2407 while ((pos = s.rfind(
'[')) != std::string::npos) {
2408 s = s.substr(0, pos);
2413 size_t ndata =
fInfo->GetNelement();
2415 for (
size_t i = 0; i < ndata; ++i) {
2416 if (
fInfo->GetElement(i) == elt) {
2419 && s ==
fInfo->GetElement(i)->GetName())
2447 for (
size_t i =
fID+1+(
fNewIDs.size()); i < ndata; ++i) {
2450 std::string ename = nextel->
GetName();
2451 if (ename[0] ==
'*')
2452 ename = ename.substr(1);
2454 while ((pos = ename.rfind(
'[')) != std::string::npos) {
2455 ename = ename.substr(0, pos);
2487 fNewIDs.back().fElement = nextel;
2493 size_t ndata =
fInfo->GetNelement();
2494 for (
size_t i = 0; i < ndata; ++i) {
2495 if (
fInfo->GetElement(i) == elt) {
2509 SetOnfileObject(
fInfo);
2525 if (prefix[
start - 1] ==
'.')
2527 std::string_view view(prefix.
Data(),
start);
2528 auto cutoff = view.find_last_of(
'.');
2529 if (cutoff != std::string::npos) {
2530 prefix.
Remove(cutoff + 1);
2533 if (prefix[prefix.
Length()-1] !=
'.') {
2546 SetOnfileObject(localInfo);
2577 const char* className =
nullptr;
2620 Fatal(
"GetCollectionProxy",
2621 "Can not create a Collection Proxy of any kind for the class \"%s\" needed by the branch \"%s\" of the TTree \"%s\"!",
2625 "Fixing the collection proxy of the class \"%s\" \n"
2626 "\tneeded by the branch \"%s\" of the TTree \"%s\" to be similar to \"%s\".",
2632 }
else if (
fType == 41) {
2675 if (newInfo != brInfo) {
2684 if (newType.
Length()==0) {
2756 if (!IsAssociativeContainer(
fSTLtype)) {
2759 for (
Int_t i = 0; i < nbranches; ++i) {
2782 char **arr =
reinterpret_cast<char **
>(clones->
GetObjectRef());
2783 char **end = arr +
fNdata;
2786 }
else if (
fType == 4) {
2835 if ((entry >=
fTree->GetDebugMin()) && (entry <= fTree->GetDebugMax())) {
2836 Info(
"GetEntry",
"%lld, branch=%s, nbytes=%d", entry,
GetName(), nbytes);
2850 expectedClass =
nullptr;
2854 if ((type == -1) || (
fID == -1)) {
2863 if (!expectedClass) {
2869 expectedType = (
EDataType) data->GetType();
2873 Error(
"GetExpectedType",
"Did not find the type for %s",
GetName());
2886 if (!mother || mother==
this || mother->
GetType() == 3 || mother->
GetType() == 4) {
2900 return "TBranchElement-folder";
2902 return "TBranchElement-leaf";
2963 const char *types[20] = {
2986 return types[itype];
2995template <
typename T>
3046 }
else if (
fType <= 2) {
3058 if (
object ==
nullptr)
3071 }
else if (
fType == 41) {
3127 }
else if (
fType == 4) {
3130 }
else if (
fType == 31) {
3135 }
else if (
fType == 41) {
3140 }
else if (
fType <= 2) {
3155 }
else if (
fType == 41) {
3157 }
else if (prID < 0) {
3163 if (!info || !
object)
return nullptr;
3164 char **val =
reinterpret_cast<char **
>(
object+info->TStreamerInfo::GetElementOffset(prID));
3219 Warning(
"InitializeOffsets",
"No branch class set for branch: %s",
GetName());
3226 Warning(
"InitializeOffsets",
"No streamer info available for branch: %s of class: %s",
GetName(),
fBranchClass.GetClass()->GetName());
3237 Int_t localOffset = 0;
3239 bool renamed =
false;
3249 Warning(
"InitializeOffsets",
"Streamer info for branch: %s has no elements array!",
GetName());
3256 Warning(
"InitializeOffsets",
"Cannot get streamer element for branch: %s!",
GetName());
3277 Error(
"InitializeOffsets",
"Could not find class for branch: %s",
GetName());
3287 bool stlParentNameUpdated =
false;
3291 stlParentName = br->
GetName();
3300 for (
Int_t subBranchIdx = 0; subBranchIdx < nbranches; ++subBranchIdx) {
3301 bool alternateElement =
false;
3305 if (subBranch ==
nullptr) {
3319 Warning(
"InitializeOffsets",
"No streamer info for branch: %s subbranch: %s",
GetName(), subBranch->
GetName());
3324 Warning(
"InitializeOffsets",
"No elements array for branch: %s subbranch: %s",
GetName(), subBranch->
GetName());
3330 if (!subBranchElement) {
3331 Warning(
"InitializeOffsets",
"No streamer element for branch: %s subbranch: %s",
GetName(), subBranch->
GetName());
3345 typedef TStreamerInfoActions::ActionContainer_t::iterator iterator;
3348 iter != end; ++iter) {
3353 subBranchElement =
e;
3354 alternateElement =
true;
3361 localOffset = subBranchElement->
GetOffset();
3369 && CanSelfReference(subBranchElement->
GetClass()))
3385 Warning(
"InitializeOffsets",
"Branch '%s' has no mother!",
GetName());
3390 bool motherDot =
false;
3391 if (motherName.
Length() && strchr(motherName.
Data(),
'.')) {
3394 bool motherDotAtEnd =
false;
3395 if (motherName.
Length() && (motherName[motherName.
Length()-1] ==
'.')) {
3396 motherDotAtEnd =
true;
3399 bool isBaseSubBranch =
false;
3400 if ((subBranch->
fType == 1) || (subBranchElement && subBranchElement->
IsBase())) {
3408 isBaseSubBranch =
true;
3411 bool isContDataMember =
false;
3412 if ((subBranch->
fType == 31) || (subBranch->
fType == 41)) {
3414 isContDataMember =
true;
3439 if (motherDotAtEnd) {
3443 if (!stlParentNameUpdated && stlParentName.
Length()) {
3445 stlParentNameUpdated =
true;
3447 }
else if (
fType == 4) {
3465 if (dataName == (motherName +
'.' + subBranchElement->
GetName()))
3466 dataName = subBranchElement->
GetName();
3467 }
else if (motherDot) {
3484 if (!stlParentNameUpdated && stlParentName.
Length()) {
3492 if (!stlParentNameUpdated && stlParentName.
Length()) {
3498 stlParentNameUpdated =
true;
3499 if (isBaseSubBranch) {
3513 if (dataName[0] ==
'.') {
3523 if (motherDotAtEnd) {
3526 }
else if (motherDot) {
3576 RemovePrefix(dataName, parentName);
3581 if (dataName[0] ==
'.') {
3588 if (dataName[dataName.
Length()-1] ==
'.') {
3608 TClass* pClass =
nullptr;
3630 target +=
"@@emulated";
3648 Warning(
"InitializeOffsets",
"subBranch: '%s' has no parent class, and cannot get class for clones class: '%s'!", subBranch->
GetName(),
GetClonesName());
3652 Warning(
"InitializeOffsets",
"subBranch: '%s' has no parent class! Assuming parent class is: '%s'.", subBranch->
GetName(), pClass->
GetName());
3656 Warning(
"InitializeOffsets",
"subBranch: '%s' has no parent class! Assuming parent class is: '%s'.", subBranch->
GetName(), pClass ? pClass->
GetName() :
"unknown class");
3661 pClass = branchClass;
3666 if (renamed && pClass) {
3667 if (pClass == branchClass) {
3682 if( !strncmp( stlParentName.
Data(), dataName.
Data(), stlParentName.
Length()-1 )
3683 && dataName[ stlParentName.
Length() ] ==
'.' )
3691 if (alternateElement) {
3694 if (dotpos !=
kNPOS) ++dotpos;
else dotpos = 0;
3716 Error(
"InitializeOffsets",
3717 "Could not find the real data member '%s' when constructing the branch '%s' [Likely missing ShowMember].",
3722 Info(
"InitializeOffsets",
3723 "TTree created with an older schema, some data might not be copied in 'slow-cloning' mode; fast-cloning should have the correct result. '%s' is missing when constructing the branch '%s'. ",
3727 Fatal(
"InitializeOffsets",
3728 "Could not find the real data member '%s' when constructing the branch '%s' [Likely an internal error, please report to the developers].",
3736 if (isBaseSubBranch) {
3739 Warning(
"InitializeOffsets",
"Could not find the data member name for branch '%s' with parent branch '%s', assuming offset is zero!", subBranch->
GetName(),
GetName());
3747 if (isContDataMember) {
3761 if (isBaseSubBranch) {
3768 subBranch->
SetOffset(offset - localOffset);
3778 }
else if (isSplit) {
3779 if (isBaseSubBranch) {
3790 if (isBaseSubBranch) {
3830 if (nbranches >= 1) {
3834 return browsables && browsables->
GetSize();
3847 bool ismissing =
false;
3849 if (basket &&
fTree) {
3862 bufbegin = entryOffset[entry-first];
3865 bufnext = entryOffset[entry+1-first];
3869 if (bufnext == bufbegin) {
3887 for(
auto &cursor : ids) {
3888 auto id = cursor.fElemID;
3894 Error(
"TBranchElement::Print",
"Element for id #%d not found in StreamerInfo for %s",
3898 }
else if (cursor.fNestedIDs) {
3899 Printf(
" Within subobject of type %s offset = %d", cursor.fNestedIDs->fInfo->GetName(), cursor.fNestedIDs->fOffset);
3900 PrintElements(cursor.fNestedIDs->fInfo, cursor.fNestedIDs->fIDs);
3907 constexpr auto length = std::char_traits<char>::length;
3909 if (strncmp(option,
"debugAddress",length(
"debugAddress"))==0) {
3910 if (strlen(option)==length(
"debugAddress")) {
3911 Printf(
"%-24s %-16s %2s %4s %-16s %-16s %8s %8s %s %s\n",
3912 "Branch Name",
"Streamer Class",
"ID",
"Type",
"Class",
"Parent",
"pOffset",
"fOffset",
"fObject",
"fOnfileObject");
3921 Printf(
"%-16s %2d %4d %-16s %-16s %8x %8x %p %p%s\n",
3926 for (
Int_t i = 0; i < nbranches; ++i) {
3928 subbranch->
Print(
"debugAddressSub");
3932 if (strncmp(option,
"debugInfo",length(
"debugInfo"))==0) {
3944 Printf(
" With elements:");
3948 Printf(
" with read actions:");
3950 Printf(
" with write actions:");
3952 }
else if (!
fNewIDs.empty() && localInfo) {
3958 Printf(
" with read actions:");
3960 Printf(
" with write actions:");
3963 TString suboption =
"debugInfoSub";
3964 suboption += (option+length(
"debugInfo"));
3965 for (
Int_t i = 0; i < nbranches; ++i) {
3967 subbranch->
Print(suboption);
3980 Printf(
"*............................................................................*");
3985 for (
Int_t i=0;i<nbranches;i++) {
3987 branch->
Print(option);
4044 }
else if (
fType <= 2) {
4061 }
else if (
fType == 3) {
4063 }
else if (
fType == 31) {
4068 }
else if (
fType == 41) {
4085 Fatal(
"ReadLeaves",
"The ReadLeaves function has not been configured for %s",
GetName());
4103 b.SetBufferOffset(
b.Length() -
sizeof(
n));
4105 Error(
"ReadLeaves",
"Incorrect size read for the container in %s\nThe size read is %d when the maximum is %d\nThe size is reset to 0 for this entry (%lld)",
GetName(),
n[0],
fMaximum,
GetReadEntry());
4112 for (
Int_t i=0; i<nbranches; i++) {
4125 if (atype > 54)
return;
4134 if (!len_where)
return;
4139 for( k=0; k<
n; k++) {
4140 char **where = &((
reinterpret_cast<char**
>(
fAddress))[k]);
4144 case 1: {length = (
reinterpret_cast<const Char_t*
>(len_where))[k];
break;}
4145 case 2: {length = (
reinterpret_cast<const Short_t*
>(len_where))[k];
break;}
4146 case 3: {length = (
reinterpret_cast<const Int_t*
>(len_where))[k];
break;}
4147 case 4: {length = (
reinterpret_cast<const Long_t*
>(len_where))[k];
break;}
4149 case 6: {length = (
reinterpret_cast<const Int_t*
>(len_where))[k];
break;}
4151 case 11: {length = (
reinterpret_cast<const UChar_t*
>(len_where))[k];
break;}
4152 case 12: {length = (
reinterpret_cast<const UShort_t*
>(len_where))[k];
break;}
4153 case 13: {length = (
reinterpret_cast<const UInt_t*
>(len_where))[k];
break;}
4154 case 14: {length = (
reinterpret_cast<const ULong_t*
>(len_where))[k];
break;}
4155 case 15: {length = (
reinterpret_cast<const ULong64_t*
>(len_where))[k];
break;}
4156 case 16: {length = (
reinterpret_cast<const Long64_t*
>(len_where))[k];
break;}
4157 case 17: {length = (
reinterpret_cast<const ULong64_t*
>(len_where))[k];
break;}
4158 case 18: {length = (
reinterpret_cast<const bool*
>(len_where))[k];
break;}
4162 if (length <= 0)
continue;
4163 if (isArray == 0)
continue;
4165 case 1: {*where=
new char[
sizeof(
Char_t)*length];
b.ReadFastArray(
reinterpret_cast<Char_t*
>(*where), length);
break;}
4166 case 2: {*where=
new char[
sizeof(
Short_t)*length];
b.ReadFastArray(
reinterpret_cast<Short_t*
>(*where), length);
break;}
4167 case 3: {*where=
new char[
sizeof(
Int_t)*length];
b.ReadFastArray(
reinterpret_cast<Int_t*
>(*where), length);
break;}
4168 case 4: {*where=
new char[
sizeof(
Long_t)*length];
b.ReadFastArray(
reinterpret_cast<Long_t*
>(*where), length);
break;}
4169 case 5: {*where=
new char[
sizeof(
Float_t)*length];
b.ReadFastArray(
reinterpret_cast<Float_t*
>(*where), length);
break;}
4170 case 6: {*where=
new char[
sizeof(
Int_t)*length];
b.ReadFastArray(
reinterpret_cast<Int_t*
>(*where), length);
break;}
4171 case 8: {*where=
new char[
sizeof(
Double_t)*length];
b.ReadFastArray(
reinterpret_cast<Double_t*
>(*where), length);
break;}
4172 case 11: {*where=
new char[
sizeof(
UChar_t)*length];
b.ReadFastArray(
reinterpret_cast<UChar_t*
>(*where), length);
break;}
4173 case 12: {*where=
new char[
sizeof(
UShort_t)*length];
b.ReadFastArray(
reinterpret_cast<UShort_t*
>(*where), length);
break;}
4174 case 13: {*where=
new char[
sizeof(
UInt_t)*length];
b.ReadFastArray(
reinterpret_cast<UInt_t*
>(*where), length);
break;}
4175 case 14: {*where=
new char[
sizeof(
ULong_t)*length];
b.ReadFastArray(
reinterpret_cast<ULong_t*
>(*where), length);
break;}
4176 case 15: {*where=
new char[
sizeof(
UInt_t)*length];
b.ReadFastArray(
reinterpret_cast<UInt_t*
>(*where), length);
break;}
4177 case 16: {*where=
new char[
sizeof(
Long64_t)*length];
b.ReadFastArray(
reinterpret_cast<Long64_t*
>(*where), length);
break;}
4178 case 17: {*where=
new char[
sizeof(
ULong64_t)*length];
b.ReadFastArray(
reinterpret_cast<ULong64_t*
>(*where), length);
break;}
4179 case 18: {*where=
new char[
sizeof(
bool)*length];
b.ReadFastArray(
reinterpret_cast<bool*
>(*where), length);
break;}
4192 case 3: {
b.ReadFastArray(
reinterpret_cast<Int_t*
>(
fAddress),
n);
break;}
4195 case 6: {
b.ReadFastArray(
reinterpret_cast<Int_t*
>(
fAddress),
n);
break;}
4204 case 18: {
b.ReadFastArray(
reinterpret_cast<bool*
>(
fAddress),
n);
break;}
4209 for (
Int_t ii=0;ii<
n;ii++) {
4210 b.ReadDouble32(&(xx[ii]),se);
4218 for (
Int_t ii=0;ii<
n;ii++) {
4219 b.ReadFloat16(&(xx[ii]),se);
4225 }
else if (
fType <= 2) {
4245 loc = counter.
Last(
']');
4249 countname += counter;
4255 Warning(
"ReadLeaves",
"Missing fBranchCount for %s. Data will not be read correctly by the MakeClass mode.",
GetName());
4264 case 3: {
b.ReadFastArray(
reinterpret_cast<Int_t*
>(
fAddress),
n);
break;}
4267 case 6: {
b.ReadFastArray(
reinterpret_cast<Int_t*
>(
fAddress),
n);
break;}
4276 case 18: {
b.ReadFastArray(
reinterpret_cast<bool*
>(
fAddress),
n);
break;}
4281 for (
Int_t ii=0;ii<
n;ii++) {
4282 b.ReadDouble32(&(xx[ii]),se);
4290 for (
Int_t ii=0;ii<
n;ii++) {
4291 b.ReadFloat16(&(xx[ii]),se);
4343 b.SetBufferOffset(
b.Length()-
sizeof(
n));
4345 Error(
"ReadLeaves",
"Incorrect size read for the container in %s\n\tThe size read is %d while the maximum is %d\n\tThe size is reset to 0 for this entry (%lld)",
GetName(),
n,
fMaximum,
GetReadEntry());
4366 fIterators->CreateIterators(alternate, proxy);
4369 if (IsAssociativeContainer(*proxy)) {
4372 for (
Int_t i = 0; i < nbranches; ++i) {
4376 RecursiveResetReadEntry(branch);
4400 if( !
fNdata || *
reinterpret_cast<void**
>(proxy->
At( 0 )) !=
nullptr )
4405 void **el =
reinterpret_cast<void**
>(proxy->
At( i ));
4407 *el = elClass->
New();
4411 proxy->
Commit(alternate);
4437 if (info ==
nullptr)
return;
4469 if (info ==
nullptr)
return;
4500 if (info ==
nullptr)
return;
4531 b.SetBufferOffset(
b.Length()-
sizeof(
n));
4533 Error(
"ReadLeaves",
"Incorrect size read for the container in %s\n\tThe size read is %d while the maximum is %d\n\tThe size is reset to 0 for this entry (%lld)",
GetName(),
n,
fMaximum,
GetReadEntry());
4572 if (info==
nullptr)
return;
4579 char **arr =
reinterpret_cast<char **
>(clones->
GetObjectRef());
4580 char **end = arr +
fNdata;
4720 Fatal(
"FillLeaves",
"The FillLeaves function has not been configured for %s",
GetName());
4730 *(
reinterpret_cast<char**
>(
fAddress)) =
nullptr;
4741 *(
reinterpret_cast<char**
>(
fAddress)) =
nullptr;
4743 }
else if (
fType == 4) {
4748 Warning(
"ReleaseObject",
"Cannot delete allocated STL container because I do not have a proxy! branch: %s",
GetName());
4752 if (needDelete &&
fID >= 0) {
4759 proxy->
Clear(
"force");
4767 *(
reinterpret_cast<char**
>(
fAddress)) =
nullptr;
4773 Warning(
"ReleaseObject",
"Cannot delete allocated object because I cannot instantiate a TClass object for its class! branch: '%s' class: '%s'",
GetName(),
fBranchClass.GetClassName());
4784 proxy->
Clear(
"force");
4788 proxy->
Clear(
"force");
4809 for (
Int_t i = 0; i < nbranches; ++i) {
4811 branch->
Reset(option);
4824 for (
Int_t i = 0; i < nbranches; ++i) {
4846 for (
Int_t i = 0; i < nbranches; ++i) {
4872 for (
Int_t i = 0; i < nb; ++i) {
4898 for (
Int_t i = 0; i < nbranches; ++i) {
5052 fAddress =
reinterpret_cast<char*
>(-1);
5053 fObject =
reinterpret_cast<char*
>(-1);
5093 fAddress =
reinterpret_cast<char*
>(addr);
5140 bool matched =
false;
5143 if (clm == content) {
5149 Warning(
"SetAddress",
"The type of the %s was changed from TClonesArray to %s but we do not have a TVirtualCollectionProxy for that container type!",
GetName(), newType->
GetName());
5164 }
else if (IsAssociativeContainer(*
fCollProxy)) {
5176 }
else if (
fType == 4) {
5188 for (
Int_t i = 0; i < nbranches; ++i) {
5206 }
else if (IsAssociativeContainer(*
fCollProxy)) {
5221 for (
Int_t i = 0; i < nbranches; ++i) {
5242 }
else if (IsAssociativeContainer(*
fCollProxy)) {
5249 Error(
"SetAddress",
"For %s, we can not convert %s into %s\n",
5312 }
else if (IsAssociativeContainer(*
fCollProxy)) {
5366 fObject =
reinterpret_cast<char*
>(*pp);
5376 fObject =
reinterpret_cast<char*
>(*pp);
5384 Error(
"SetAddress",
"Embedded TClonesArray given a zero address for branch '%s'",
GetName());
5400 Error(
"SetAddress",
"Embedded pointer to a TClonesArray given a zero address for branch '%s'",
GetName());
5404 }
else if (
fType == 4) {
5424 "Branch %s is a split STL container (fStreamerType is: %d), the address can not be set directly.",
5428 void** pp =
reinterpret_cast<void**
>(
fAddress);
5433 Error(
"SetAddress",
"Failed to allocate STL container for branch '%s'",
GetName());
5441 fObject =
reinterpret_cast<char*
>(*pp);
5446 void** pp =
reinterpret_cast<void**
>(
fAddress);
5451 Error(
"SetAddress",
"Failed to allocate STL container for branch '%s'",
GetName());
5459 fObject =
reinterpret_cast<char*
>(*pp);
5471 Error(
"SetAddress",
"Embedded STL container given a zero address for branch '%s'",
GetName());
5477 "Branch %s is a split STL container (fStreamerType is: %d), the address can not be set directly.",
5482 fObject =
reinterpret_cast<char*
>(proxy->
New());
5486 Error(
"SetAddress",
"Failed to allocate STL container for branch '%s'",
GetName());
5495 Error(
"SetAddress",
"Embedded pointer to an STL container given a zero address for branch '%s'",
GetName());
5499 }
else if (
fType == 41) {
5505 }
else if (
fID < 0) {
5507 char** pp =
reinterpret_cast<char**
>(
fAddress);
5518 fObject =
reinterpret_cast<char*
>(clOfBranch->
New());
5525 Error(
"SetAddress",
"I have no TClass for branch %s, so I cannot allocate an I/O buffer!",
GetName());
5556 for (
Int_t i = 0; i < nbranches; ++i) {
5581 for (
Int_t i = 0; i < nbranches; ++i) {
5597 if (leafOfCounter && leaf) {
5600 if (!leafOfCounter) {
5601 Warning(
"SetBranchCount",
"Counter branch %s for branch %s has no leaves!", brOfCounter->
GetName(),
GetName());
5604 Warning(
"SetBranchCount",
"Branch %s has no leaves!",
GetName());
5623 for (
Int_t i = 0; i < nbranches; ++i) {
5641 fObject =
reinterpret_cast<char*
>(obj);
5698 if (actionSequence)
delete actionSequence;
5726 if (
fInfo ==
nullptr) {
5732 TClass *originalClass =
nullptr;
5751 }
else if (
fType == 31) {
5776 }
else if (
fType == 4) {
5778 }
else if (
fType == 41) {
5788 }
else if (
fType == 3) {
5790 }
else if (
fType == 31) {
5792 }
else if (
fType < 0) {
5794 }
else if (
fType == 0 &&
fID == -1) {
5797 if (hasCustomStreamer) {
5805 }
else if (
fType <= 2) {
5826 if (
fInfo ==
nullptr) {
5832 TClass *originalClass =
nullptr;
5851 }
else if (
fType == 31) {
5876 }
else if (
fType == 4) {
5878 }
else if (
fType == 41) {
5890 }
else if (
fType == 3) {
5892 }
else if (
fType == 31) {
5894 }
else if (
fType < 0) {
5896 }
else if (
fType <=2) {
5918 if (
name ==
nullptr)
return;
5928 for (
Int_t i = 0; i < nbranches; ++i) {
6043 fTree->GetListOfLeaves()->Add(leaf);
6090 else if (
fType == 4) {
6121 const char* motherFileName = treeFileName;
6122 if (mother && (mother !=
this)) {
6148 const char* dot = strchr(
name,
'.');
6150 bool dotlast =
false;
6151 if (nch && (
name[nch-1] ==
'.')) {
6170 char* pointer = (objptr + element->
GetOffset());
6298 const auto namelen = strlen(
name);
6299 bool dotlast = (namelen && (
name[namelen-1] ==
'.'));
6310 for (
Int_t elemID = 0; elemID < ndata; ++elemID) {
6332 if ((btype == 31) || (btype == 41)) {
6344 unroll =
Unroll(
name, clParent, clOfBase, ptr + offset, basketsize, splitlevel+splitSTLP, btype);
6403 Int_t subSplitlevel = splitlevel-1;
6404 if (btype == 31 || btype == 41 || elem->
CannotSplit()) {
6419 Int_t unroll =
Unroll(branchname, clParent, elemClass, ptr + offset, basketsize, splitlevel-1+splitSTLP, btype);
6431 splitSTLP &&
fType != 4 )
6436 basketsize, splitlevel - 1+splitSTLP, sinfo, elemID );
6444 Int_t subSplitlevel = splitlevel - 1;
6445 if ((btype == 31) || (btype == 41) || elem->
CannotSplit()) {
6449 TBranchElement* branch =
new TBranchElement(
this, branchname, sinfo, elemID, ptr + offset, basketsize, subSplitlevel+splitSTLP, btype);
static void unroll(CPyCppyy_PyArgs_t packed_args, CPyCppyy_PyArgs_t unrolled, Py_ssize_t nArgs)
#define R__unlikely(expr)
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
unsigned short UShort_t
Unsigned Short integer 2 bytes (unsigned short).
int Int_t
Signed integer 4 bytes (int).
float Size_t
Attribute size (float).
long Longptr_t
Integer large enough to hold a pointer (platform-dependent).
unsigned char UChar_t
Unsigned Character 1 byte (unsigned char).
int Ssiz_t
String size (currently int).
char Char_t
Character 1 byte (char).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
unsigned long ULong_t
Unsigned long integer 4 bytes (unsigned long). Size depends on architecture.
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
short Short_t
Signed Short integer 2 bytes (short).
double Double_t
Double 8 bytes.
long double LongDouble_t
Long Double (not portable).
constexpr Ssiz_t kNPOS
The equivalent of std::string::npos for the ROOT class TString.
long long Long64_t
Portable signed long integer 8 bytes.
unsigned long long ULong64_t
Portable unsigned long integer 8 bytes.
float Float_t
Float 4 bytes (float).
const char Option_t
Option string (const char).
static void PrintElements(const TStreamerInfo *info, const TStreamerInfoActions::TIDs &ids)
Print branch parameters.
static void R__CleanName(std::string &name)
Remove trailing dimensions and make sure there is a trailing dot.
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Error("WriteTObject","The current directory (%s) is not associated with a file. The object (%s) has not been written.", GetName(), objname)
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
externTVirtualMutex * gInterpreterMutex
externTVirtualMutex * gROOTMutex
void Printf(const char *fmt,...)
Formats a string in a circular formatting buffer and prints the string.
#define R__LOCKGUARD_IMT(mutex)
#define R__LOCKGUARD(mutex)
Bool_t HasRuleWithSourceClass(const TString &source) const
Return True if we have any rule whose source class is 'source'.
A helper class for managing IMT work during TTree:Fill operations.
TIOFeatures provides the end-user with the ability to change the IO behavior of data written via a TT...
Manages buffers for branches of a Tree.
Int_t GetNevBufSize() const
A Branch for the case of an object.
void ReadLeavesClonesMember(TBuffer &b)
Read leaves into i/o buffers for this branch.
void SetActionSequence(TClass *originalClass, TStreamerInfo *localInfo, TStreamerInfoActions::TActionSequence::SequenceGetter_t create, TStreamerInfoActions::TActionSequence *&actionSequence)
Set the sequence of actions needed to read the data out of the buffer.
char * fObject
! Pointer to object at *fAddress
TStreamerInfo * fInfo
! Pointer to StreamerInfo
Int_t fSTLtype
! STL container type
void ReadLeavesCustomStreamer(TBuffer &b)
Read leaves into i/o buffers for this branch.
void Reset(Option_t *option="") override
Reset a Branch.
void SetParentClass(TClass *clparent)
TBranchElement * fBranchCount2
pointer to secondary branchcount branch
Int_t fNdata
! Number of data in this branch
~TBranchElement() override
Destructor.
void SetOffset(Int_t offset) override
Set offset of the object (to which the data member represented by this branch belongs) inside its con...
void FillLeavesCollectionMember(TBuffer &b)
Write leaves into i/o buffers for this branch.
TString fClassName
Class name of referenced object.
TStreamerInfoActions::TActionSequence * fFillActionSequence
! Set of actions to be executed to write the data to the basket.
void Print(Option_t *option="") const override
Print TBranch parameters.
void SetAddressImpl(void *addr, bool implied, Int_t offset) override
See TBranchElement::SetAddress.
const char * GetClassName() const override
Return the name of the user class whose content is stored in this branch, if any.
TStreamerInfo * GetInfo() const
Get streamer info for the branch class.
void ReadLeavesCollection(TBuffer &b)
Read leaves into i/o buffers for this branch.
void SetupAddresses() override
If the branch address is not set, we set all addresses starting with the top level parent branch.
void ResetAddress() override
Set branch address to zero and free all allocated memory.
virtual void SetType(Int_t btype)
void FillLeavesMember(TBuffer &b)
Write leaves into i/o buffers for this branch.
void SetBranchCount(TBranchElement *bre)
Set the branch counter for this branch.
static void SwitchContainer(TObjArray *)
Modify the container type of the branches.
void SetReadActionSequence()
Set the sequence of actions needed to read the data out of the buffer.
bool IsMissingCollection() const
Detect a collection written using a zero pointer in old versions of root.
Int_t FillImpl(ROOT::Internal::TBranchIMTHelper *) override
Loop on all leaves of this branch to fill the basket buffer.
TVirtualCollectionProxy * GetCollectionProxy()
Return the collection proxy describing the branch content, if any.
@ kOwnOnfileObj
We are the owner of fOnfileObject.
@ kAddressSet
The addressing set have been called for this branch.
@ kDecomposedObj
More explicit alias for kMakeClass.
@ kDeleteObject
We are the owner of fObject.
@ kCache
Need to pushd/pop fOnfileObject.
void SetupAddressesImpl()
If the branch address is not set, we set all addresses starting with the top level parent branch.
void SetBasketSize(Int_t bufsize) override
Reset the basket size for all sub-branches of this branch element.
Int_t GetEntry(Long64_t entry=0, Int_t getall=0) override
Read all branches of a BranchElement and return total number of bytes.
TClassRef fParentClass
! Reference to class definition in fParentName
Double_t GetValue(Int_t i, Int_t len, bool subarr=false) const
bool fInInitInfo
! True during the 2nd part of InitInfo (cut recursion).
void BuildTitle(const char *name)
Set branch and leaf name and title in the case of a container sub-branch.
virtual Int_t GetMaximum() const
Return maximum count value of the branchcount if any.
TString fParentName
Name of parent class.
void ReadLeavesCollectionSplitPtrMember(TBuffer &b)
Read leaves into i/o buffers for this branch.
TClassRef fBranchClass
! Reference to class definition in fClassName
TStreamerInfoActions::TIDs fNewIDs
! Nested List of the serial number of all the StreamerInfo to be used.
Int_t GetStreamerType() const
TClass * GetCurrentClass()
Return a pointer to the current type of the data member corresponding to branch element.
UInt_t fCheckSum
CheckSum of class.
void ResetAfterMerge(TFileMergeInfo *) override
Reset a Branch after a Merge operation (drop data but keep customizations).
TStreamerInfoActions::TActionSequence * fReadActionSequence
! Set of actions to be executed to extract the data from the basket.
void FillLeavesClones(TBuffer &b)
Write leaves into i/o buffers for this branch.
void ReadLeavesMemberBranchCount(TBuffer &b)
Read leaves into i/o buffers for this branch.
void SetReadLeavesPtr()
Set the ReadLeaves pointer to execute the expected operations.
Int_t Unroll(const char *name, TClass *cltop, TClass *cl, char *ptr, Int_t basketsize, Int_t splitlevel, Int_t btype)
Split class cl into sub-branches of this branch.
void FillLeavesMakeClass(TBuffer &b)
Write leaves into i/o buffers for this branch.
void FillLeavesCollectionSplitVectorPtrMember(TBuffer &b)
Write leaves into i/o buffers for this branch.
void FillLeavesCollection(TBuffer &b)
Write leaves into i/o buffers for this branch.
Int_t fID
element serial number in fInfo
char * GetAddress() const override
Get the branch address.
void FillLeavesMemberCounter(TBuffer &b)
Write leaves into i/o buffers for this branch.
void SetBranchCount2(TBranchElement *bre)
void FillLeavesCollectionSplitPtrMember(TBuffer &b)
Write leaves into i/o buffers for this branch.
void SetAddress(void *addobj) override
Point this branch at an object.
TStreamerInfo * GetInfoImp() const
Get streamer info for the branch class.
virtual void SetTargetClass(const char *name)
Set the name of the class of the in-memory object into which the data will loaded.
virtual void ResetDeleteObject()
Release ownership of any allocated objects.
virtual const char * GetParentName() const
void ValidateAddress() const
TVirtualArray * GetOnfileObject() const
TVirtualCollectionIterators * fWriteIterators
! holds the read (non-staging) iterators when the branch is of fType==4 and associative containers.
void PrintValue(Int_t i) const
Prints values of leaves.
TVirtualArray * fOnfileObject
! Place holder for the onfile representation of data members.
virtual const char * GetTypeName() const
Return type name of element in the branch.
void FillLeavesAssociativeCollectionMember(TBuffer &b)
Write leaves into i/o buffers for this branch.
void Init(TTree *tree, TBranch *parent, const char *name, TStreamerInfo *sinfo, Int_t id, char *pointer, Int_t basketsize=32000, Int_t splitlevel=0, Int_t btype=0)
Init when the branch object is not a TClonesArray nor an STL container.
T GetTypedValue(Int_t i, Int_t len, bool subarr=false) const
TClassRef fClonesClass
! Reference to class definition in fClonesName
virtual void * GetValuePointer() const
Returns pointer to first data element of this branch.
void ReadLeavesImpl(TBuffer &b)
Unconfiguration Read Leave function.
bool fInitOffsets
! Initialization flag to not endlessly recalculate offsets
void SetupInfo()
Set the value of fInfo.
void FillLeavesImpl(TBuffer &b)
Unconfiguration Fill Leave function.
void FillLeavesClonesMember(TBuffer &b)
Write leaves into i/o buffers for this branch.
TClassRef fCurrentClass
! Reference to current (transient) class definition
char * GetObject() const
Return a pointer to our object.
void UpdateFile() override
Refresh the value of fDirectory (i.e.
TStreamerInfo * FindOnfileInfo(TClass *valueClass, const TObjArray &branches) const
bool SetMakeClass(bool decomposeObj=true) override
Set the branch in a mode where the object are decomposed (Also known as MakeClass mode).
void ReadLeavesClones(TBuffer &b)
Read leaves into i/o buffers for this branch.
Int_t * fBranchOffset
! Sub-Branch offsets with respect to current transient class
virtual void ResetInitInfo(bool recurse)
Reset offset and StreamerInfo information from this branch.
friend class TLeafElement
TString GetFullName() const override
Return the 'full' name of the branch.
void ReadLeavesMakeClass(TBuffer &b)
Read leaves into i/o buffers for this branch.
TBranchElement()
Default and I/O constructor.
void FillLeavesCustomStreamer(TBuffer &b)
Write leaves into i/o buffers for this branch.
virtual const char * GetClonesName() const
virtual TClass * GetClass() const
Int_t fMaximum
Maximum entries for a TClonesArray or variable array.
void ReadLeavesMemberCounter(TBuffer &b)
Read leaves into i/o buffers for this branch.
Int_t fBranchID
! ID number assigned by a TRefTable.
TLeaf * FindLeaf(const char *name) override
Find the leaf corresponding to the name 'searchname'.
TVirtualCollectionIterators * fIterators
! holds the iterators when the branch is of fType==4.
void ReleaseObject()
Delete any object we may have allocated on a previous call to SetAddress.
TClassRef fTargetClass
! Reference to the target in-memory class
void Browse(TBrowser *b) override
Browse the branch content.
void FillLeavesMemberBranchCount(TBuffer &b)
Write leaves into i/o buffers for this branch.
bool IsFolder() const override
Return true if more than one leaf, false otherwise.
virtual void SetMissing()
Set offset of the object (to which the data member represented by this branch belongs) inside its con...
TString fClonesName
Name of class in TClonesArray or (STL) collection (if any).
TBranchElement * fBranchCount
pointer to primary branchcount branch
void ReadLeavesMember(TBuffer &b)
Read leaves into i/o buffers for this branch.
Version_t fClassVersion
Version number of class.
TVirtualCollectionPtrIterators * fPtrIterators
! holds the iterators when the branch is of fType==4 and it is a split collection of pointers.
TBranchElement(const TBranchElement &)=delete
TBranch * FindBranch(const char *name) override
Find the immediate sub-branch with passed name.
void Streamer(TBuffer &) override
Stream an object of class TBranchElement.
virtual void InitInfo()
Init the streamer info for the branch class, try to compensate for class code unload/reload and schem...
virtual void InitializeOffsets()
Initialize the base class subobjects offsets of our sub-branches and set fOffset if we are a containe...
const char * GetIconName() const override
Return icon name depending on type of branch element.
TClass * GetParentClass()
Return a pointer to the parent class of the branch element.
Int_t GetExpectedType(TClass *&clptr, EDataType &type) override
Fill expectedClass and expectedType with information on the data type of the object/values contained ...
bool fInit
! Initialization flag for branch assignment
TVirtualCollectionProxy * fCollProxy
! collection interface (if any)
void SetFillActionSequence()
Set the sequence of actions needed to write the data out from the buffer.
void SetObject(void *objadd) override
Set object this branch is pointing to.
Int_t fStreamerType
branch streamer type
void ReadLeavesCollectionSplitVectorPtrMember(TBuffer &b)
Read leaves into i/o buffers for this branch.
bool GetMakeClass() const override
Return whether this branch is in a mode where the object are decomposed or not (Also known as MakeCla...
void SetFillLeavesPtr()
Set the FillLeaves pointer to execute the expected operations.
void ReadLeavesCollectionMember(TBuffer &b)
Read leaves into i/o buffers for this branch.
A branch containing and managing a TRefTable for TRef autoloading.
virtual void SetRequestedEntry(Long64_t entry)
virtual Int_t SetParent(const TObject *obj, Int_t branchID)
Set the current parent branch.
A Branch handling STL collection of pointers (vectors, lists, queues, sets and multisets) while stori...
void SetAddress(void *addr) override
Set Address.
A TTree is a list of TBranches.
virtual void ResetAddress()
Reset the address of the branch.
TString fFileName
Name of file where buffers are stored ("" if in same file as Tree header).
Int_t fEntryOffsetLen
Initial Length of fEntryOffset table in the basket buffers.
Int_t fMaxBaskets
Maximum number of Baskets so far.
FillLeaves_t fFillLeaves
! Pointer to the FillLeaves implementation to use.
virtual TString GetFullName() const
Return the 'full' name of the branch.
void(TBranch::* ReadLeaves_t)(TBuffer &b)
@ kBranchAny
Branch is an object*.
@ kBranchObject
Branch is a TObject*.
@ kDoNotProcess
Active bit for branches.
TObjArray fLeaves
-> List of leaves of this branch
char * fAddress
! Address of 1st leaf (variable or object)
TObjArray * GetListOfBranches()
virtual TList * GetBrowsables()
Returns (and, if 0, creates) browsable objects for this branch See TVirtualBranchBrowsable::FillListO...
Int_t fOffset
Offset of this branch.
Long64_t * fBasketEntry
[fMaxBaskets] Table of first entry in each basket
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all leaves of entry and return total number of bytes read.
const char * GetFileName() const
TIOFeatures GetIOFeatures() const
Returns the IO settings currently in use for this branch.
TClass * IsA() const override
Long64_t fReadEntry
! Current entry number when reading
void Print(Option_t *option="") const override
Print TBranch parameters.
TBranch * GetSubBranch(const TBranch *br) const
Find the parent branch of child.
ReadLeaves_t fReadLeaves
! Pointer to the ReadLeaves implementation to use.
void(TBranch::* FillLeaves_t)(TBuffer &b)
virtual void SetAutoDelete(bool autodel=true)
Set the automatic delete bit.
virtual TLeaf * FindLeaf(const char *name)
Find the leaf corresponding to the name 'searchname'.
Long64_t GetReadEntry() const
Long64_t GetEntries() const
Int_t fNleaves
! Number of leaves
Int_t fSplitLevel
Branch split level.
virtual void UpdateFile()
Refresh the value of fDirectory (i.e.
Int_t * fBasketBytes
[fMaxBaskets] Length of baskets on file
bool IsAutoDelete() const
Return true if an existing object in a TBranchObject must be deleted.
TObjArray fBranches
-> List of Branches of this branch
virtual void ResetAfterMerge(TFileMergeInfo *)
Reset a Branch.
virtual void ResetReadEntry()
virtual TBranch * FindBranch(const char *name)
Find the immediate sub-branch with passed name.
TBranch(const TBranch &)=delete
TDirectory * fDirectory
! Pointer to directory where this branch buffers are stored
TObjArray fBaskets
-> List of baskets of this branch
void SetIOFeatures(TIOFeatures &features)
TBranch * fMother
! Pointer to top-level parent branch in the tree.
TBranch * fParent
! Pointer to parent branch.
bool IsFolder() const override
Return true if more than one leaf or browsables, false otherwise.
virtual bool SetMakeClass(bool decomposeObj=true)
Set the branch in a mode where the object are decomposed (Also known as MakeClass mode).
Int_t fWriteBasket
Last basket number written.
Long64_t * fBasketSeek
[fMaxBaskets] Addresses of baskets on file
TObjArray * GetListOfLeaves()
Int_t fReadBasket
! Current basket number when reading
Int_t fBasketSize
Initial Size of Basket Buffer.
virtual void Reset(Option_t *option="")
Reset a Branch.
virtual void SetBasketSize(Int_t bufsize)
Set the basket size The function makes sure that the basket size is greater than fEntryOffsetlen.
Long64_t fEntryNumber
Current entry number (last one filled in this branch).
TBranch * GetMother() const
Get our top-level parent branch in the tree.
Int_t fCompress
Compression level and algorithm.
virtual Int_t FillImpl(ROOT::Internal::TBranchIMTHelper *)
Loop on all leaves of this branch to fill Basket buffer.
Long64_t fEntries
Number of entries.
virtual void SetAddressImpl(void *addr, bool, Int_t)
TTree * fTree
! Pointer to Tree header
Using a TBrowser one can browse all ROOT objects.
The concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket.
Buffer base class used for serializing objects.
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=nullptr)=0
virtual void ForceWriteInfo(TVirtualStreamerInfo *info, Bool_t force)=0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
TClassRef is used to implement a permanent reference to a TClass object.
TClass instances represent classes, structs and namespaces in the ROOT type system.
UInt_t GetCheckSum(ECheckSum code=kCurrentCheckSum) const
Call GetCheckSum with validity check.
TDataMember * GetDataMember(const char *datamember) const
Return pointer to datamember object with name "datamember".
Bool_t CanSplit() const
Return true if the data member of this TClass can be saved separately.
ROOT::ESTLType GetCollectionType() const
Return the 'type' of the STL the TClass is representing.
TVirtualStreamerInfo * GetStreamerInfoAbstractEmulated(Int_t version=0) const
For the case where the requestor class is emulated and this class is abstract, returns a pointer to t...
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Return a pointer to a newly allocated object of this class.
void CopyCollectionProxy(const TVirtualCollectionProxy &)
Replaces the collection proxy for this class.
void Destructor(void *obj, Bool_t dtorOnly=kFALSE)
Explicitly call destructor for object.
void BuildRealData(void *pointer=nullptr, Bool_t isTransient=kFALSE)
Build a full list of persistent data members.
TList * GetListOfDataMembers(Bool_t load=kTRUE)
Return list containing the TDataMembers of a class.
TList * GetListOfRealData() const
Bool_t CanIgnoreTObjectStreamer()
const ROOT::Detail::TSchemaRuleSet * GetSchemaRules() const
Return the set of the schema rules if any.
const TObjArray * GetStreamerInfos() const
Bool_t IsLoaded() const
Return true if the shared library of this class is currently in the a process's memory.
Bool_t IsTObject() const
Return kTRUE is the class inherits from TObject.
Bool_t IsForeign() const
Return kTRUE is the class is Foreign (the class does not have a Streamer method).
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0, Bool_t isTransient=kFALSE) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist,...
Bool_t InheritsFrom(const char *cl) const override
Return kTRUE if this class inherits from a class with name "classname".
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
Long_t Property() const override
Returns the properties of the TClass as a bit field stored as a Long_t value.
TVirtualStreamerInfo * GetConversionStreamerInfo(const char *onfile_classname, Int_t version) const
Return a Conversion StreamerInfo from the class 'classname' for version number 'version' to this clas...
TVirtualStreamerInfo * FindConversionStreamerInfo(const char *onfile_classname, UInt_t checksum) const
Return a Conversion StreamerInfo from the class 'classname' for the layout represented by 'checksum' ...
Bool_t IsVersioned() const
TVirtualStreamerInfo * FindStreamerInfo(TObjArray *arr, UInt_t checksum) const
Find the TVirtualStreamerInfo in the StreamerInfos corresponding to checksum.
Version_t GetClassVersion() const
TRealData * GetRealData(const char *name) const
Return pointer to TRealData element with name "name".
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
virtual void ExpandCreateFast(Int_t n)
Expand or shrink the array to n elements and create the clone objects by calling their default ctor.
TClass * GetClass() const
const char * GetName() const override
Return name of this collection.
virtual Int_t GetEntries() const
void Browse(TBrowser *b) override
Browse this collection (called by TBrowser).
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
All ROOT classes may have RTTI (run time type identification) support added.
const char * GetTypeName() const
Get the decayed type name of this data member, removing const and volatile qualifiers,...
Basic data type descriptor (datatype information is obtained from CINT).
Describe directory structure in memory.
virtual Int_t WriteTObject(const TObject *obj, const char *name=nullptr, Option_t *="", Int_t=0)
virtual TFile * GetFile() const
virtual Bool_t IsWritable() const
A class to pass information from the TFileMerger to the objects being merged.
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
Int_t GetCompressionSettings() const
void SetLeafCount(TLeaf *leaf) override
Set the leaf count of this leaf.
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
virtual Int_t GetMaximum() const
virtual void SetAddress(void *add=nullptr)
virtual Int_t GetLenStatic() const
Return the fixed length of this leaf.
virtual void SetRange(bool range=true)
void Add(TObject *obj) override
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
virtual void SetName(const char *name)
Set the name of the TNamed.
Int_t GetEntriesFast() const
Int_t IndexOf(const TObject *obj) const override
TObject ** GetObjectRef() const
Int_t GetEntries() const override
Return the number of objects in array (i.e.
TObject * At(Int_t idx) const override
TObject * UncheckedAt(Int_t i) const
TObject * FindObject(const char *name) const override
Find an object in this collection using its name.
void Add(TObject *obj) override
friend class TClonesArray
Bool_t TestBit(UInt_t f) const
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual TObject * FindObject(const char *name) const
Must be redefined in derived classes.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
virtual TClass * IsA() const
TObject()
TObject constructor.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
The TRealData class manages the effective list of all data members for a given class.
Long_t GetThisOffset() const
const char * GetCountName() const
Describe one element (data member) to be Streamed.
virtual const char * GetFullName() const
Return element name including dimensions, if any Note that this function stores the name into a stati...
virtual TClass * GetClassPointer() const
Returns a pointer to the TClass of this element and updates fClassObject.
TClass * GetNewClass() const
void ls(Option_t *option="") const override
Print the content of the element.
virtual Bool_t IsTransient() const
Return kTRUE if the element represent an entity that is not written to the disk (transient members,...
virtual Bool_t IsaPointer() const
const char * GetTypeName() const
virtual Bool_t CannotSplit() const
Returns true if the element cannot be split, false otherwise.
TClass * GetClass() const
TClass * IsA() const override
const char * GetTypeNameBasic() const
Return type name of this element in case the type name is not a standard basic type,...
virtual Bool_t IsBase() const
Return kTRUE if the element represent a base class.
static SequencePtr WriteMemberWiseActionsViaProxyGetter(TStreamerInfo *, TVirtualCollectionProxy *collectionProxy, TClass *)
static SequencePtr WriteMemberWiseActionsGetter(TStreamerInfo *info, TVirtualCollectionProxy *, TClass *)
static SequencePtr ConversionReadMemberWiseActionsViaProxyGetter(TStreamerInfo *info, TVirtualCollectionProxy *collectionProxy, TClass *originalClass)
static SequencePtr WriteMemberWiseActionsCollectionCreator(TStreamerInfo *info, TVirtualCollectionProxy *collectionProxy, TClass *)
static SequencePtr ReadMemberWiseActionsCollectionCreator(TStreamerInfo *info, TVirtualCollectionProxy *collectionProxy, TClass *)
static SequencePtr ReadMemberWiseActionsGetter(TStreamerInfo *info, TVirtualCollectionProxy *, TClass *)
SequencePtr(*)(TStreamerInfo *info, TVirtualCollectionProxy *collectionProxy, TClass *originalClass) SequenceGetter_t
static SequencePtr WriteMemberWiseActionsCollectionGetter(TStreamerInfo *info, TVirtualCollectionProxy *, TClass *)
ActionContainer_t fActions
TActionSequence * CreateSubSequence(const std::vector< Int_t > &element_ids, size_t offset)
static SequencePtr ReadMemberWiseActionsCollectionGetter(TStreamerInfo *info, TVirtualCollectionProxy *, TClass *)
void AddToOffset(Int_t delta)
static SequencePtr ReadMemberWiseActionsViaProxyGetter(TStreamerInfo *info, TVirtualCollectionProxy *collectionProxy, TClass *)
Base class of the Configurations.
TVirtualStreamerInfo * fInfo
TStreamerInfo form which the action is derived.
UInt_t fElemId
Identifier of the TStreamerElement.
Describes a persistent version of a class.
Int_t GetClassVersion() const override
TStreamerElement * GetElement(Int_t id) const override
T GetTypedValue(char *pointer, Int_t i, Int_t j, Int_t len) const
Return value of element i in object at pointer.
void ls(Option_t *option="") const override
List the TStreamerElement list and also the precomputed tables if option contains the string "incOrig...
Int_t GetNelement() const
void PrintValue(const char *name, char *pointer, Int_t i, Int_t len, Int_t lenmax=1000) const
print value of element i in object at pointer The function may be called in two ways: -method1 len < ...
T GetTypedValueSTLP(TVirtualCollectionProxy *cont, Int_t i, Int_t j, Int_t k, Int_t eoffset) const
Return value of element i in object number j in a pointer to STL container and eventually element k i...
T GetTypedValueSTL(TVirtualCollectionProxy *cont, Int_t i, Int_t j, Int_t k, Int_t eoffset) const
Return value of element i in object number j in an STL container and eventually element k in a sub-ar...
TClass * GetClass() const override
T GetTypedValueClones(TClonesArray *clones, Int_t i, Int_t j, Int_t k, Int_t eoffset) const
void PrintValueSTL(const char *name, TVirtualCollectionProxy *cont, Int_t i, Int_t eoffset, Int_t lenmax=1000) const
Print value of element i in an STL container.
TObjArray * GetElements() const override
UInt_t GetCheckSum() const override
void PrintValueClones(const char *name, TClonesArray *clones, Int_t i, Int_t eoffset, Int_t lenmax=1000) const
Print value of element i in a TClonesArray.
const char * GetCountName() const
static constexpr Ssiz_t kNPOS
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
TString & Replace(Ssiz_t pos, Ssiz_t n, const char *s)
Ssiz_t First(char c) const
Find first occurrence of a character c.
const char * Data() const
Ssiz_t Last(char c) const
Find last occurrence of a character c.
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
TString & Remove(Ssiz_t pos)
TString & Append(const char *cs)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
void Draw(Option_t *opt) override
Default Draw method for all objects.
@ kSplitCollectionOfPointers
ROOT::TIOFeatures GetIOFeatures() const
Returns the current set of IO settings.
Wrapper around an object and giving indirect access to its content even if the object is not of a cla...
Small helper class to generically acquire and release iterators.
RAII helper class that ensures that PushProxy() / PopProxy() are called when entering / leaving a C++...
Defines a common interface to inspect/change the contents of an object that represents a collection.
virtual Int_t GetProperties() const
Return miscallenous properties of the proxy (see TVirtualCollectionProxy::EProperty).
virtual void Destructor(void *p, Bool_t dtorOnly=kFALSE) const
Execute the container destructor.
virtual EDataType GetType() const =0
If the value type is a fundamental data type, return its type (see enumeration EDataType).
@ kNeedDelete
The collection contains directly or indirectly (via other collection) some pointers that need explici...
virtual void Clear(const char *opt="")=0
Clear the container.
virtual void * New() const
Construct a new container object and return its address.
virtual TClass * GetValueClass() const =0
If the value type is a user-defined class, return a pointer to the TClass representing the value type...
virtual void Commit(void *)=0
Commits pending elements in a staging area (see Allocate() for more information).
virtual void * At(UInt_t idx)=0
Return the address of the value at index idx.
virtual Int_t GetCollectionType() const =0
Return the type of the proxied collection (see enumeration TClassEdit::ESTLType).
virtual UInt_t Size() const =0
Return the current number of elements in the container.
virtual TVirtualCollectionProxy * Generate() const =0
Returns a clean object of the actual class that derives from TVirtualCollectionProxy.
virtual void * Allocate(UInt_t n, Bool_t forceDelete)=0
Allocates space for storing at least n elements.
virtual Bool_t HasPointers() const =0
Return true if the content is of type 'pointer to'.
virtual TClass * GetCollectionClass() const
Return a pointer to the TClass representing the proxied container class.
Abstract Interface class describing Streamer information for one class.
Bool_t IsCompiled() const
virtual UInt_t GetCheckSum() const =0
@ kUChar
Equal to TDataType's kchar.
virtual TStreamerElement * GetElement(Int_t id) const =0
virtual TObjArray * GetElements() const =0
virtual Int_t GetClassVersion() const =0
virtual TClass * GetClass() const =0
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
std::vector< TIDNode > TIDs