Menu

#14 Integers with Reader::AddVariable()

HEAD
open
nobody
General (13)
7
2009-12-30
2009-12-30
No

The passing of inteegers to the reader does not work as described in the user's manual.
Code example 30 (manual, page 33) is wrong.

The reader in version 4.0.x actually expects all variables to be provided as floats.

The correct example 30 is therefore as follows:

Int_t localDiscreteVar;
Float_t localFloatCopyOfDiscreteVar, localFloatingVar, locaSum, localVar3;
reader->AddVariable( "<YourDiscreteVar>", &localFloatCopyOfDiscreteVar );
reader->AddVariable( "log(<YourFloatingVar>)", &localFloatingVar );
reader->AddVariable( "SumLabel := <YourVar1>+<YourVar2>", &locaSum );
reader->AddVariable( "<YourVar3>", &localVar3 );

Within the event loop the int variable needs to be copied to the float variable.

// begin event loop

localFloatCopyOfDiscreteVar=localDiscreteVar;
reader->EvaluateMVA(...);

// end event loop

Discussion


Log in to post a comment.

MongoDB Logo MongoDB