# TMVA vextor data immport

**URL:** <https://root-forum.cern.ch/t/tmva-vextor-data-immport/22255>\
**Category:** TMVA\
**Created:** [November 24, 2016, 8:02am UTC](https://root-forum.cern.ch/t/tmva-vextor-data-immport/22255 "2016-11-24T08:02:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yubo](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/y/d9b06d/32.png) [@Yubo](https://root-forum.cern.ch/u/Yubo)\
**Post date:** [November 24, 2016, 8:02am UTC](https://root-forum.cern.ch/t/tmva-vextor-data-immport/22255/1 "2016-11-24T08:02:30Z")

</div>

in my tree, there is 3 vector leaves: vextorx; vextory; vextorz; which means the detecor hit information of tracks of a singal event.

I want to train them by TMVA. How can I import the vector to TMVAfactory?

Thank you very much!

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [November 24, 2016, 9:03am UTC](https://root-forum.cern.ch/t/tmva-vextor-data-immport/22255/2 "2016-11-24T09:03:14Z")

</div>

The TMVA manual does not give the answer ?

[root.cern.ch/root-user-guides-and-manuals](https://root.cern.ch/root-user-guides-and-manuals)

---

<div class="post-metadata">

**Author:** ![Yubo](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/y/d9b06d/32.png) [@Yubo](https://root-forum.cern.ch/u/Yubo)\
**Post date:** [November 25, 2016, 6:06am UTC](https://root-forum.cern.ch/t/tmva-vextor-data-immport/22255/3 "2016-11-25T06:06:20Z")

</div>

[quote=“couet”]The TMVA manual does not give the answer ?

[root.cern.ch/root-user-guides-and-manuals](https://root.cern.ch/root-user-guides-and-manuals)[/quote]

I saw the manual， but I cannot know whether I can import a vector variable by “AddVariable()”. In fact, I can use TMVA without problem when I import non-vector variable, but when I import vector variable, the TMVA didn’t work properly.

For detail：  
when I fill root tree, I use:  
////////////////////////////////////////  
vector x[n] = 0;  
for(int i = 0; i\<n ; i++){  
x[i] = var;  
}  
Tree -\> Fill();  
//////////////////////////////////////////

```
                  when I import the vactor variable:
                  ///////////////////////////////////////////
                  factory->AddVariable( "x", "Variable 1", "units", 'D' );
                  ///////////////////////////////////////////

```

May be we cannot improt vector variable into TMVA?

---

<div class="post-metadata">

**Author:** ![sergei](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/e495f1/32.png) [@sergei](https://root-forum.cern.ch/u/sergei)\
**Post date:** [December 12, 2016, 5:11am UTC](https://root-forum.cern.ch/t/tmva-vextor-data-immport/22255/4 "2016-12-12T05:11:27Z")

</div>

Hi,

The AddVariable() expects a single variable as input. So you would need to explicitly set these.

Cheers,

Sergei
