Can the Factory output root file NOT store the TTrees?

Hi, is there a way to prevent the output file used in TMVA Factory from storing the train/test events in TTrees?

I’m trying to optimise the BDT parameters using a grid scan so I’m running about ~350 jobs and in each one I have about 7.5 million events. The output files are about 880 MB so I’m struggling to store everything. I would like to keep the histograms and correlation matrices but I don’t really need the TTrees.


Hi Julia,

Let me check with @swunsch and @moneta - maybe they know?

Cheers, Axel.

Hi ,
You can avoid writing the output trees, but in that case it will also not write the histograms and correlation matrices. I don’t think it is possible to avoid only the writing of the trees. This is maybe an option we could consider to add in a future release.
To avoid writing the output , just pass a nullptr when constructing the Factory class. Here is an example code:

 TFile * outputFile = nullptr;
 if (writeFile) outputFile = TFile::Open( outfileName, "RECREATE" );

 // Creating the factory object
 TMVA::Factory *factory = new TMVA::Factory( "TMVAClassification", outputFile, "AnalysisType=Classification" );