27 return logging.getLogger(__name__)
31formatter = TolerateMissingKeyFormatter()
35 """Python module to refine a peeled dictionary"""
38 """Constructor of the Refiner instance"""
42 def __get__(self, harvesting_module, cls=None):
43 """Getter of the Refiner instance"""
44 if harvesting_module
is None:
51 def bound_call(*args, **kwds):
52 return refine(harvesting_module, *args, **kwds)
55 def __call__(self, harvesting_module, crops=None, *args, **kwds):
56 """implementation of the function-call of the Refiner instance
59 r(harvester, crops, args, keywords)
63 harvesting_module.refiners.append(self)
64 return harvesting_module
67 return self.
refine(harvesting_module, crops, *args, **kwds)
69 def refine(self, harvesting_module, *args, **kwds):
70 """Apply the instance's refiner function"""
75 """Refiner for figures of merit"""
77 default_name =
"{module.id}_figures_of_merit{groupby_key}"
79 default_title =
"Figures of merit in {module.title}"
81 default_contact =
"{module.contact}"
83 default_description =
"Figures of merit are the {aggregation.__name__} of {keys}"
85 default_check =
"Check for reasonable values"
87 default_key =
"{aggregation.__name__}_{part_name}"
95 default_aggregation = mean
106 """Constructor for this refiner"""
131 groupby_part_name=None,
134 """Process the figures of merit"""
144 replacement_dict = dict(
146 module=harvesting_module,
147 aggregation=aggregation,
148 groupby_key=
'_' + groupby_part_name + groupby_value
if groupby_part_name
else "",
149 groupby=groupby_part_name,
150 groupby_value=groupby_value,
153 name = formatter.format(name, **replacement_dict)
154 title = formatter.format(title, **replacement_dict)
155 contact = formatter.format(contact, **replacement_dict)
161 for part_name, parts
in iter_items_sorted_for_key(crops):
163 key = formatter.format(key, part_name=part_name, **replacement_dict)
166 keys = list(figures_of_merit.keys())
168 description = formatter.format(description, keys=keys, **replacement_dict)
169 check = formatter.format(check, keys=keys, **replacement_dict)
171 figures_of_merit.description = description
172 figures_of_merit.check = check
175 figures_of_merit.write(tdirectory)
177 print(figures_of_merit)
181 """Refiner for histograms"""
183 default_name =
"{module.id}_{part_name}_histogram{groupby_key}{stackby_key}"
185 default_title =
"Histogram of {part_name}{groupby_key}{stackby_key} from {module.title}"
187 default_contact =
"{module.contact}"
189 default_description =
"This is a histogram of {part_name}{groupby_key}{stackby_key}."
191 default_check =
"Check if the distribution is reasonable"
202 outlier_z_score=None,
203 allow_discrete=False,
207 """Constructor for this refiner"""
246 groupby_part_name=None,
249 """Process the histogram"""
253 stackby_parts = crops[stackby]
257 replacement_dict = dict(
259 module=harvesting_module,
260 stackby_key=
' stacked by ' + stackby
if stackby
else "",
261 groupby_key=
' in group ' + groupby_part_name + groupby_value
if groupby_part_name
else "",
265 contact = formatter.format(contact, **replacement_dict)
267 for part_name, parts
in iter_items_sorted_for_key(crops):
273 name = formatter.format(name, part_name=part_name, **replacement_dict)
274 title = formatter.format(title, part_name=part_name, **replacement_dict)
275 description = formatter.format(description, part_name=part_name, **replacement_dict)
276 check = formatter.format(check, part_name=part_name, **replacement_dict)
279 histogram.hist(parts,
285 stackby=stackby_parts)
287 histogram.title = title
288 histogram.contact = contact
289 histogram.description = description
290 histogram.check = check
292 histogram.xlabel = compose_axis_label(part_name)
300 fit_method_name =
'fit_' + str(self.
fit)
302 fit_method = getattr(histogram, fit_method_name)
303 except AttributeError:
304 histogram.fit(str(self.
fit), **kwds)
309 histogram.write(tdirectory)
313 """Refiner for profile histograms and 2D scatterplots"""
315 plot_kind =
"profile"
332 outlier_z_score=None,
335 skip_single_valued=False,
336 allow_discrete=False):
337 """Constructor for this refiner"""
390 groupby_part_name=None,
393 """Process the profile histogram / scatterplot"""
397 stackby_parts = crops[stackby]
401 replacement_dict = dict(
403 module=harvesting_module,
404 stackby_key=
' stacked by ' + stackby
if stackby
else "",
405 groupby_key=
' in group ' + groupby_part_name + groupby_value
if groupby_part_name
else "",
408 contact = self.
contact or self.default_contact
409 contact = formatter.format(contact, **replacement_dict)
411 y_crops = select_crop_parts(crops, select=self.
y)
412 x_crops = select_crop_parts(crops, select=self.
x, exclude=self.
y)
414 for y_part_name, y_parts
in iter_items_sorted_for_key(y_crops):
415 for x_part_name, x_parts
in iter_items_sorted_for_key(x_crops):
418 get_logger().info(
'Skipping "%s" by "%s" profile because x has only a single value "%s"',
425 get_logger().info(
'Skipping "%s" by "%s" profile because y has only a single value "%s"',
431 name = self.
name or self.default_name
432 title = self.
title or self.default_title
433 description = self.
description or self.default_description
434 check = self.
check or self.default_check
436 name = formatter.format(name,
437 x_part_name=x_part_name,
438 y_part_name=y_part_name,
441 title = formatter.format(title,
442 x_part_name=x_part_name,
443 y_part_name=y_part_name,
446 description = formatter.format(description,
447 x_part_name=x_part_name,
448 y_part_name=y_part_name,
451 check = formatter.format(check,
452 x_part_name=x_part_name,
453 y_part_name=y_part_name,
459 if plot_kind ==
"profile":
460 profile_plot.profile(x_parts,
469 stackby=stackby_parts)
477 fit_method_name =
'fit_' + str(self.
fit)
479 fit_method = getattr(profile_plot, fit_method_name)
480 except BaseException:
481 profile_plot.fit(str(self.
fit), **kwds)
485 elif plot_kind ==
"scatter":
486 profile_plot.scatter(x_parts,
491 stackby=stackby_parts)
493 profile_plot.title = title
494 profile_plot.contact = contact
495 profile_plot.description = description
496 profile_plot.check = check
498 profile_plot.xlabel = compose_axis_label(x_part_name)
499 profile_plot.ylabel = compose_axis_label(y_part_name, self.
y_unit)
502 profile_plot.write(tdirectory)
506 """check if a list has at least two unique values"""
516 """Refiner for profile histograms"""
518 default_name =
"{module.id}_{y_part_name}_by_{x_part_name}_profile{groupby_key}{stackby_key}"
520 default_title =
"Profile of {y_part_name} by {x_part_name} from {module.title}"
522 default_contact =
"{module.contact}"
524 default_description =
"This is a profile of {y_part_name} over {x_part_name}."
526 default_check =
"Check if the trend line is reasonable."
529 plot_kind =
"profile"
533 """Refiner for 2D scatterplots"""
535 default_name =
"{module.id}_{y_part_name}_by_{x_part_name}_scatter{groupby_key}{stackby_key}"
537 default_title =
"Scatter of {y_part_name} by {x_part_name} from {module.title}"
539 default_contact =
"{module.contact}"
541 default_description =
"This is a scatter of {y_part_name} over {x_part_name}."
543 default_check =
"Check if the distributions is reasonable."
546 plot_kind =
"scatter"
550 """Refiner for truth-classification analyses"""
553 default_contact =
"{module.contact}"
556 default_truth_name =
"{part_name}_truth"
558 default_estimate_name =
"{part_name}_estimate"
569 outlier_z_score=None,
570 allow_discrete=False,
572 """Constructor for this refiner"""
603 groupby_part_name=None,
606 """Process the truth-classification analysis"""
608 replacement_dict = dict(
610 module=harvesting_module,
611 groupby_key=
'_' + groupby_part_name + groupby_value
if groupby_part_name
else "",
612 groupby=groupby_part_name,
613 groupby_value=groupby_value,
617 contact = formatter.format(contact, **replacement_dict)
624 truth_name = formatter.format(truth_name, part_name=self.
part_name)
625 truths = crops[truth_name]
632 if isinstance(estimate_name, str):
633 estimate_names = [estimate_name, ]
635 estimate_names = estimate_name
637 for estimate_name
in estimate_names:
638 estimate_name = formatter.format(estimate_name, part_name=self.
part_name)
639 estimates = crops[estimate_name]
651 classification_analysis.analyse(estimates, truths)
654 classification_analysis.write(tdirectory)
658 """Refiner for pull analyses"""
661 default_name =
"{module.id}_{quantity_name}"
663 default_contact =
"{module.contact}"
665 default_title_postfix =
" from {module.title}"
668 default_truth_name =
"{part_name}_truth"
670 default_estimate_name =
"{part_name}_estimate"
672 default_variance_name =
"{part_name}_variance"
686 outlier_z_score=None,
689 """Constructor for this refiner"""
690 if aux_names
is None:
701 if part_names
is not None:
704 if part_name
is not None:
733 groupby_part_name=None,
736 """Process the pull analysis"""
738 replacement_dict = dict(
740 module=harvesting_module,
742 groupby_key=
'_' + groupby_part_name + groupby_value
if groupby_part_name
else "",
743 groupby=groupby_part_name,
744 groupby_value=groupby_value,
748 contact = formatter.format(contact, **replacement_dict)
753 auxiliaries = select_crop_parts(crops, self.
aux_names)
758 name = formatter.format(name, part_name=part_name, **replacement_dict)
759 plot_name = name +
"_{subplot_name}"
762 if title_postfix
is None:
765 title_postfix = formatter.format(title_postfix, part_name=part_name, **replacement_dict)
766 plot_title =
"{subplot_title} of {quantity_name}" + title_postfix
783 truth_name = formatter.format(truth_name, part_name=part_name)
784 estimate_name = formatter.format(estimate_name, part_name=part_name)
785 variance_name = formatter.format(variance_name, part_name=part_name)
787 truths = crops[truth_name]
788 estimates = crops[estimate_name]
790 variances = crops[variance_name]
803 plot_title=plot_title)
805 pull_analysis.analyse(truths,
808 auxiliaries=auxiliaries,
809 which_plots=which_plots)
811 pull_analysis.contact = contact
814 pull_analysis.write(tdirectory)
818 """Refiner for ROOT TTrees"""
821 default_name =
"{module.id}_tree"
823 default_title =
"Tree of {module.id}"
828 """Constructor for this refiner"""
840 groupby_part_name=None,
843 """Process the TTree"""
845 replacement_dict = dict(
847 module=harvesting_module,
848 groupby_key=
'_' + groupby_part_name + groupby_value
if groupby_part_name
else "",
849 groupby=groupby_part_name,
850 groupby_value=groupby_value,
853 with root_cd(tdirectory):
857 name = formatter.format(name, **replacement_dict)
858 title = formatter.format(title, **replacement_dict)
860 output_ttree = ROOT.TTree(root_save_name(name), title)
861 for part_name, parts
in iter_items_sorted_for_key(crops):
862 self.
add_branch(output_ttree, part_name, parts)
864 output_ttree.FlushBaskets()
868 """Add a TBranch to the TTree"""
869 input_value = np.zeros(1, dtype=float)
871 branch_type_spec = f
'{part_name}/D'
872 tbranch = output_ttree.Branch(part_name, input_value, branch_type_spec)
874 if output_ttree.GetNbranches() == 1:
879 input_value[0] = value
884 input_value[0] = value
887 output_ttree.GetEntry(0)
888 output_ttree.ResetBranchAddress(tbranch)
889 also_subbranches =
True
890 output_ttree.DropBranchFromCache(tbranch, also_subbranches)
894 """Refiner for filters"""
896 def __init__(self, wrapped_refiner, filter=None, on=None):
897 """Constructor for this refiner"""
911 def refine(self, harvesting_module, crops, *args, **kwds):
912 """Process this filter"""
913 filtered_crops = filter_crops(crops, self.filter, part_name=self.on)
918 """Refiner for selection"""
920 def __init__(self, wrapped_refiner, select=None, exclude=None):
921 """Constructor for this refiner"""
933 def refine(self, harvesting_module, crops, *args, **kwds):
934 """Process this selection"""
935 selected_crops = select_crop_parts(crops, select=self.
select, exclude=self.
exclude)
940 """Refiner for grouping"""
943 default_exclude_by =
True
949 """Constructor for this refiner"""
962 groupby_part_name=None,
966 """Process this grouping"""
971 if isinstance(by, str)
or by
is None:
976 for groupby_spec
in by:
977 if groupby_spec
is None:
982 groupby_part_name=
None,
988 elif isinstance(groupby_spec, str):
989 part_name = groupby_spec
990 groupby_parts = crops[part_name]
991 unique_values, index_of_values = np.unique(groupby_parts, return_inverse=
True)
992 groupby_values = [f
" = {value}]" for value
in unique_values]
994 elif isinstance(groupby_spec, tuple):
995 part_name = groupby_spec[0]
996 cuts = groupby_spec[1]
998 groupby_parts = crops[part_name]
1001 digitization_cuts = list(np.sort(cuts))
1002 if digitization_cuts[-1] != np.inf:
1003 digitization_cuts.append(np.inf)
1004 index_of_values = np.digitize(groupby_parts, digitization_cuts, right=
True)
1006 groupby_values = [f
"below {digitization_cuts[0]}"]
1007 bin_bounds = list(zip(digitization_cuts[0:], digitization_cuts[1:]))
1008 for lower_bound, upper_bound
in bin_bounds:
1009 if lower_bound == upper_bound:
1011 groupby_values.append(f
"= {lower_bound}")
1012 elif upper_bound == np.inf:
1013 groupby_values.append(f
"above {lower_bound}")
1015 groupby_values.append(f
"between {lower_bound} and {upper_bound}")
1016 groupby_values.append(
"is nan")
1017 assert len(groupby_values) == len(digitization_cuts) + 1
1020 raise ValueError(f
"Unknown groupby specification {groupby_spec}")
1023 selected_crops = select_crop_parts(crops, exclude=part_name
if self.
exclude_by else None)
1024 for index_of_value, groupby_value
in enumerate(groupby_values):
1025 indices_for_value = index_of_values == index_of_value
1026 if not np.any(indices_for_value):
1029 filtered_crops = filter_crops(selected_crops, indices_for_value)
1033 groupby_part_name=part_name,
1034 groupby_value=groupby_value,
1040 """Refiner for change-directory"""
1043 default_folder_name =
""
1045 default_groupby_addition =
"_groupby_{groupby}_{groupby_value}"
1050 groupby_addition=None):
1051 """Constructor for this refiner"""
1064 groupby_part_name=None,
1068 """Process the change-directory"""
1071 if folder_name
is None:
1072 if groupby_value
is not None:
1073 folder_name =
"{groupby_addition}"
1079 if groupby_addition
is None:
1082 if groupby_part_name
is None and groupby_value
is None:
1083 groupby_addition =
""
1085 groupby_addition = formatter.format(groupby_addition,
1086 groupby=groupby_part_name,
1087 groupby_value=groupby_value)
1089 folder_name = formatter.format(folder_name,
1090 groupby_addition=groupby_addition,
1091 groupby=groupby_part_name,
1092 groupby_value=groupby_value)
1094 folder_name =
'/'.join(root_save_name(name)
for name
in folder_name.split(
'/'))
1096 with root_cd(tdirectory):
1097 with root_cd(folder_name)
as tdirectory:
1100 tdirectory=tdirectory,
1101 groupby_part_name=groupby_part_name,
1102 groupby_value=groupby_value,
1108 """Refiner for expert-level categorization"""
1110 def __init__(self, wrapped_refiner, above_expert_level=None, below_expert_level=None):
1111 """Constructor for this refiner"""
1120 def refine(self, harvesting_module, crops, *args, **kwds):
1121 """Process the expert-level categorization"""
1127 if above_expert_level
is not None:
1128 proceed = proceed
and harvesting_module.expert_level > above_expert_level
1130 if below_expert_level
is not None:
1131 proceed = proceed
and harvesting_module.expert_level < below_expert_level
1138def groupby(refiner=None, **kwds):
1139 def group_decorator(wrapped_refiner):
1142 return group_decorator
1144 return group_decorator(refiner)
1147def select(refiner=None, **kwds):
1148 def select_decorator(wrapped_refiner):
1151 return select_decorator
1153 return select_decorator(refiner)
1156def filter(refiner=None, **kwds):
1157 def filter_decorator(wrapped_refiner):
1160 return filter_decorator
1162 return filter_decorator(refiner)
1165def cd(refiner=None, **kwds):
1166 def cd_decorator(wrapped_refiner):
1167 return CdRefiner(wrapped_refiner, **kwds)
1171 return cd_decorator(refiner)
1174def context(refiner=None,
1175 above_expert_level=None, below_expert_level=None,
1176 folder_name=None, folder_groupby_addition=None,
1177 filter=None, filter_on=None,
1178 groupby=None, exclude_groupby=None,
1179 select=None, exclude=None):
1181 def context_decorator(wrapped_refiner):
1183 if exclude
is not None or select
is not None:
1185 select=select, exclude=exclude)
1187 if folder_name
is not None or groupby
is not None or folder_groupby_addition
is not None:
1188 wrapped_refiner =
CdRefiner(wrapped_refiner,
1189 folder_name=folder_name,
1190 groupby_addition=folder_groupby_addition)
1192 if groupby
is not None:
1195 exclude_by=exclude_groupby)
1197 if filter
is not None or filter_on
is not None:
1202 if above_expert_level
is not None or below_expert_level
is not None:
1204 above_expert_level=above_expert_level,
1205 below_expert_level=below_expert_level)
1207 if not isinstance(wrapped_refiner, Refiner):
1208 wrapped_refiner =
Refiner(wrapped_refiner)
1210 return wrapped_refiner
1213 return context_decorator
1215 return functools.wraps(refiner)(context_decorator(refiner))
1218def refiner_with_context(refiner_factory):
1219 @functools.wraps(refiner_factory)
1220 def module_decorator_with_context(above_expert_level=None, below_expert_level=None,
1221 folder_name=None, folder_groupby_addition=None,
1222 filter=None, filter_on=None,
1223 groupby=None, exclude_groupby=None,
1224 select=None, exclude=None,
1225 **kwds_for_refiner_factory):
1227 refiner = refiner_factory(**kwds_for_refiner_factory)
1229 return context(refiner,
1230 above_expert_level=above_expert_level, below_expert_level=below_expert_level,
1231 folder_name=folder_name, folder_groupby_addition=folder_groupby_addition,
1232 filter=filter, filter_on=filter_on,
1233 groupby=groupby, exclude_groupby=exclude_groupby,
1234 select=select, exclude=exclude)
1236 return module_decorator_with_context
1239@refiner_with_context
1240def save_fom(**kwds):
1244@refiner_with_context
1245def save_histograms(**kwds):
1249@refiner_with_context
1250def save_profiles(**kwds):
1254@refiner_with_context
1255def save_scatters(**kwds):
1259@refiner_with_context
1260def save_classification_analysis(**kwds):
1264@refiner_with_context
1265def save_pull_analysis(**kwds):
1269@refiner_with_context
1270def save_tree(**kwds):
1274def select_crop_parts(crops, select=None, exclude=None):
1280 if isinstance(select, str):
1283 if isinstance(exclude, str):
1284 exclude = [exclude, ]
1286 if isinstance(crops, collections.abc.MutableMapping):
1287 part_names = list(crops.keys())
1289 if not select
and not exclude:
1293 not_selected_part_names = [name
for name
in part_names
if name
not in select]
1296 select_not_in_part_names = [name
for name
in select
1297 if not isinstance(name, collections.abc.Callable)
and name
not in part_names]
1298 if select_not_in_part_names:
1299 get_logger().warning(
"Cannot select %s, because they are not in crop part names %s",
1300 select_not_in_part_names, sorted(part_names))
1302 not_selected_part_names = []
1305 excluded_part_names = [name
for name
in part_names
if name
in exclude]
1307 excluded_part_names = []
1309 excluded_part_names.extend(not_selected_part_names)
1312 selected_crops = copy.copy(crops)
1313 for part_name
in set(excluded_part_names):
1314 del selected_crops[part_name]
1316 if isinstance(select, collections.abc.Mapping):
1318 for part_name, new_part_name
in list(select.items()):
1319 if isinstance(part_name, collections.abc.Callable):
1320 selected_crops[new_part_name] = part_name(**crops)
1321 elif part_name
in selected_crops:
1322 parts = selected_crops[part_name]
1323 del selected_crops[part_name]
1324 selected_crops[new_part_name] = parts
1326 return selected_crops
1329 raise ValueError(f
"Unrecognised crop {crops} of type {type(crops)}")
1332def filter_crops(crops, filter_function, part_name=None):
1333 if isinstance(filter_function, np.ndarray):
1334 filter_indices = filter_function
1336 parts = crops[part_name]
1337 filter_indices = filter_function(parts)
1339 if isinstance(crops, np.ndarray):
1340 return crops[filter_indices]
1342 elif isinstance(crops, collections.abc.MutableMapping):
1344 filtered_crops = copy.copy(crops)
1345 for part_name, parts
in list(crops.items()):
1346 filtered_crops[part_name] = parts[filter_indices]
1347 return filtered_crops
1350 raise ValueError(f
"Unrecognised crop {crops} of type {type(crops)}")
1353def iter_items_sorted_for_key(crops):
1356 if isinstance(crops, dict):
1357 keys = sorted(crops.keys())
1358 return ((key, crops[key])
for key
in keys)
1360 return list(crops.items())
str default_folder_name
Folder name to be used if a groupby selection is active.
def __init__(self, wrapped_refiner, folder_name=None, groupby_addition=None)
folder_name
cached value of the folder name
def refine(self, harvesting_module, crops, tdirectory=None, groupby_part_name=None, groupby_value=None, *args, **kwds)
wrapped_refiner
cached value of the wrapped refiner
groupby_addition
cached value of the suffix for a groupby selection
str default_groupby_addition
Default suffix for a groupby selection.
below_expert_level
cached value of the lower range of the expert level
wrapped_refiner
cached value of the wrapped refiner
def refine(self, harvesting_module, crops, *args, **kwds)
def __init__(self, wrapped_refiner, above_expert_level=None, below_expert_level=None)
above_expert_level
cached value of the upper range of the expert level
on
cached value of the part name to filter on
wrapped_refiner
cached value of the wrapped refiner
def refine(self, harvesting_module, crops, *args, **kwds)
filter
cached value of the filter
def __init__(self, wrapped_refiner, filter=None, on=None)
by
cached value of the group-by classifier
def __init__(self, wrapped_refiner, by=None, exclude_by=None)
wrapped_refiner
cached value of the wrapped refiner
exclude_by
cached value of the exclude-by classifier
bool default_exclude_by
default value of the exclude-by classifier
def refine(self, harvesting_module, crops, groupby_part_name=None, groupby_value=None, *args, **kwds)
title
cached user-defined title for this profile histogram / scatterplot
y_log
cached flag for logarithmic y axis for this profile histogram / scatterplot
description
cached user-defined description for this profile histogram / scatterplot
contact
cached user-defined contact person for this profile histogram / scatterplot
fit
cached fit for this profile histogram / scatterplot
upper_bound
cached upper bound for this profile histogram / scatterplot
y
cached value of ordinate
outlier_z_score
cached Z-score (for outlier detection) for this profile histogram / scatterplot
y_binary
cached flag for probability y axis (range 0.0 .
skip_single_valued
cached flag to skip single-valued bins for this profile histogram / scatterplot
allow_discrete
cached flag to allow discrete values for this profile histogram / scatterplot
str plot_kind
by default, this refiner is for profile histograms
fit_z_score
cached fit Z-score (for outlier detection) for this profile histogram / scatterplot
stackby
cached stacking selection for this profile histogram / scatterplot
y_unit
cached measurement unit for ordinate
def __init__(self, y, x=None, name=None, title=None, contact=None, description=None, check=None, stackby=None, y_unit=None, y_binary=None, y_log=None, lower_bound=None, upper_bound=None, bins=None, outlier_z_score=None, fit=None, fit_z_score=None, skip_single_valued=False, allow_discrete=False)
x
cached value of abscissa
def has_more_than_one_value(xs)
name
cached user-defined name for this profile histogram / scatterplot
bins
cached number of bins for this profile histogram / scatterplot
def refine(self, harvesting_module, crops, tdirectory=None, groupby_part_name=None, groupby_value=None, **kwds)
lower_bound
cached lower bound for this profile histogram / scatterplot
check
cached user-defined user-check action for this profile histogram / scatterplot
refiner_function
cached copy of the instance's refiner function
def __init__(self, refiner_function=None)
def refine(self, harvesting_module, *args, **kwds)
def __get__(self, harvesting_module, cls=None)
def __call__(self, harvesting_module, crops=None, *args, **kwds)
truth_name
cached truth-values-collection name for this truth-classification analysis
cut
cached threshold of estimates for this truth-classification analysis
contact
cached contact person for this truth-classification analysis
upper_bound
cached upper bound of estimates for this truth-classification analysis
outlier_z_score
cached Z-score (for outlier detection) of estimates for this truth-classification analysis
allow_discrete
cached discrete-value flag of estimates for this truth-classification analysis
unit
cached measurement unit of estimates for this truth-classification analysis
estimate_name
cached estimates-collection name for this truth-classification analysis
cut_direction
cached cut direction (> or <) of estimates for this truth-classification analysis
def __init__(self, part_name=None, contact=None, estimate_name=None, truth_name=None, cut_direction=None, cut=None, lower_bound=None, upper_bound=None, outlier_z_score=None, allow_discrete=False, unit=None)
str default_estimate_name
default name for the truth-classification analysis estimates collection
part_name
cached part name for this truth-classification analysis
str default_truth_name
default name for the truth-classification analysis truth-values collection
def refine(self, harvesting_module, crops, tdirectory=None, groupby_part_name=None, groupby_value=None, **kwds)
lower_bound
cached lower bound of estimates for this truth-classification analysis
str default_contact
default contact person for this truth-classification analysis
title
cached user-defined title for this histogram
description
cached user-defined description for this histogram
contact
cached user-defined contact person for this histogram
fit
cached fit for this histogram
upper_bound
cached upper bound for this histogram
outlier_z_score
cached Z-score (for outlier detection) for this histogram
str default_name
default name for this histogram
allow_discrete
cached flag to allow discrete values for this histogram
def __init__(self, name=None, title=None, contact=None, description=None, check=None, lower_bound=None, upper_bound=None, bins=None, outlier_z_score=None, allow_discrete=False, stackby="", fit=None, fit_z_score=None)
fit_z_score
cached fit Z-score (for outlier detection) for this histogram
stackby
cached stacking selection for this histogram
str default_description
default description for this histogram
str default_check
default user-check action for this histogram
str default_title
default title for this histogram
name
cached user-defined name for this histogram
bins
cached number of bins for this histogram
def refine(self, harvesting_module, crops, tdirectory=None, groupby_part_name=None, groupby_value=None, **kwds)
lower_bound
cached lower bound for this histogram
check
cached user-defined user-check action for this histogram
str default_contact
default contact person for this histogram
variance_name
cached name for the pull analysis variances collection
truth_name
cached name for the pull analysis truth-values collection
str default_variance_name
default name for the pull analysis variances collection
quantity_name
cached name of the quantity for the pull analysis
contact
cached contact person for this pull analysis
outlier_z_score
cached Z-score (for outlier detection) for the pull analysis
str default_name
default name for this pull analysis
part_names
cached array of part names for this pull analysis
unit
cached measurement unit for the pull analysis
aux_names
cached auxiliary names for the pull analysis
estimate_name
cached name for the pull analysis estimates collection
title_postfix
cached suffix for the title of this pull analysis
def __init__(self, name=None, contact=None, title_postfix=None, part_name=None, part_names=None, truth_name=None, estimate_name=None, variance_name=None, quantity_name=None, aux_names=None, unit=None, outlier_z_score=None, absolute=False, which_plots=None)
str default_title_postfix
default suffix for the title of this pull analysis
str default_estimate_name
default name for the pull analysis estimates collection
name
cached name for this pull analysis
str default_truth_name
default name for the pull analysis truth-values collection
def refine(self, harvesting_module, crops, tdirectory=None, groupby_part_name=None, groupby_value=None, **kwds)
which_plots
cached list of plots produced by the pull analysis
absolute
cached absolute-value-comparison flag for the pull analysis
str default_contact
default contact person for this pull analysis
title
cached title for this TTree
str default_name
default name for this TTree
def __init__(self, name=None, title=None)
def add_branch(self, output_ttree, part_name, parts)
str default_title
default title for this TTree
name
cached name for this TTree
def refine(self, harvesting_module, crops, tdirectory=None, groupby_part_name=None, groupby_value=None, **kwds)
def __init__(self, wrapped_refiner, select=None, exclude=None)
wrapped_refiner
cached value of the wrapped refiner
def refine(self, harvesting_module, crops, *args, **kwds)
exclude
cached value of the exclusion flag
select
cached value of the selector