◆ __init__()
def python.physvalPostProcessingTools.HistogramAddition.__init__ |
( |
|
self, |
|
|
|
histo1, |
|
|
|
histo2, |
|
|
|
output, |
|
|
|
delete_inputs = False |
|
) |
| |
◆ __call__()
def python.physvalPostProcessingTools.HistogramAddition.__call__ |
( |
|
self, |
|
|
|
root_file |
|
) |
| |
Definition at line 345 of file physvalPostProcessingTools.py.
345 def __call__(self, root_file):
348 if not histo1
or not histo2:
350 raise RuntimeError(f
"Missing histograms: {self.histo1} or {self.histo2}")
352 logging.error(f
"Missing histograms: {self.histo1} or {self.histo2}")
355 path_parts = self.output.strip(
"/").
split(
"/")
356 *dir_path, output_name = path_parts
357 directory_path =
"/".
join(dir_path)
358 summed = histo1.Clone(output_name)
361 root_file.cd(directory_path)
362 summed.Write(output_name, ROOT.TObject.kOverwrite)
363 logging.info(f
"Saved added histogram '{output_name}' in '{directory_path}'.")
364 if self.delete_inputs:
366 find_histo(root_file, self.histo1, should_delete=
True)
367 find_histo(root_file, self.histo2, should_delete=
True)
◆ from_yaml()
def python.physvalPostProcessingTools.HistogramAddition.from_yaml |
( |
|
fragment | ) |
|
|
static |
Definition at line 370 of file physvalPostProcessingTools.py.
370 def from_yaml(fragment):
371 return HistogramAddition(
372 histo1=fragment[
"histo1_name"],
373 histo2=fragment[
"histo2_name"],
374 output=fragment[
"output"],
375 delete_inputs=fragment.get(
"delete_inputs",
False)
◆ delete_inputs
python.physvalPostProcessingTools.HistogramAddition.delete_inputs |
◆ histo1
python.physvalPostProcessingTools.HistogramAddition.histo1 |
◆ histo2
python.physvalPostProcessingTools.HistogramAddition.histo2 |
◆ output
python.physvalPostProcessingTools.HistogramAddition.output |
The documentation for this class was generated from the following file: