250 if (!fDirector->GetTree()) {
253 if (!fNotify.IsLinked()) {
254 fNotify.PrependLink(*fDirector->GetTree());
258 if (!fParent->Setup()) {
268 Int_t i = fDirector->GetReadEntry();
269 if (i<0) fDirector->SetReadEntry(0);
270 if (fParent->Read()) {
271 if (i<0) fDirector->SetReadEntry(i);
278 }
else if (
pcl->GetCollectionProxy()) {
281 if (fCollection)
delete fCollection;
282 fCollection =
pcl->GetCollectionProxy()->Generate();
283 pcl = fCollection->GetValueClass();
284 if (
pcl ==
nullptr) {
286 Error(
"Setup",
"Not finding TClass for collection for the data member %s seems no longer be in class %s",fDataMember.Data(),fParent->GetClass()->GetName());
291 fElement = (
TStreamerElement*)
pcl->GetStreamerInfo()->GetStreamerElement(fDataMember, fOffset);
293 fIsaPointer = fElement->IsaPointer();
294 fClass = fElement->GetClassPointer();
295 fMemberOffset = fElement->GetOffset();
296 fArrayLength = fElement->GetArrayLength();
299 Error(
"Setup",
"Data member %s seems no longer be in class %s",fDataMember.Data(),
pcl->GetName());
305 fWhere = fParent->fWhere;
307 if (fParent->IsaPointer()) {
321 fBranch = fDirector->GetTree()->GetBranch(fBranchName.Data());
323 if (!fSuppressMissingBranchError && !
AreThereSubBranches(fBranchName.View(), *fDirector->GetTree())) {
330 auto *tree = fDirector->GetTree()->GetTree();
331 Error(
"TBranchProxy::Setup()",
"%s",
332 Form(
"Branch '%s' is not available from tree '%s' in file '%s'.", fBranchName.Data(),
339 fWhere = (
double*)fBranch->GetAddress();
346 be->GetMother()->SetAddress(
nullptr);
347 fWhere = (
double*)fBranch->GetAddress();
352 if (fDataMember.Length()) {
353 leaf2 = fBranch->GetLeaf(fDataMember);
354 }
else if (!fWhere) {
355 leaf2 = (
TLeaf*)fBranch->GetListOfLeaves()->At(0);
356 fWhere =
leaf2->GetValuePointer();
359 fWhere =
leaf2->GetValuePointer();
360 fArrayLength =
leaf2->GetLen();
362 if (
leaf2->GetLeafCount()) {
363 fLeafCount =
leaf2->GetLeafCount();
364 fHasLeafCount =
true;
379 fWhere = (
double*)fBranch->GetAddress();
389 if (
be->GetType() == 3) {
390 fClassName =
"TClonesArray";
393 fOffset =
info->GetElementOffset(
id);
395 fIsaPointer = fElement->IsaPointer();
396 fClass = fElement->GetClassPointer();
399 if ((fIsMember || (
be->GetType()!=3 &&
be->GetType() !=4))
400 && (
be->GetType()!=31 &&
be->GetType()!=41)) {
403 Int_t i =
be->GetTree()->GetReadEntry();
408 if ( fIsMember &&
be->GetType()==3 ) {
410 }
else if (fIsaPointer) {
415 if (!fIsMember) fIsClone =
true;
419 fCollection =
fClass->GetCollectionProxy()->Generate();
420 fClass = fCollection->GetValueClass();
426 fClassName =
be->GetClassName();
430 if (
be->GetType()==3) {
433 if (!fIsMember) fIsClone =
true;
435 fWhere =
be->GetObject();
437 }
else if (
be->GetType()==4) {
440 fCollection =
be->GetCollectionProxy()->Generate();
442 fWhere =
be->GetObject();
448 fWhere =
be->GetObject();
450 }
else if (
be->GetType()==41) {
452 fCollection =
be->GetCollectionProxy()->Generate();
453 fWhere =
be->GetObject();
454 fOffset +=
be->GetOffset();
456 }
else if (
be->GetType()==31) {
458 fWhere =
be->GetObject();
459 fOffset +=
be->GetOffset();
461 }
else if (
be->GetType()==2) {
464 fWhere =
be->GetObject();
469 fWhere = ((
unsigned char*)
be->GetObject()) + fOffset;
474 fClassName = fBranch->GetClassName();
477 fClassName = fBranch->GetClassName();
523 if (fMemberOffset < 0) {
524 Error(
"Setup",
"%s",
Form(
"Negative offset %d for %s in %s",
525 fMemberOffset,fBranch->
GetName(),
530 Form(
"Missing data member in a TClonesArray, %s in %s and %s", fDataMember.Data(),
535 }
else if (fParent &&
fClass) {
538 fClass->GetStreamerInfo()->GetElements()->FindObject(fDataMember);
540 fMemberOffset = fElement->GetOffset();
550 if (fMemberOffset < 0) {
552 Form(
"Negative offset %d for %s in %s, class: %s", fMemberOffset, fDataMember.Data(),
557 Form(
"Missing data member %s in %s, class: %s", fDataMember.Data(), fBranch->
GetName(),
567 Error(
"Setup",
"%s",
Form(
"Missing TClass object for %s", fClassName.Data()));
573 fOffset = fMemberOffset;
577 fWhere = ((
unsigned char*)fWhere) + fMemberOffset;
582 if (fWhere!=
nullptr) {