ATLAS Offline Software
Classes | Functions | Variables
python.physvalPostProcessingTools Namespace Reference

Classes

class  ConfigManager
 
class  EfficiencyComputation
 
class  HistogramAddition
 
class  HistogramAdjustment
 
class  HistogramBlackList
 
class  ProjectionComputation
 
class  RebinningOperation
 
class  ResolutionComputation
 
class  ROCCurveComputation
 

Functions

def find_histo (root_file, path, should_delete=False)
 — HELPER — ### More...
 
def ensure_directory_exists (root_file, path)
 — HELPER — ### More...
 

Variables

bool crash_on_error = False
 

Function Documentation

◆ ensure_directory_exists()

def python.physvalPostProcessingTools.ensure_directory_exists (   root_file,
  path 
)

— HELPER — ###

Definition at line 37 of file physvalPostProcessingTools.py.

37 def ensure_directory_exists(root_file, path):
38  current = root_file
39  for part in path.strip("/").split("/"):
40  next_dir = current.Get(part)
41  if not next_dir:
42  logging.info(f"Saving directory not exist. Creating directory '{part}' in '{current.GetName()}'")
43  current.mkdir(part)
44  current.cd(part)
45  current = ROOT.gDirectory
46 

◆ find_histo()

def python.physvalPostProcessingTools.find_histo (   root_file,
  path,
  should_delete = False 
)

— HELPER — ###

Definition at line 10 of file physvalPostProcessingTools.py.

10 def find_histo(root_file, path, should_delete=False):
11  obj = root_file.Get(path)
12  if not obj:
13  if crash_on_error:
14  raise RuntimeError(f"Object not found at path: {path}")
15  else:
16  logging.warning(f"Object not found at path: {path}")
17  return None
18  if should_delete:
19  # Extract directory and name for deletion
20  path_parts = path.strip("/").split("/")
21  *dirs, name = path_parts
22  current_dir = root_file
23  for d in dirs:
24  current_dir = current_dir.Get(d)
25  if not current_dir:
26  if crash_on_error:
27  raise RuntimeError(f"Directory '{d}' not found in path '{'/'.join(dirs)}' for deletion.")
28  else:
29  logging.warning(f"Directory '{d}' not found in path '{'/'.join(dirs)}' for deletion.")
30  return None
31  # logging.info(f"Deleting '{name}' in '{'/'.join(dirs)}'")
32  current_dir.Delete(f"{name};*")
33  return None
34  return obj
35 

Variable Documentation

◆ crash_on_error

bool python.physvalPostProcessingTools.crash_on_error = False

Definition at line 7 of file physvalPostProcessingTools.py.

python.physvalPostProcessingTools.ensure_directory_exists
def ensure_directory_exists(root_file, path)
— HELPER — ###
Definition: physvalPostProcessingTools.py:37
python.physvalPostProcessingTools.find_histo
def find_histo(root_file, path, should_delete=False)
— HELPER — ###
Definition: physvalPostProcessingTools.py:10
Trk::split
@ split
Definition: LayerMaterialProperties.h:38