# Problem withSetBranchAddress after Classification

**URL:** <https://root-forum.cern.ch/t/problem-withsetbranchaddress-after-classification/39747>\
**Category:** TMVA\
**Created:** [June 4, 2020, 7:44am UTC](https://root-forum.cern.ch/t/problem-withsetbranchaddress-after-classification/39747 "2020-06-04T07:44:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![WilliamK](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/w/90ced4/32.png) [@WilliamK](https://root-forum.cern.ch/u/WilliamK)\
**Post date:** [June 4, 2020, 7:44am UTC](https://root-forum.cern.ch/t/problem-withsetbranchaddress-after-classification/39747/1 "2020-06-04T07:44:23Z")

</div>

Dear experts,  
I successfully performed classification with TMVA. In between the variables of the classfication are variables called e.g ‘bjet.Pt()’ where bjet is a TLorentzVector.  
Now that I want to apply my classification, I am following the tutorials to set up the reader and the trees but when I call

```auto
Float_t bjet_pt;
myTree->SetBranchAddress("bjet.Pt()", &bjet_pt);

```

I get this error:

```auto
Error in <TTree::SetBranchAddress>: unknown branch -> bjet.Pt()

```

Can anybody help me avoiding/correcting this? From my understanding it is ok to call as a string “bjet.Pt()” in the AddVariable method, but not when you want to set the address of the branch. Still I cannot figure out how to avoid doing this.

Thanks for your help,

William.

---

<div class="post-metadata">

**Author:** ![dastudillo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dastudillo/32/17280_2.png) [@dastudillo](https://root-forum.cern.ch/u/dastudillo)\
**Post date:** [June 4, 2020, 8:06am UTC](https://root-forum.cern.ch/t/problem-withsetbranchaddress-after-classification/39747/2 "2020-06-04T08:06:58Z")

</div>

I haven’t used TLorentzVectors, but I suppose what’s stored in the tree is a TLorentzVector, so this may work:

```auto
Double_t bjetpt;
TLorentzVector bjet;
myTree->SetBranchAddress("bjet", &bjet);

```

And then when you need pt, do `ptjet = bjet.Pt()`
