File tree Expand file tree Collapse file tree 1 file changed +19
-13
lines changed
Expand file tree Collapse file tree 1 file changed +19
-13
lines changed Original file line number Diff line number Diff line change @@ -898,22 +898,28 @@ bool RooPlot::drawAfter(const char *after, const char *target)
898898// / methods to change the drawing style attributes of a contained
899899// / object directly.
900900
901- TObject *RooPlot::findObject (const char *name, const TClass* tClass) const
901+ TObject *RooPlot::findObject (const char *name, const TClass * tClass) const
902902{
903- TObject *ret = nullptr ;
903+ TObject *ret = nullptr ;
904904
905- for (auto const & item : _items) {
906- TObject &obj = *item.first ;
907- if ((!name || name[0 ] == ' \0 ' || !TString (name).CompareTo (obj.GetName ()))
908- && (!tClass || (obj.IsA ()==tClass))) {
909- ret = &obj ;
910- }
911- }
905+ for (auto const &item : _items) {
906+ TObject &obj = *item.first ;
907+ if ((!name || name[0 ] == ' \0 ' || !TString (name).CompareTo (obj.GetName ())) && (!tClass || (obj.IsA () == tClass))) {
908+ ret = &obj;
909+ }
910+ }
912911
913- if (ret == nullptr ) {
914- coutE (InputArguments) << " RooPlot::findObject(" << GetName () << " ) cannot find object " << (name?name:" <last>" ) << std::endl ;
915- }
916- return ret ;
912+ if (ret == nullptr ) {
913+ std::stringstream error;
914+ error << " RooPlot::findObject(" << GetName () << " ) cannot find object " << (name ? name : " <last>" ) << " \n "
915+ << " Available objects are:\n " ;
916+ for (auto const &item : _items) {
917+ TObject &obj = *item.first ;
918+ error << " - " << obj.IsA ()->GetName () << " \" " << obj.GetName () << " \"\n " ;
919+ }
920+ coutE (InputArguments) << error.str ();
921+ }
922+ return ret;
917923}
918924
919925
You can’t perform that action at this time.
0 commit comments