[TMVA] Category

Hi!

I am trying the Category classifier out, and it trains fine (I defined 4 BDT categories) but I cannot succsessfully run the Application part, i.e. I am unable compute the discriminant for extra datasets. I am getting the warning “Event does not lie within the cut of any sub-classifier” for every event in the dataset. I checked explpicitely, and that is not true, for example this event must be in one of the categories:

leptonSumMass = 128.172
nJets         = 3
nBTag         = 1
nLeptons      = 3
isMuon1       = -13
isMuon2       = -13
isMuon3       = 0
isMuon4       = 0
--- <WARNING> Category                 : Event does not lie within the cut of any sub-classifier.

I can give more specifics but I wonder if perhaps there is some piece of known lore that I’m obviously missing? As far as I can tell, I follow the procedure in TMVAClassificationCategoryApplication.C

Hi!

Here are the data and the code that reproduce the problem. The weights.tgz file contains the gzipped directory with the weights, the other three files are the application macro, the TCuts, and the necessary data.

In root:

.L TMVAClassificationApplication.C+
TMVAClassificationApplication(“Category”);

I only left here a single category, for simplicity, the cuts for it are (nLeptons>2&&nJets>=3). You can see from the printout that all the values are present and have such values that would pass the events yet TMVA reports a warning that the events do not lie within and category.

Could the developers take a look? This is really frustrating.

Thanks!
Gena
TMVA_tprime_cuts.C (639 Bytes)
weights.tgz (158 KB)
all.root (2 MB)
TMVAClassificationApplication.C (9.59 KB)

Hello Gena,

o.k. finally … although I should have “known” … the problem is that - just like for all the other
variables - the TMVA Reader (different from the Factory) only can deal with FLOATs … and as you’ve supplied the nLeptons and nJets variables as “INT”, it get’s screwed up

I agree… that’s a very unfortunate shortcoming, but actually quite some effort to change in the code.
Hence, for the moment, what you have to do is to define for each “Integer” variable in the tree which
you give to TMVA::Reader, a float and copy…

e.g.:
Float_t nBTagFloat;
Float_t nJetsFloat;
Float_t nLeptonsFloat;
reader->AddSpectator( “nBTag”, &nBTagFloat );
reader->AddSpectator( “nJets”, &nJetsFloat );
reader->AddSpectator( “nLeptons”, &nLeptonsFloat );

and then fill those variables in the event loop:

  theTree->GetEntry(pEvtList->GetEntry(ievt));

  nBTagFloat=(Float_t)nBTag;
  nJetsFloat=(Float_t)nJets;
  nLeptonsFloat=(Float_t)nLeptons;

Then it works… (have a look also at the ‘fixed’ script in the attachment)

sorry for the inconvenience !

Helge
TMVAClassificationApplication.C (10.4 KB)

Thanks!