Skip to content

Commit

Permalink
[tmva] move check to proper place, after create-assign trees
Browse files Browse the repository at this point in the history
  • Loading branch information
ferdymercury authored and dpiparo committed Nov 26, 2024
1 parent 6a2581a commit 6b29dfe
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tmva/tmva/src/DataLoader.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -277,13 +277,6 @@ void TMVA::DataLoader::AddTestEvent( const TString& className, const std::vector
void TMVA::DataLoader::AddEvent( const TString& className, Types::ETreeType tt,
const std::vector<Double_t>& event, Double_t weight )
{
if (event.size() > fATreeEvent.size()) {
Error("TMVA::DataLoader::AddEvent", "Number of variables defined through DataLoader::AddVariable (%zu) is inconsistent"
"with number of variables given to DataLoader::Add*Event (%zu)."
"Please check your variable definitions and statement ordering."
"This event will not be added.", fATreeEvent.size(), event.size());
return;
}
ClassInfo* theClass = DefaultDataSetInfo().AddClass(className); // returns class (creates it if necessary)
UInt_t clIndex = theClass->GetNumber();

Expand All @@ -305,6 +298,13 @@ void TMVA::DataLoader::AddEvent( const TString& className, Types::ETreeType tt,

fATreeType = clIndex;
fATreeWeight = weight;
if (event.size() > fATreeEvent.size()) {
Error("TMVA::DataLoader::AddEvent", "Number of variables defined through DataLoader::AddVariable (%zu) is inconsistent"
"with number of variables given to DataLoader::Add*Event (%zu)."
"Please check your variable definitions and statement ordering."
"This event will not be added.", fATreeEvent.size(), event.size());
return;
}
for (UInt_t ivar=0; ivar<event.size(); ivar++) fATreeEvent[ivar] = event[ivar];

if(tt==Types::kTraining) fTrainAssignTree[clIndex]->Fill();
Expand Down

0 comments on commit 6b29dfe

Please sign in to comment.