diff --git a/roofit/roofitcore/src/RooTreeDataStore.cxx b/roofit/roofitcore/src/RooTreeDataStore.cxx index 43117bbfbf140..e4a8a5805e1ac 100644 --- a/roofit/roofitcore/src/RooTreeDataStore.cxx +++ b/roofit/roofitcore/src/RooTreeDataStore.cxx @@ -514,8 +514,15 @@ void RooTreeDataStore::loadValues(const TTree *t, const RooFormulaVar* select, c numInvalid++ ; allOK=kFALSE ; if (numInvalid < 5) { - coutI(DataHandling) << "RooTreeDataStore::loadValues(" << GetName() << ") Skipping event #" << i << " because " << destArg->GetName() - << " cannot accommodate the value " << static_cast(sourceArg)->getVal() << std::endl; + auto& log = coutI(DataHandling); + log << "RooTreeDataStore::loadValues(" << GetName() << ") Skipping event #" << i << " because " << destArg->GetName() + << " cannot accommodate the value "; + if(sourceArg->isCategory()) { + log << static_cast(sourceArg)->getCurrentIndex(); + } else { + log << static_cast(sourceArg)->getVal(); + } + log << std::endl; } else if (numInvalid == 5) { coutI(DataHandling) << "RooTreeDataStore::loadValues(" << GetName() << ") Skipping ..." << std::endl; }