◆ __init__()
def python.physvalPostProcessingTools.ProjectionComputation.__init__ |
( |
|
self, |
|
|
|
input_hist, |
|
|
|
bins_x, |
|
|
|
bins_y, |
|
|
|
projection_axis, |
|
|
|
output = None |
|
) |
| |
Definition at line 289 of file physvalPostProcessingTools.py.
289 def __init__(self, input_hist, bins_x, bins_y, projection_axis, output=None):
290 self.input_hist = input_hist
293 self.x_proj = projection_axis ==
"x"
294 self.y_proj = projection_axis ==
"y"
◆ __call__()
def python.physvalPostProcessingTools.ProjectionComputation.__call__ |
( |
|
self, |
|
|
|
root_file |
|
) |
| |
Definition at line 297 of file physvalPostProcessingTools.py.
297 def __call__(self, root_file):
301 raise RuntimeError(f
"Histogram '{self.input_hist}' not found.")
303 logging.error(f
"Histogram '{self.input_hist}' not found.")
306 b1, b2 = hist.GetYaxis().
FindBin(self.bins_x[0]), hist.GetYaxis().
FindBin(self.bins_x[1])
307 b3, b4 = hist.GetXaxis().
FindBin(self.bins_y[0]), hist.GetXaxis().
FindBin(self.bins_y[1])
309 path_parts = self.output.strip(
"/").
split(
"/")
310 *dir_path, output_name = path_parts
311 directory_path =
"/".
join(dir_path)
313 root_file.cd(directory_path)
316 proj_x = hist.ProjectionX(output_name, b1, b2).Clone(output_name)
317 self.project(proj_x, hist.GetXaxis().GetTitle(),
"X")
319 proj_y = hist.ProjectionY(output_name, b3, b4).Clone(output_name)
320 self.project(proj_y, hist.GetYaxis().GetTitle(),
"Y")
◆ from_yaml()
def python.physvalPostProcessingTools.ProjectionComputation.from_yaml |
( |
|
fragment | ) |
|
|
static |
Definition at line 329 of file physvalPostProcessingTools.py.
329 def from_yaml(fragment):
330 return ProjectionComputation(
331 input_hist=fragment[
"hist"],
332 bins_x=fragment.get(
"bins_projection_x", [10, 200]),
333 bins_y=fragment.get(
"bins_projection_y", [-2.47, 2.47]),
334 projection_axis=fragment.get(
"projection_axis",
"x"),
335 output=fragment.get(
"output")
◆ project()
def python.physvalPostProcessingTools.ProjectionComputation.project |
( |
|
self, |
|
|
|
projection, |
|
|
|
axis_title, |
|
|
|
axis |
|
) |
| |
Definition at line 322 of file physvalPostProcessingTools.py.
322 def project(self, projection, axis_title, axis):
323 projection.SetTitle(f
";{axis_title};Entries")
324 projection.SetStats(
False)
326 logging.info(f
"Saved projection by integrating over {axis} axis as '{projection.GetName()}'.")
◆ bins_x
python.physvalPostProcessingTools.ProjectionComputation.bins_x |
◆ bins_y
python.physvalPostProcessingTools.ProjectionComputation.bins_y |
◆ input_hist
python.physvalPostProcessingTools.ProjectionComputation.input_hist |
◆ output
python.physvalPostProcessingTools.ProjectionComputation.output |
◆ x_proj
python.physvalPostProcessingTools.ProjectionComputation.x_proj |
◆ y_proj
python.physvalPostProcessingTools.ProjectionComputation.y_proj |
The documentation for this class was generated from the following file: