Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixes in DataLoader::GetInputVariableHist
  • Loading branch information
qati committed May 26, 2016
commit 5fb9facc6a4fc08f072dfd3baef69757a765f7f3
14 changes: 11 additions & 3 deletions tmva/tmva/src/DataLoader.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -762,21 +762,29 @@ TH1F* TMVA::DataLoader::GetInputVariableHist(const TString& className, const TSt
}

const std::vector<Event*>& inputEvents = dsinfo.GetDataSet()->GetEventCollection();

const std::vector<Event*>* transformed = nullptr, *tmp = nullptr;
//FIXME CalcTransformations calls PlotVariables: in my opinion here we shouldn't call that method
std::vector<TMVA::TransformationHandler*>::iterator trfIt;
for(trfIt=trfs.begin(); trfIt != trfs.end(); trfIt++){
inputEvents = (*trfIt)->CalcTransformations(inputEvents);
if (transformed==nullptr){
transformed = (*trfIt)->CalcTransformations(inputEvents);
} else {
tmp = (*trfIt)->CalcTransformations(*transformed);
delete transformed;
transformed = tmp;
}
}
for(trfIt = trfs.begin(); trfIt != trfs.end(); trfIt++) delete *trfIt;


const Event* event;
for(Int_t i=0;i<ds->GetNEvents();i++){
event = inputEvents[i];
event = (*transformed)[i];
if (event->GetClass() != clsn) continue;
h->Fill(event->GetValue(ivar));
}
for(auto it = transformed->begin();it!=transformed->end();++it) delete *it;
delete transformed;
return h;
}

Expand Down