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

Add xsec weights to the df

parent 6cc8bc4a
No related branches found
No related tags found
No related merge requests found
Pipeline #14558 passed
...@@ -155,11 +155,9 @@ class GiBUUOutput: ...@@ -155,11 +155,9 @@ class GiBUUOutput:
self.flux_interpolation = UnivariateSpline(self.flux_data["energy"], self.flux_interpolation = UnivariateSpline(self.flux_data["energy"],
self.flux_data["events"]) self.flux_data["events"])
@property def _event_weights(self, df):
def event_weights(self): gibuu_wgt = df["weight"]
event_df = self.event_info_df flux = self.flux_interpolation(df["lepIn_E"])
gibuu_wgt = event_df["weight"]
flux = self.flux_interpolation(event_df["lepIn_E"])
energy_min = np.min(self.flux_data["energy"]) energy_min = np.min(self.flux_data["energy"])
energy_max = np.max(self.flux_data["energy"]) energy_max = np.max(self.flux_data["energy"])
total_events = self.flux_interpolation.integral(energy_min, energy_max) total_events = self.flux_interpolation.integral(energy_min, energy_max)
...@@ -183,6 +181,7 @@ class GiBUUOutput: ...@@ -183,6 +181,7 @@ class GiBUUOutput:
df = df.append(tmp_df) df = df.append(tmp_df)
df.columns = [col[0] for col in df.columns] df.columns = [col[0] for col in df.columns]
df["By"] = 1 - df.lepOut_E / df.lepIn_E df["By"] = 1 - df.lepOut_E / df.lepIn_E
df["xsec_wgt"] = self._event_weights(df)
return df return df
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment