# Adding a new branch such that invariant mass that not exist in DelphesTree

**URL:** <https://root-forum.cern.ch/t/adding-a-new-branch-such-that-invariant-mass-that-not-exist-in-delphestree/62301>\
**Category:** TMVA\
**Tags:** tree\
**Created:** [November 24, 2024, 8:19am UTC](https://root-forum.cern.ch/t/adding-a-new-branch-such-that-invariant-mass-that-not-exist-in-delphestree/62301 "2024-11-24T08:19:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ahmed\_Sayed](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ahmed_sayed/32/31955_2.png) [@Ahmed\_Sayed](https://root-forum.cern.ch/u/Ahmed_Sayed)\
**Post date:** [November 24, 2024, 8:19am UTC](https://root-forum.cern.ch/t/adding-a-new-branch-such-that-invariant-mass-that-not-exist-in-delphestree/62301/1 "2024-11-24T08:19:01Z")

</div>

Hello Dr @moneta ,  
I use TMVA to fit input data as tree.root.the tree is Delphes .But according to the defined  
Branches and varaibles within headerfile (tree=Delphes) ,not all branches are exist .Another meaning if i want to add a new branch such that the invariant mass that not exist in header file .Is i create a new tree to clone the old tree and modify it to add a new brach ? .This is my suggested idea or is there another way?.Could you clarify this issue with an attached example?

Thanks  
Ahmed

[treeAnalysis.C](https://root-forum.cern.ch/uploads/short-url/tDvZOgf3bUioLUXzA4ziSJPJP4Q.C) (9.6 KB)  
[treeAnalysis.h](https://root-forum.cern.ch/uploads/short-url/r6g2Bf8LQfoGO89XkfsFFsviUmg.h) (83.0 KB)  
[SetupTMVA.C](https://root-forum.cern.ch/uploads/short-url/kM9CZlBiKIbFDWWy1KTCDu3toaL.C) (5.6 KB)

---

<div class="post-metadata">

**Author:** ![Danilo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/danilo/32/34528_2.png) [@Danilo](https://root-forum.cern.ch/u/Danilo)\
**Post date:** [November 24, 2024, 1:53pm UTC](https://root-forum.cern.ch/t/adding-a-new-branch-such-that-invariant-mass-that-not-exist-in-delphestree/62301/2 "2024-11-24T13:53:27Z")

</div>

Hi Ahmed,

Waiting for @moneta to reply, I must confess it is not clear to me what exactly you want to achieve.  
Are you aiming to add a transient column to your dataset? Have you tried the [ROOT: ROOT::RDataFrame Class Reference](https://root.cern/doc/master/classROOT_1_1RDataFrame.html) class and its `Define` method?

Best,  
D

---

<div class="post-metadata">

**Author:** ![Ahmed\_Sayed](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ahmed_sayed/32/31955_2.png) [@Ahmed\_Sayed](https://root-forum.cern.ch/u/Ahmed_Sayed)\
**Post date:** [November 28, 2024, 1:29pm UTC](https://root-forum.cern.ch/t/adding-a-new-branch-such-that-invariant-mass-that-not-exist-in-delphestree/62301/3 "2024-11-28T13:29:29Z")

</div>

Hello Dr @Danilo ,

No,I mean adding a new branch from a new tree except the old Tree (Delphes) that not  
Contain all branches and variables.How much  
Time to reply on my question?

Thanks  
Ahmed

---

<div class="post-metadata">

**Author:** ![Ahmed\_Sayed](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ahmed_sayed/32/31955_2.png) [@Ahmed\_Sayed](https://root-forum.cern.ch/u/Ahmed_Sayed)\
**Post date:** [November 30, 2024, 9:24am UTC](https://root-forum.cern.ch/t/adding-a-new-branch-such-that-invariant-mass-that-not-exist-in-delphestree/62301/4 "2024-11-30T09:24:00Z")

</div>

Hello root\_TMVA experts,

Is there a solution for my issue?

Thanks  
Ahmed
