Referring to src/HybridNew.cc.
Note: It is unclear to me whether the current behavior is intentional or a bug.
In several places, the limit uncertainty (limitErr) is compared against max(rAbsAccuracy_, rRelAccuracy_ * limit). However, it seems more natural to compare it against min(rAbsAccuracy_, rRelAccuracy_ * limit)
Example:
Default values:
rAbsAccuracy_ = 0.1
rRelAccuracy_ = 0.05
I'm obtaining:
Limit: r < 0.113864 +/- 0.050296 @ 95% CL
In this case:
rRelAccuracy_ * limit = 0.0057
rAbsAccuracy_ = 0.1
limitErr = 0.050296
Since 0.050296 < max(0.1, 0.0057) = 0.1 the convergence criterion is satisfied and HybridNew stops, even though the relative uncertainty is ~44%, and no further fit of the grid toys is performed. This would not have happened if the limitErr had been compared to min(rAbsAccuracy_, rRelAccuracy_ * limit) = 0.0057.
Note:
Obviously, it could be easily fixed by passing a very small value of --rAbsAcc . In the previous example, the limit converges to:
Limit: r < 0.114009 +/- 0.000891322 @ 95% CL
However, it would be more natural if the minimum were used directly.
Conclusions
My suggestion would be to replace max with min when comparing limitErr to the accuracy thresholds, so that the stricter of the absolute and relative criteria is enforced.
If the current implementation is intentional, clarification on the rationale would be appreciated.
Referring to src/HybridNew.cc.
Note: It is unclear to me whether the current behavior is intentional or a bug.
In several places, the limit uncertainty (limitErr) is compared against
max(rAbsAccuracy_, rRelAccuracy_ * limit). However, it seems more natural to compare it againstmin(rAbsAccuracy_, rRelAccuracy_ * limit)Example:
Default values:
rAbsAccuracy_ = 0.1rRelAccuracy_ = 0.05I'm obtaining:
In this case:
rRelAccuracy_ * limit = 0.0057rAbsAccuracy_ = 0.1limitErr = 0.050296Since
0.050296 < max(0.1, 0.0057) = 0.1the convergence criterion is satisfied and HybridNew stops, even though the relative uncertainty is ~44%, and no further fit of the grid toys is performed. This would not have happened if the limitErr had been compared tomin(rAbsAccuracy_, rRelAccuracy_ * limit) = 0.0057.Note:
Obviously, it could be easily fixed by passing a very small value of
--rAbsAcc. In the previous example, the limit converges to:However, it would be more natural if the minimum were used directly.
Conclusions
My suggestion would be to replace max with min when comparing limitErr to the accuracy thresholds, so that the stricter of the absolute and relative criteria is enforced.
If the current implementation is intentional, clarification on the rationale would be appreciated.