# TMVA - unwanted prefix to fWeightFileDir

**URL:** <https://root-forum.cern.ch/t/tmva-unwanted-prefix-to-fweightfiledir/22429>\
**Category:** TMVA\
**Created:** [January 3, 2017, 4:15pm UTC](https://root-forum.cern.ch/t/tmva-unwanted-prefix-to-fweightfiledir/22429 "2017-01-03T16:15:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sadeh](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/9de053/32.png) [@sadeh](https://root-forum.cern.ch/u/sadeh)\
**Post date:** [January 3, 2017, 4:15pm UTC](https://root-forum.cern.ch/t/tmva-unwanted-prefix-to-fweightfiledir/22429/1 "2017-01-03T16:15:47Z")

</div>

Dear developers,

Thanks for all of the improvements to TMVA!  
In the version, in ROOT v6.8, we have in src/Factory.cxx, the following:

```auto
       fFileDir=loader->GetName();
       fFileDir+="/"+gConfig().GetIONames().fWeightFileDir;
```

[root.cern.ch/doc/v608/tmva\_2tmv … tml#l00384](https://root.cern.ch/doc/v608/tmva_2tmva_2src_2Factory_8cxx_source.html#l00384)  
(Similarly, this affects l675 in MethodBoost.cxx and l205 in MethodCompositeBase.cxx).

This sets the name of the TMVA::DataLoader as a prefix for the directory name of the output xml.

This new feature is not always wanted, as generally, codes dependent on TMVA might need to explicitly control the location of the derived xml file, e.g., by manipulating gConfig().GetIONames().fWeightFileDir .

I would like to request a modification, which could be one of the following two (or something in this spirit):  
(1). Change this to:

```auto
       fFileDir = gConfig().GetIONames().fWeightFileDir + "/" + loader->GetName();
```

(postfix instead of prefix)

(2). Add a job option to TMVA::DataLoader which would allow to define a prefix by hand, or to just avoid the prefix altogether, i.e., something like:

```auto
      fFileDir="";
      if(loader->UseWeightFileDirPrefix()) {
         fFileDir=loader->GetName()+"/";
      }
      fFileDir+=gConfig().GetIONames().fWeightFileDir;
   }
```

The user can then for instance, set the UseWeightFileDirPrefix to false and return to the expected behavior from previous releases of TMVA.

Thanks,

Iftach.

---

<div class="post-metadata">

**Author:** ![moneta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/moneta/32/19423_2.png) [@moneta](https://root-forum.cern.ch/u/moneta)\
**Post date:** [January 10, 2017, 2:40pm UTC](https://root-forum.cern.ch/t/tmva-unwanted-prefix-to-fweightfiledir/22429/2 "2017-01-10T14:40:52Z")

</div>

Hi ,

Thank you for your suggestion. We will think about to examine what could be the best solution for this problem.

Best Regards

Lorenzo
