Skip to content

Commit

Permalink
add some usefule logs
Browse files Browse the repository at this point in the history
  • Loading branch information
giacomomagni committed Jul 24, 2024
1 parent 58d6b38 commit 04a56f7
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/pineko/comparator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import numpy as np
import pandas as pd
import pineappl
import rich


def compare(pine, fktable, max_as, max_al, pdf1, xir, xif, pdf2=None):
Expand Down Expand Up @@ -44,6 +45,25 @@ def compare(pine, fktable, max_as, max_al, pdf1, xir, xif, pdf2=None):
try:
parton1 = int(pine.key_values()["convolution_particle_1"])
parton2 = int(pine.key_values()["convolution_particle_2"])

if (
fktable.key_values()["convolution_type_1"]
!= pine.key_values()["convolution_type_1"]
or fktable.key_values()["convolution_type_2"]
!= pine.key_values()["convolution_type_2"]
):
raise ValueError(
"Grids and FkTables do not have the same convolution types"
)

# log some useful info to check if PDFs are swapped
rich.print(
f"[yellow]Convolution type 1: {fktable.key_values()['convolution_type_1']}, PDF 1: {pdf1}"
)
rich.print(
f"[yellow]Convolution type 2: {fktable.key_values()['convolution_type_2']}, PDF 2: {pdf2}"
)

except KeyError:
parton1 = int(pine.key_values()["initial_state_1"])
parton2 = int(pine.key_values()["initial_state_2"])
Expand Down

0 comments on commit 04a56f7

Please sign in to comment.