-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GetRefChild debug pollutes output #485
Comments
Somehow |
Apparently it comes from DD4hep |
Filed AIDASoft/DD4hep#1102 But we should still figure out how to not ignore those exceptions in a loop. |
One related issue could be that we don't throw these runtime errors up to jana2 anymore, https://github.com/eic/EICrecon/blob/2a3f2680d102d8babd7952ca5ed18c7245783b49/src/algorithms/calorimetry/CalorimeterHitDigi.cc. That means jana2 doesn't know to start treating the algorithm as bad and we get GetRefChild errors for every event. |
Silencing the excessive output is an immediate issue for the upcoming production. The upstream PR above addresses that. The issue with exception handling in EICrecon would need to be filed and addressed separately. |
Okay, it would seem there will be rebase conflicts due to recent changes. Here is a patch tested with 01-25-01: diff --git a/DDCore/src/DetectorImp.cpp b/DDCore/src/DetectorImp.cpp
index 12262bb7..c938ad6a 100644
--- a/DDCore/src/DetectorImp.cpp
+++ b/DDCore/src/DetectorImp.cpp
@@ -631,17 +631,22 @@ vector<DetElement> DetectorImp::detectors(const string& type1,
}
Handle<NamedObject> DetectorImp::getRefChild(const HandleMap& e, const string& name, bool do_throw) const {
- HandleMap::const_iterator i = e.find(name);
- if (i != e.end()) {
- return (*i).second;
+ HandleMap::const_iterator it = e.find(name);
+ if (it != e.end()) {
+ return it->second;
}
if (do_throw) {
- int cnt = 0;
- cout << "GetRefChild: Failed to find child with name: " << name
- << " Map contains " << e.size() << " elements." << endl;
- for(i=e.begin(); i!=e.end(); ++i)
- cout << " " << cnt << " " << (*i).first << endl;
- throw runtime_error("Cannot find a child with the reference name:" + name);
+ std::stringstream err;
+ err << "getRefChild: Failed to find child with name: " << name
+ << " Map contains " << e.size() << " elements: {";
+ for (it = e.begin(); it != e.end(); ++it) {
+ if (it != e.begin()) {
+ err << ", " << endl;
+ }
+ err << it->first << endl;
+ }
+ err << "}";
+ throw runtime_error(err.str());
}
return 0;
} |
huh
not sure what's wrong |
Could it be that you are missing a trailing newline? |
That's what it seems like. I'm going through permutations and rediffing... On my phone... |
I think this can be closed, right? |
Fixed in DD4hep |
Environment: (where does this bug occur, have you tried other environments)
main
for latest released): main?HEAD
for the most recent on git): HEAD?Steps to reproduce: (give a step by step account of how to trigger the bug)
or look at logs in CI
Expected Result: (what do you expect when you execute the steps above)
Remove/hide this output or make it more clear to a regular user.
Actual Result: (what do you get when you execute the steps above)
The text was updated successfully, but these errors were encountered: