Training and Testing separate ntuples

Dear experts,

I am doing a multivariate classification and I would like to know only if I am operating in the right way. For the classification I am using two different ntuples for signal training and testing (both having 30000 events) and one ntupla for background that should be splitted in half for training and testing.

I am operating in this way (considering only crucial lines):

TFile * Signal_Train = TFile::Open(...);
TFile * Signal_Test  = TFile::Open(...);
TFile * Background   = TFile::Open(...);

TCut mycutS = ""; //NO cuts
TCut mycutB = "cut";
dataloader->AddTree(Signal_Train->Get<TTree>("..."), "Signal", 1.0, mycutS,TMVA::Types::kTraining);
dataloader->AddTree(Signal_Test ->Get<TTree>("..."), "Signal", 1.0, mycutS, TMVA::Types::kTesting);

TTree* backgroundTree = (TTree*)Background  ->Get("...");
dataloader->AddBackgroundTree(backgroundTree, backgroundWeight);

//remembering that: 
//signal training and testing ntuplas have 30000 events; background ntupla should be splitted in half:
dataloader->PrepareTrainingAndTestTree(mycutS, mycutB, "nTrain_Signal=30000:nTrain_Background=0:nTest_Signal=30000:nTest_Background=0:SplitMode=Random:NormMode=NumEvents:!V");

Could you please warn me if I am doing some errors somehwere?

Thank you a lot for any kind of help/suggestion
Francesco

I guess @moneta can help.

Thank you @couet @moneta for any suggestion

Hi,
TMVA normally automatically splits your signal and background data in training and test data. In your code above you are giving too TMVA your both signal training and test tree as signal tree. TMVA will split them randomly, according to the option you passed in PrepapreTrainingAndTestTree. Same thing will happen for the background. If this is what you want then the code is correct.
If you want absolutely to split according to the two trees, I think you should use MixMode=Block, but the same splitting will happen also for the Background data.

Lorenzo