Skip to content
Snippets Groups Projects
Commit 3eae508d authored by Johannes Schumann's avatar Johannes Schumann
Browse files

Fix generated events output and update w2 calculation

parent 0651d3ad
No related branches found
No related tags found
No related merge requests found
Pipeline #16959 failed
...@@ -194,14 +194,9 @@ class GiBUUOutput: ...@@ -194,14 +194,9 @@ class GiBUUOutput:
def _event_xsec(self, root_tupledata): def _event_xsec(self, root_tupledata):
weights = np.array(root_tupledata.weight) weights = np.array(root_tupledata.weight)
deltaE = np.mean(self.flux_data['energy'][1:] - total_events = np.sum(self.flux_data["events"])
self.flux_data['energy'][:-1])
energy_min = np.min(self.flux_data["energy"])
energy_max = np.max(self.flux_data["energy"])
total_flux_events = self.flux_interpolation.integral(
energy_min, energy_max)
n_files = len(self.root_pert_files) n_files = len(self.root_pert_files)
xsec = np.divide(total_flux_events * weights, deltaE * n_files) xsec = np.divide(total_events * weights, n_files)
return xsec return xsec
def w2weights(self, volume, target_density, solid_angle): def w2weights(self, volume, target_density, solid_angle):
...@@ -339,9 +334,7 @@ class GiBUUOutput: ...@@ -339,9 +334,7 @@ class GiBUUOutput:
@property @property
def generated_events(self): def generated_events(self):
energy_min = np.min(self.flux_data["energy"]) return int(np.sum(self.flux_data["events"]))
energy_max = np.max(self.flux_data["energy"])
return int(self.flux_interpolation.integral(energy_min, energy_max))
def write_detector_file(gibuu_output, def write_detector_file(gibuu_output,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment