Skip to content

Commit

Permalink
Add temporary fix to datasets forced to be iso in nuclear
Browse files Browse the repository at this point in the history
  • Loading branch information
Radonirinaunimi committed Jun 29, 2023
1 parent 2b770ea commit 0217618
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
16 changes: 9 additions & 7 deletions n3fit/src/n3fit/layers/DIS.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ def construct_pdf(pdf, target, m_mask, n_mask):

# Compute bound-neutron PDF out of the bound-proton and construct
# the nuclear-PDFs to be convoluted with the FK tables.
if a_value != z_value:
neutron_pdf = op.extract_neutron_pdf(pdf, n_mask)
neutron_pdf_masked = op.boolean_mask(neutron_pdf, m_mask, axis=2)
# Compute nulcear/proton PDF out of the bound-neutron/proton PDFs
pdf_masked = z_value * pdf_masked + (a_value - z_value) * neutron_pdf_masked
# TODO: Check the Normalization if Applicable to ALL observables
pdf_masked /= a_value

# # TODO: Skip the following depending on the specific dataset
# if a_value != z_value:
# neutron_pdf = op.extract_neutron_pdf(pdf, n_mask)
# neutron_pdf_masked = op.boolean_mask(neutron_pdf, m_mask, axis=2)
# # Compute nulcear/proton PDF out of the bound-neutron/proton PDFs
# pdf_masked = z_value * pdf_masked + (a_value - z_value) * neutron_pdf_masked
# # TODO: Check the Normalization if Applicable to ALL observables
# pdf_masked /= a_value

return pdf_masked

Expand Down
16 changes: 15 additions & 1 deletion n3fit/src/n3fit/layers/observable.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,21 @@ def generate_neutron_mask(number_fl):
proton ones. Assumming `isospin asymmetry` the relation between
the two bound PDFs is trivial. Basically, the bound-neutron PDFs
are extracted from the proton counterpart by adding a `minus` sign
to T3 and V3."""
to T3 and V3.
Parameters
----------
number_fl: list
`number_fl`-PDF in evolution basis (according to FK tables
this should always be 14)
Returns
-------
generate_neutron_mask: tf.tensor
tensor object that defines the appropriate sign to each
PDF flavour
"""

# TODO: Make this modular depending on the Fitting Basis
neutron_mask = np.ones(number_fl)
Expand Down

0 comments on commit 0217618

Please sign in to comment.