Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIREN compatibility changes #39

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/DarkNews/integrands.py
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ def get_momenta_from_vegas_samples(vsamples, MC_case):
return four_momenta


def get_decay_momenta_from_vegas_samples(vsamples, decay_case, PN_LAB):
def get_decay_momenta_from_vegas_samples(vsamples, decay_case, PN_LAB, rng=None):
"""
Construct the four momenta of all final state particles in the decay process from the
vegas weights.
Expand All @@ -684,10 +684,12 @@ def get_decay_momenta_from_vegas_samples(vsamples, decay_case, PN_LAB):
vsamples (np.ndarray): integration samples obtained from vegas
as hypercube coordinates. Always in the interval [0,1].

MC_case (DarkNews.process.dec_case): the decay class of DarkNews
decay_case (DarkNews.process.dec_case): the decay class of DarkNews

PN_LAB (np.ndarray): four-momentum of the upscattered N in the lab frame: [E, pX, pY, pZ]

rng: random number generating function that can be passed to phase_space function calls

Returns:
dict: each key corresponds to a set of four momenta for a given particle involved,
so the values are 2D np.ndarrays with each row a different event and each column a different
Expand Down Expand Up @@ -732,7 +734,7 @@ def get_decay_momenta_from_vegas_samples(vsamples, decay_case, PN_LAB):
"m3": m_mediator, # Z'
}
# Phnl, Phnl_daughter, Pz'
P1LAB_decay, P2LAB_decay, P3LAB_decay = phase_space.two_body_decay(N_decay_samples, boost=boost_scattered_N, **masses_decay, rng=MC_case.rng)
P1LAB_decay, P2LAB_decay, P3LAB_decay = phase_space.two_body_decay(N_decay_samples, boost=boost_scattered_N, **masses_decay)

# Z' boost parameters
boost_Z = {
Expand All @@ -751,7 +753,7 @@ def get_decay_momenta_from_vegas_samples(vsamples, decay_case, PN_LAB):
"m3": mm, # \ell-
}
# PZ', pe-, pe+
P1LAB_decayZ, P2LAB_decayZ, P3LAB_decayZ = phase_space.two_body_decay(Z_decay_samples, boost=boost_Z, **masses_decay, rng=MC_case.rng)
P1LAB_decayZ, P2LAB_decayZ, P3LAB_decayZ = phase_space.two_body_decay(Z_decay_samples, boost=boost_Z, **masses_decay)

four_momenta["P_decay_N_parent"] = P1LAB_decay
four_momenta["P_decay_N_daughter"] = P2LAB_decay
Expand Down Expand Up @@ -782,7 +784,7 @@ def get_decay_momenta_from_vegas_samples(vsamples, decay_case, PN_LAB):
P2LAB_decay,
P3LAB_decay,
P4LAB_decay,
) = phase_space.three_body_decay(N_decay_samples, boost=boost_scattered_N, **masses_decay, rng=MC_case.rng)
) = phase_space.three_body_decay(N_decay_samples, boost=boost_scattered_N, **masses_decay)

four_momenta["P_decay_N_parent"] = P1LAB_decay
four_momenta["P_decay_ell_minus"] = P2LAB_decay
Expand All @@ -804,7 +806,7 @@ def get_decay_momenta_from_vegas_samples(vsamples, decay_case, PN_LAB):
"m3": 0.0, # gamma
}
# Phnl, Phnl', Pgamma
P1LAB_decay, P2LAB_decay, P3LAB_decay = phase_space.two_body_decay(N_decay_samples, boost=boost_scattered_N, **masses_decay, rng=MC_case.rng)
P1LAB_decay, P2LAB_decay, P3LAB_decay = phase_space.two_body_decay(N_decay_samples, boost=boost_scattered_N, **masses_decay)

four_momenta["P_decay_N_parent"] = P1LAB_decay
four_momenta["P_decay_N_daughter"] = P2LAB_decay
Expand Down
4 changes: 2 additions & 2 deletions src/DarkNews/processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,12 +279,12 @@ def __init__(self, nu_parent, nu_daughter, final_lepton1, final_lepton2, TheoryM

## Is the mediator on shell?
self.vector_on_shell = (
(TheoryModel.mzprime is not None) and (self.m_parent - self.m_daughter > TheoryModel.mzprime) and (TheoryModel.mzprime > self.mm + self.mp)
(TheoryModel.mzprime is not None) and (self.m_parent - self.m_daughter > TheoryModel.mzprime) and (TheoryModel.mzprime > self.mm + self.mp) and (self.Dih>0)
)
self.vector_off_shell = not self.vector_on_shell

self.scalar_on_shell = (
(TheoryModel.mhprime is not None) and (self.m_parent - self.m_daughter > TheoryModel.mhprime) and (TheoryModel.mhprime > self.mm + self.mp)
(TheoryModel.mhprime is not None) and (self.m_parent - self.m_daughter > TheoryModel.mhprime) and (TheoryModel.mhprime > self.mm + self.mp) and (self.Sih>0)
)
self.scalar_off_shell = not self.scalar_on_shell

Expand Down
Loading