Passing variable type 'double' to TMVA::Reader::AddVariable

Hi all,

I’ve noticed an annoying inconsistency in the variable types accepted by the methods TMVA::factory::AddVariable() and TMVA::Reader::AddVariable(). While the former accepts variables of type ‘double’, the latter does not.

I know this limitation of TMVA::Reader::AddVariable() is stated in the caption corresponding to Code Example 22 in the TMVA User Guide http://tmva.sourceforge.net/docu/TMVAUsersGuide.pdf, but it seems like a major short coming to me since while I can import variables of type double from my nTuple to train a MVA method with the TMVA::Factory, I can not then import variables of the same data type from an identical nTulpe to evaluate the MVA response through TMVA::Reader::AddVariable().

It seems that I can get around this by either using the standalone C++ class generated during the training as shown in Code Example 29, or by explicitly casting all my variables in memory to floats. It would be much more convenient though if the TMVA::Reader::AddVariable() interface could be made to accept variables of type double. Is there any reason why this can’t be done?

Many thanks.

Andrew

2 Likes