Skip to content

Commit 8454bac

Browse files
committed
demote non-monotonous efficiencies to warning
1 parent 7cce045 commit 8454bac

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

‎PWGHF/D2H/Macros/compute_fraction_cutvar.py‎

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -279,25 +279,21 @@ def main(config):
279279
if not (np.all(rawy[1:] > rawy[:-1]) or np.all(rawy[1:] < rawy[:-1])):
280280
all_vectors_monotonous = MinimisationStatus.MonotonyViolation
281281
print(
282-
"\0\33[33mWARNING! main(): the raw yield vector is not monotonous. Check the input for stability.\0\33[0m"
282+
"\0\33[33m\nWARNING! main(): the raw yield vector is not monotonous. Check the input for stability.\n\0\33[0m"
283283
)
284284
print(f"raw yield vector elements = {rawy}\n")
285285
if not (np.all(unc_rawy[1:] > unc_rawy[:-1]) or np.all(unc_rawy[1:] < unc_rawy[:-1])):
286286
all_vectors_monotonous = MinimisationStatus.MonotonyViolation
287287
print(
288-
"\0\33[33mWARNING! main(): the raw yield uncertainties vector is not monotonous. Check the input for stability.\0\33[0m"
288+
"\0\33[33m\nWARNING! main(): the raw yield uncertainties vector is not monotonous. Check the input for stability.\n\0\33[0m"
289289
)
290290
print(f"raw yield uncertainties vector elements = {unc_rawy}\n")
291-
if not (np.all(effp[1:] >= effp[:-1]) or np.all(effp[1:] <= effp[:-1])):
291+
if not (np.all(effp[1:] > effp[:-1]) or np.all(effp[1:] < effp[:-1])):
292+
print("\0\33[33m\nWARNING! the prompt efficiency vector is not monotonous. Check the input.\0\33[0m")
292293
print(f"prompt efficiency vector elements = {effp}\n")
293-
sys.exit(
294-
"\33[31mFatal error: the prompt efficiency vector is not monotonous. Check the input. Exit.\33[0m"
295-
)
296-
if not (np.all(effnp[1:] >= effnp[:-1]) or np.all(effnp[1:] <= effnp[:-1])):
294+
if not (np.all(effnp[1:] > effnp[:-1]) or np.all(effnp[1:] < effnp[:-1])):
295+
print("\0\33[33m\nWARNING! the nonprompt efficiency vector is not monotonous. Check the input.\0\33[0m")
297296
print(f"nonprompt efficiency vector elements = {effnp}\n")
298-
sys.exit(
299-
"\33[31mFatal error: the nonprompt efficiency vector is not monotonous. Check the input. Exit.\33[0m"
300-
)
301297

302298
minimiser = CutVarMinimiser(rawy, effp, effnp, unc_rawy, unc_effp, unc_effnp)
303299
status = minimiser.minimise_system(cfg["minimisation"]["correlated"])

0 commit comments

Comments
 (0)