ConditionsDependencyHandler ERROR Failed to resolve conditon:A2C1868E00000000ConditionDependency ERROR +++ Exception while creating dependent Condition /world#AlgorithmSpecific-PrForwardTrackingVeloFTZoneCache:ConditionDependency ERROR ConditionsDependencyHandler: Failed to resolve conditon:A2C1868E00000000 @../Pr/PrAlgorithms/src/PrForwardTracking.cpp:1810 (input 0)UserPool INFO +++ * Conditions for USER pool with IOV: run(0):[0-199] [14042 entries]
I think the issue is the fact dd4hep is attempting to attach the condition to /world - This doesn't work, and is I now recall something I ran into with the RICH when I tried to do it. My workaround was to attach to either the RICH1 or RICH2 Detelems as appropriate.
If I change
typename base_class_t::KeyValue{"FTZoneCache", "AlgorithmSpecific-" + name + "FTZoneCache"},
to
typename base_class_t::KeyValue{"FTZoneCache", "/world/AfterMagnetRegion/T:AlgorithmSpecific-" + name + "FTZoneCache"},
Then I get past this error. I get another one, almost certainly the same thing, elsewhere.
@bcouturi Is attaching derived conditions to /world supposed to work, as this seems to be what happens by default if the user does not manually specify what to attach them to ?
Hi @jonrob, it it supposed to work indeed, and we have several conditions attached there already.
It looks like the problem is that the separator is ':', so the condition key should be
which looks like it is suppose to correctly handle the lack of a ":" by attaching to /world. I then get a bit lost in working out how /world# gets used instead of /world: ??
So, DD4hepSvc::add is indeed calling LHCb::Detector::parseConditionIdentifier to parse the key. I extended the debug printout to show what this is giving, and I get
HCb::Det::LbDD4hep::DD4hepSvc DEBUG Adding derivation for AlgorithmSpecific-PrForwardTrackingVeloFTZoneCache (3521AF0600000000) | DetElem='/world' Key='AlgorithmSpecific-PrForwardTrackingVeloFTZoneCache'
so indeed at this level the logic is detecting there is no ":" and automatically attaching to /world. So whatever is going wrong its deeper in... @bcouturi any idea why/where this could be happening ?
My suspicion is the conditions key finds its way into different places. Its listed as the input location for the functional algorithm in question, so its used not only when the addConditionDerivation is made (and here I think things are handled) but also by the functional framework itself when the inputs to the algorithm are accessed. This use case is not obvious how to 'fix' as effectively we need to change the key the functional algorithm uses for access, and at the level this is done the algorithm has no way to know its a derived condition that needs it...
So, its not at all obvious to me if the only way to address this is to explicitly add the detector to attach to when the key is first defined. Something like what I have in
@bcouturi You don't need to build panoptes and everything it depends on to reproduce, as I believe #345 (closed) is the same basic issue, and there you can reproduce with 'just' a Moore test.
Not to sound like a broken record, but could we please try and improve the diagnostic messages for cases like this ? Just seems to me we are wasting time (we can ill afford) debugging issues, when if the error reporting was better we would be fixing things way faster...
Actually the error message was telling us what to do:
... ConditionsDependencyHandler: Failed to resolve conditon:A2C1868E00000000 @../Pr/PrAlgorithms/src/PrForwardTracking.cpp:1810 (input 0)
which means
go to line 1810 of PrForwardTracking.cpp and check the input 0
We got side tracked by the part of the message saying that we failed to set up the condition derivation for the output condition AlgorithmSpecific-PrForwardTrackingVeloFTZoneCache, but the error stated clearly that the problem was on the input and not on the output.
You are right, I was sidetracked by the fact that the log from DD4hep stated Exception while creating dependent Condition /world#AlgorithmSpecific-PrForwardTrackingVeloFTZoneCache:, where the effect of having a # instead of : would yield a key that has a null condition name (hence the 00000000).
@clemenci The meaning of the term (input 0) in the message completely escaped me.... So on that basis it wasn't perhaps as clear as you thought it was.
What I was thinking of as a clear message would have been something that actually mentioned /world/AfterMagnetRegion/T/FT-DetElement-Info-IOV stating this was not a valid string to a known Detelem, or something to that effect..
The issue is that at that point (i.e. in the callback that evaluates the derived condition) we only have the key and not the readable string. As a first workaround, we added to the exception the line number of the failing addDerivedCondition and the parameter number.
@bcouturi Sure, I understand you are doing the best you can given the limitations dd4hep places on us. I'm not 'complaining', just stating what I think the aspirations should be in terms of the clarity of the error reporting. I like to think I know a bit now about how all this works, more than the average developer I would say, but even for me the message wasn't quite clear enough to prevent me wandering off down the wrong rabbit hole..
And indeed it sent me and @bcouturi on the wrong path too. From this debugging session I learned how to read the error message we added just days ago ... Next step is to improve the error message with more clear details, but that requires a new release of DD4hep.
Seemingly also help. And they did, which is why I was firmly stuck in the rabbit hole I was as it looked like the changes was addressing the issue at hand. Why would modifying the derived condition string seeming help with the incorrect DeFT path ???