Neutrino Solution (NuSol) Module
The NuSol sub-package provides analytical single and double neutrino
reconstruction using ellipse intersection methods. It exposes both a
high-level C++ nusol class and a batch-capable CUDA/LibTorch interface
(nusol_ namespace — see Neutrino Reconstruction (pyc)).
Entry Point
nusol_enum selects between the two reconstruction back-ends:
-
enum class nusol_enum
Selects the neutrino reconstruction algorithm.
Values:
-
enumerator ellipse
Use the analytic ellipse intersection method (arxiv:1305.1878).
-
enumerator conuix
Use the generalised n-neutrino Conuix method.
-
enumerator undefined
No algorithm selected.
-
enumerator ellipse
-
struct nusol_t
Run parameters for the neutrino reconstruction.
Public Members
-
double met = 0
Missing transverse energy magnitude in MeV.
-
double phi = 0
Azimuthal angle of the MET vector.
-
double mt = 172.68 * 1000
Top-quark mass constraint in MeV (default 172.68 GeV).
-
double mw = 80.385 * 1000
W-boson mass constraint in MeV (default 80.385 GeV).
-
double violation = 0.00001
Acceptable mass-constraint violation (default 1e-5).
-
double limit = 0.1
Maximum allowed ΔR between the MET vector and the reconstructed neutrino (default 0.1).
-
int iterations = 10
Maximum number of solver iterations (default 10).
-
nusol_enum mode = nusol_enum::undefined
Algorithm selector.
-
std::vector<particle_template*> *targets = nullptr
Pointer to the list of input particles (b-quarks and leptons).
-
std::vector<std::pair<particle_template*, particle_template*>> *phys_pairs = nullptr
Pointer to a list of pre-specified (b, lepton) pairs. If
nullptr, all combinations are tried.
-
double met = 0
-
class nusol : private notification, private tools
Top-level neutrino reconstruction orchestrator.
Inherits
notificationandtools. Dispatches toellipseorconuixbased onnusol_t::mode.Public Functions
-
nusol(nusol_t *parameters)
Construct the solver with the given parameters.
- Parameters:
parameters – Pointer to
nusol_t.
-
std::vector<particle_template*> solve()
Run the reconstruction and return reconstructed neutrino candidates.
- Returns:
Vector of dynamically allocated
particle_templateobjects (caller takes ownership).
-
~nusol()
Destructor.
-
nusol(nusol_t *parameters)
Ellipse Utilities
mtx is a minimal dense matrix class used throughout the analytical
ellipse-intersection solver. All matrix operations are implemented without
external BLAS dependencies.
-
class mtx
Dense real matrix with element-wise validity tracking.
Public Functions
-
mtx()
Default constructor (zero-sized).
-
mtx(int idx, int idy)
Construct an
idx×idymatrix initialised to zero.- Parameters:
idx – Number of rows.
idy – Number of columns.
-
~mtx()
Destructor.
-
double trace()
Compute the matrix trace.
- Returns:
Sum of diagonal elements.
-
double det()
Compute the matrix determinant.
- Returns:
Determinant.
-
void copy(const mtx *ipt, int idx, int idy = -1)
Copy row
idx(and optionally columnidy) fromipt.- Parameters:
ipt – Source.
idx – Row index.
idy – Column index (-1 = all columns).
-
bool assign(int idx, int idy, double val, bool valid = true)
Set element
(idx,idy) tovalwith validity flagvalid.- Returns:
trueon success.
-
bool unique(int id1, int id2, double v1, double v2)
Set a pair of elements only if they are not already equal to
v1andv2respectively.- Returns:
trueif the assignment was performed.
-
mtx *cat(const mtx *v2)
Concatenate
v2as new columns to*this.- Returns:
Pointer to a new matrix (caller must delete).
-
mtx *slice(int idx)
Extract column
idxas a column vector.- Parameters:
idx – Column index.
- Returns:
Pointer to a new column-vector matrix.
-
mtx *eigenvalues()
Compute eigenvalues of a 3×3 matrix.
- Returns:
Pointer to a 3×1 matrix of eigenvalues.
-
mtx *eigenvector()
Compute eigenvectors of a 3×3 matrix.
- Returns:
Pointer to a 3×3 matrix whose columns are eigenvectors.
-
mtx diag()
Return a diagonal matrix constructed from the diagonal of
*this.- Returns:
Diagonal matrix.
-
mtx dot(const mtx &other)
Matrix-matrix product.
- Parameters:
other – Right-hand factor.
- Returns:
Product matrix.
-
mtx dot(const mtx *other)
Matrix-matrix product (pointer overload).
- Parameters:
other – Pointer to the right-hand factor.
- Returns:
Product matrix.
-
mtx cross(mtx *r1)
Cross product of two 3-vectors.
- Parameters:
r1 – Second vector.
- Returns:
Cross-product vector.
-
bool valid(int idx, int idy)
Test whether element
(idx,idy) has a valid flag.- Returns:
trueif valid.
-
void print(int prec = 6, int width = 12)
Print the matrix to stdout with
precdecimal digits.- Parameters:
prec – Decimal precision (default 6).
width – Column width (default 12).
-
double m_00()
-
double m_01()
-
double m_02()
-
double m_10()
-
double m_11()
-
double m_12()
-
double m_20()
-
double m_21()
-
double m_22()
-
mtx()
Constrained Neutrino Solutions
conuix orchestrates multi-neutrino reconstruction by creating one
conuic instance per lepton–b-jet pair and merging the solutions.
-
class conuix
Orchestrates multi-pair Conuix neutrino reconstruction.
Public Functions
-
conuix(nusol_t *params)
Construct and initialise all
conuicsub-solvers.- Parameters:
params – Pointer to the
nusol_trun parameters.
-
~conuix()
Destructor. Frees all owned
conuicobjects.
-
std::vector<particle_template*> nunu_make()
Run all sub-solvers and build the reconstructed neutrino candidates.
- Returns:
Vector of reconstructed
particle_templateobjects.
-
conuix(nusol_t *params)
conuic implements the single-neutrino constrained solver. It finds the
neutrino momentum that simultaneously satisfies the W-mass and top-mass
constraints using the Möbius-parametrisation approach.
-
class conuic
Single b–lepton neutrino solver via Möbius / pencil-of-conics.
Public Functions
-
conuic(particle_template *jet, particle_template *lep)
Construct the solver for the (b-jet, lepton) pair.
- Parameters:
jet – Pointer to the b-jet.
lep – Pointer to the lepton.
-
~conuic()
Destructor.
-
long double Z2(long double Sx, long double Sy)
Evaluate Z² from the shift parameters.
- Parameters:
Sx – x-shift.
Sy – y-shift.
- Returns:
Z².
-
long double Sx(long double Tau, long double Z)
Evaluate S_x from (τ, Z).
- Parameters:
Tau – τ parameter.
Z – Z parameter.
- Returns:
S_x.
-
long double Sy(long double Tau, long double Z)
Evaluate S_y from (τ, Z).
- Returns:
S_y.
-
long double x1(long double t, long double Z)
Return the x₁ coordinate of the neutrino.
-
long double y1(long double t, long double Z)
Return the y₁ coordinate of the neutrino.
-
bool get_TauZ(long double sx, long double sy, long double *z, long double *t)
Compute (τ, Z) from the given (S_x, S_y) values.
- Parameters:
sx – S_x value.
sy – S_y value.
z – Output Z.
t – Output τ.
- Returns:
trueon success.
-
long double P(long double l, long double t, long double Z)
Evaluate the characteristic polynomial P(λ, τ, Z).
- Parameters:
l – Lambda.
t – τ.
Z – Z.
- Returns:
P value.
-
long double dPdt(long double l, long double t, long double Z)
Evaluate ∂P/∂τ.
- Returns:
Derivative value.
-
long double dPdtL0(long double t, long double Z)
-
long double dPl0(long double t)
-
void dPdZ0(long double z, long double t, std::complex<long double> *l1, std::complex<long double> *l2)
-
matrix_t Hmatrix(long double t, long double Z)
-
matrix_t Nmatrix(long double t, long double Z)
-
bool mass_line(long double mW, long double mT, std::complex<long double> *z_ = nullptr, long double *t_ = nullptr)
Find the point on the mass line (mW, mT) closest to the neutrino ellipse.
- Parameters:
mW – W-boson mass constraint.
mT – Top-quark mass constraint.
z_ – Output Z value.
t_ – Output τ value.
- Returns:
trueif a solution was found.
-
void debug()
Print diagnostic information to stdout.
Public Members
-
long double tstar = 0
Optimal τ value found by the solver.
-
long double error = 0
Residual penalty at
tstar.
-
long double theta = 0
Angle associated with the optimal solution.
-
bool converged = false
trueif the solver converged.
-
matrix_t vstar
Neutrino four-momentum vector at the optimal
tstar.
-
conuic(particle_template *jet, particle_template *lep)
Conuix Internal Structs (Conuix namespace)
-
struct atomics_t : public Conuix::debug
Master cache struct that pre-computes all kinematic constants for a single (b-jet, lepton) pair needed by the Conuix solver.
Inherits
Conuix::debug.Public Functions
-
atomics_t(particle_template *jet, particle_template *lep, double m_nu = 0)
Construct and pre-compute all constants.
- Parameters:
jet – Pointer to the b-jet.
lep – Pointer to the lepton.
m_nu – Neutrino mass hypothesis (default 0).
-
~atomics_t() override
Destructor.
-
long double x1(long double Z, long double t)
Evaluate the x₁ neutrino coordinate.
-
long double y1(long double Z, long double t)
Evaluate the y₁ neutrino coordinate.
-
bool GetTauZ(long double sx, long double sy, long double *z, long double *t)
Invert (S_x, S_y) → (τ, Z).
- Returns:
trueon success.
-
void masses(long double Z, long double t, std::complex<long double> *mw, std::complex<long double> *mt)
Compute the W and top masses corresponding to (Z, τ).
- Parameters:
Z – Z parameter.
t – τ parameter.
mw – Output W mass.
mt – Output top mass.
-
void eigenvector(long double tau, matrix_t *vstar, long double *theta_s)
Compute the eigenvector at
tauand its associated angle.- Parameters:
tau – τ value.
vstar – Output eigenvector.
theta_s – Output angle.
-
void debug_mode(particle_template *jet, particle_template *lep)
Public Members
-
Conuix::kinematic_t lp
-
Conuix::kinematic_t jt
-
Conuix::kinematic_t nu
-
Conuix::rotation_t rotation
-
Conuix::thetapsi_t psi_theta
-
Conuix::H_matrix_t H_Matrix
-
atomics_t(particle_template *jet, particle_template *lep, double m_nu = 0)
-
struct kinematic_t : public Conuix::debug
Compact kinematics for one particle (β, mass, energy).
Public Functions
-
virtual void print(int p = 16) override
-
virtual void print(int p = 16) override
-
struct rotation_t : public Conuix::debug
Rotation from the decay frame to the lab frame (φ, θ, R^T).
Public Functions
-
virtual void print(int p = 16) override
-
virtual void print(int p = 16) override
-
struct base_t : public Conuix::debug
Base kinematic constants used to construct the pencil of conics.
Stores the (ω, Ω, β, cos/sin, …) constants shared by all subsequent pencil evaluations.
Public Functions
-
virtual void print(int p = 16) override
-
virtual void print(int p = 16) override
-
struct pencil_t : public Conuix::debug
Pencil-of-conics polynomial coefficients.
-
struct Sx_t : public Conuix::debug
Polynomial coefficients for the S_x shift.
-
struct Sy_t : public Conuix::debug
Polynomial coefficients for the S_y shift.
-
struct H_matrix_t : public Conuix::debug
H̄ and H matrix components (tau-independent, sin, cos parts).
-
struct Mobius_t : public Conuix::debug
Möbius transform coefficients and the τ* minimiser.
The Möbius transform maps the conic pencil parameter λ to the neutrino parameter τ.
Mobius_tstores the four Möbius coefficients (a, b, c, d), the eigenvalues, and the result of the τ* minimisation.Public Functions
-
long double alpha_p(long double u)
-
long double alpha_m(long double u)
-
long double P(long double z, long double l, long double t)
-
long double dPdt(long double z, long double l, long double t)
-
long double dPdtL0(long double z, long double t)
-
long double dPl0(long double x, bool use_tanh = false)
Public Members
-
long double a
-
long double b
-
long double c
-
long double d
-
long double pole1 = 0
-
long double pole2 = 0
-
long double a_
-
long double b_
-
std::complex<long double> eig_v1
-
std::complex<long double> eig_v2
-
std::complex<long double> eig_vx[2]
-
std::complex<long double> eig_vy[2]
-
std::complex<long double> kfactor
-
std::complex<long double> f1_pts
-
std::complex<long double> f2_pts
-
std::complex<long double> mid
-
long double error = 0
-
long double tstar = 0
-
bool converged = false
-
long double alpha_p(long double u)
ODE Runge–Kutta Multi-Neutrino Solver
odeRK implements a fourth-order Runge–Kutta ODE integrator used by the
multi-solution multisol back-end to evolve ellipse states until
convergence.
-
class odeRK : public tools
RK4 integrator for multi-neutrino ellipse alignment.
Inherits
tools.Public Functions
-
odeRK(std::vector<multisol*> *sols, vec3 met, int iter, double step)
Construct the integrator.
- Parameters:
sols – Pointer to the list of
multisolsurfaces to integrate.met – MET three-vector.
iter – Maximum number of RK4 steps.
step – Step size Δt.
-
~odeRK()
Destructor.
-
void solve()
Run the full RK4 integration and populate
_state.
-
void rk4(double dt)
Perform one RK4 step with step size
dt.- Parameters:
dt – Step size.
-
void update_t()
Update all t parameters from the current state.
-
double solve_z_phi()
Solve for the z and φ parameters that minimise the MET residual.
- Returns:
Residual at the solution.
-
double residual(std::vector<double> wg, std::vector<double> phx)
Evaluate the MET residual for the given angles.
- Parameters:
wg – Weights / z values.
phx – φ values.
- Returns:
Residual.
-
std::vector<ellipse_t> derivative(const std::vector<ellipse_t> &dS)
Compute the time derivative of the state
dS.- Returns:
Derivative state.
-
double ghost_angle(int nui)
-
std::vector<double> plane_rk4(const std::vector<double> &t_initial)
-
odeRK(std::vector<multisol*> *sols, vec3 met, int iter, double step)
-
struct ellipse_t
State vector for one neutrino ellipse at a given (t, z).
Public Functions
-
void print()
-
void print()
-
struct recon_t
Reconstruction result for a single di-neutrino configuration.
Public Members
-
bool is_valid = false
trueif a valid solution was found.
-
double residual = -1
MET residual (lower = better; default -1 = not computed).
-
std::vector<double> t
Optimal t values for each neutrino.
-
std::vector<double> z
Optimal z values for each neutrino.
-
std::vector<double> phi
Optimal φ values for each neutrino.
-
bool is_valid = false