# SetBranchStatus - third flag?

**URL:** <https://root-forum.cern.ch/t/setbranchstatus-third-flag/64531>\
**Category:** Evolution Proposals, Apps & Ideas\
**Created:** [December 10, 2025, 11:35am UTC](https://root-forum.cern.ch/t/setbranchstatus-third-flag/64531 "2025-12-10T11:35:41Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![pcanal](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pcanal/32/12439_2.png) [@pcanal](https://root-forum.cern.ch/u/pcanal)\
**Post date:** [June 16, 2026, 5:36pm UTC](https://root-forum.cern.ch/t/setbranchstatus-third-flag/64531/6 "2026-06-16T17:36:36Z")

</div>

```auto
auto child = tree->GetBranch(unwanted_branch_name);
auto parent = child->GetMother()->GetSubBranch(child);
parent->GetListOfBranches()->Remove(child);
parent->GetListOfBranches()->Compress();

```

Note that if you have a chain, you need to execute this at each file boundary, so you would also need attach a `notify` action to the chain. (See [ROOT: TNotifyLink\< Type \> Class Template Reference](https://root.cern.ch/doc/PR/html/classTNotifyLink.html) and See also the doc of [TChain::LoadTree](https://root.cern.ch/doc/master/classTChain.html#ab6cae493037968229cfff713a3d86844) for an explanation on the usage of the notify object by the chain and [TTreeReader TChain notify on change of file - #5 by zhubacek](https://root-forum.cern.ch/t/ttreereader-tchain-notify-on-change-of-file/58244/5))

---

_[View the full topic](https://root-forum.cern.ch/t/setbranchstatus-third-flag/64531)._
