@@ -23,7 +23,7 @@ class ModelPrediction(NamedTuple):
23
23
24
24
Args:
25
25
model (pyhf.pdf.Model): model to which prediction corresponds to
26
- model_yields (List[List[List[float]]]): yields per sample, channel and bin,
26
+ model_yields (List[List[List[float]]]): yields per channel, sample and bin,
27
27
indices: channel, sample, bin
28
28
total_stdev_model_bins (List[List[List[float]]]): total yield uncertainty per
29
29
channel, sample and bin, indices: channel, sample, bin (last sample: sum
@@ -393,9 +393,11 @@ def yield_stdev(
393
393
394
394
# log total stdev per bin / channel (-1 index for sample sum)
395
395
n_channels = len (model .config .channels )
396
- total_stdev_bin = [total_stdev_per_bin [i ][- 1 ] for i in range (n_channels )]
396
+ total_stdev_bin = [total_stdev_per_bin [i_chan ][- 1 ] for i_chan in range (n_channels )]
397
397
log .debug (f"total stdev is { total_stdev_bin } " )
398
- total_stdev_chan = [total_stdev_per_channel [i ][- 1 ] for i in range (n_channels )]
398
+ total_stdev_chan = [
399
+ total_stdev_per_channel [i_chan ][- 1 ] for i_chan in range (n_channels )
400
+ ]
399
401
log .debug (f"total stdev per channel is { total_stdev_chan } " )
400
402
401
403
# save to cache
@@ -436,7 +438,7 @@ def prediction(
436
438
fit" otherwise)
437
439
438
440
Returns:
439
- ModelPrediction: model, yields and uncertainties per bin and channel
441
+ ModelPrediction: model, yields and uncertainties per channel, sample, bin
440
442
"""
441
443
if fit_results is not None :
442
444
if fit_results .labels != model .config .par_names :
@@ -468,7 +470,8 @@ def prediction(
468
470
]
469
471
470
472
# calculate the total standard deviation of the model prediction
471
- # indices: channel (and bin) for per-bin uncertainties, channel for per-channel
473
+ # indices: (channel, sample, bin) for per-bin uncertainties,
474
+ # (channel, sample) for per-channel
472
475
total_stdev_model_bins , total_stdev_model_channels = yield_stdev (
473
476
model , param_values , param_uncertainty , corr_mat
474
477
)
0 commit comments