20#include <unordered_set>
38 virtual double Prob(
vectorC nu_in,
int flvf,
double E,
46 virtual double Prob(
int flvi,
int flvf,
49 virtual double Prob(
int flvi,
int flvf,
double E,
89 vectorC nu_in,
int flvf,
double E,
93 vectorC nu_in,
int flvf,
double LoE,
99 int flvi,
int flvf,
double E,
103 int flvi,
int flvf,
double LoE,
123 int flvi,
double LoE,
129 int nflvi,
int nflvf,
double E,
133 int nflvi,
int nflvf,
double LoE,
145 virtual void SetDm(
int j,
149 virtual double GetAngle(
int i,
int j);
150 virtual double GetDelta(
int i,
int j);
151 virtual double GetDm(
int j);
170 virtual void SetPath(
double length,
double density,
double zoa = 0.5,
173 virtual void SetPath(std::vector<NuPath> paths);
176 virtual void AddPath(
double length,
double density,
double zoa = 0.5,
184 virtual void SetZoA(
double zoa);
190 std::vector<int> lay);
196 virtual std::vector<NuPath>
GetPath();
233 virtual void SetAtt(
double att,
Base class implementing general functions for computing neutrino oscillations.
virtual void Propagate()
Propagate neutrino through full path.
static const complexD zero
zero in complex
double fCachePrec
Precision of cache matching.
virtual double P(int flv)
Return the probability of final state in flavour flv.
bool fIsNuBar
Anti-neutrino flag.
virtual matrixD AvgProbMatrixLoE(int nflvi, int nflvf, double LoE, double dLoE=0)
Compute the average probability matrix over a bin of L/E.
virtual vectorD ConvertEtoLoE(double E, double dE)
virtual void SetZoA(double zoa)
Set Z/A value for single path.
virtual double AvgProbLoE(vectorC nu_in, int flvf, double LoE, double dLoE=0)
Compute the average probability over a bin of L/E.
virtual vectorD AvgProbVectorLoE(vectorC nu_in, double LoE, double dLoE=0)
Compute the average probability vector over a bin of L/E.
vectorC fNuState
The neutrino current state.
int fNumNus
Number of neutrino flavours.
std::vector< NuPath > fNuPaths
Vector of neutrino paths.
double fEnergy
Neutrino energy.
virtual vectorC GetMassEigenstate(int mi)
Get a neutrino mass eigenstate.
virtual void RotateH(int i, int j, matrixC &Ham)
Rotate the Hamiltonian by theta_ij and delta_ij.
virtual bool GetIsNuBar()
Get the anti-neutrino flag.
static const double kK2
mol/GeV^2/cm^3 to eV
std::unordered_set< EigenPoint > fMixCache
Caching set of eigensystems.
static const double kKm2eV
km to eV^-1
double fAvgProbPrec
AvgProb precision.
virtual void SetDm(int j, double dm)
Set the mass-splitting dm_j1 in eV^2.
virtual void SetDelta(int i, int j, double delta)
Set the CP phase delta_ij.
virtual void SetStdPars()
Set PDG 3-flavor parameters.
virtual double GetDmEff(int j)
Get the effective mass-splitting dm_j1 in eV^2.
virtual void PropagatePath(NuPath p)
Propagate neutrino through a single path.
virtual void SetLength(double L)
Set a single path lentgh in km.
matrixC fHms
matrix H*2E in eV^2
static const double kNA
Avogadro constant.
vectorC fBuffer
Buffer for neutrino state tranformations.
bool fGotES
Tag to avoid recalculating eigensystem.
virtual void SetIsNuBar(bool isNuBar)
Set the anti-neutrino flag.
virtual vectorD AvgProbVector(vectorC nu_in, double E, double dE=0)
virtual double AvgProb(vectorC nu_in, int flvf, double E, double dE=0)
Compute the average probability over a bin of energy.
int fMaxCache
Maximum cache size.
virtual void FillCache()
Cache the current eigensystem.
static const complexD one
one in complex
static const double kGf
G_F in units of GeV^-2.
matrixC fEvec
Eigenvectors of the Hamiltonian.
virtual double Prob(vectorC nu_in, int flvf)
Compute the probability of nu_in going to flvf.
virtual matrixD AvgProbMatrix(int nflvi, int nflvf, double E, double dE=0)
NuPath fPath
Current neutrino path.
virtual void SetLayers(std::vector< int > lay)
Set multiple path layer indices.
virtual ~PMNS_Base()
Destructor.
virtual void SolveHam()=0
virtual void AddPath(NuPath p)
Add a path to the sequence.
virtual void SetEnergy(double E)
Set the neutrino energy in GeV.
vectorD fEval
Eigenvalues of the Hamiltonian.
bool fBuiltHms
Tag to avoid rebuilding Hms.
PMNS_Base(int numNus=3)
Constructor.
virtual void SetUseCache(bool u=true)
Set caching on/off.
virtual void SetCurPath(NuPath p)
Set the path currently in use by the class.
vectorC fPhases
Buffer for oscillation phases.
EigenPoint fProbe
EigenpPoint to try.
vectorD fDm
m^2_i - m^2_1 in vacuum
virtual void SetPath(NuPath p)
Set a single path.
virtual void SetAvgProbPrec(double prec)
Set the AvgProb precision.
virtual void SetAtt(double att, int idx)
Set one of the path attributes.
virtual bool TryCache()
Try to find a cached eigensystem.
virtual void ResetToFlavour(int flv)
Reset neutrino state to pure flavour flv.
virtual void SetPureState(vectorC nu_in)
Set the initial state from a pure state.
virtual void ClearCache()
Clear the cache.
matrixD fDelta
delta[i][j] CP violating phase
virtual void SetDensity(double rho)
Set single path density in g/cm^3.
virtual std::vector< NuPath > GetPath()
Get the neutrino path sequence.
virtual vectorD ProbVector(vectorC nu_in)
virtual double GetEnergy()
Get the neutrino energy in GeV.
virtual void SetAngle(int i, int j, double th)
Set the mixing angle theta_ij.
virtual double GetAngle(int i, int j)
Get the mixing angle theta_ij.
virtual void BuildHms()
Build the matrix of masses squared.
virtual double GetDm(int j)
Get the mass-splitting dm_j1 in eV^2.
bool fUseCache
Flag for whether to use caching.
static const double kGeV2eV
GeV to eV.
virtual double GetDelta(int i, int j)
Get the CP phase delta_ij.
virtual void SetStdPath()
Set standard neutrino path.
virtual void InitializeVectors()
virtual void RotateState(int i, int j)
Rotate the neutrino state by theta_ij and delta_ij.
virtual void SetMaxCache(int mc=1e6)
Set max cache size.
virtual vectorD GetSamplePoints(double LoE, double dLoE)
Compute the sample points for a bin of L/E with width dLoE.
virtual void ClearPath()
Clear the path vector.
virtual std::vector< int > GetSortedIndices(const vectorD x)
Get indices that sort a vector.
virtual matrixD ProbMatrix(int nflvi, int nflvf)
Compute the probability matrix.
matrixD fTheta
theta[i][j] mixing angle
virtual vectorD GetProbVector()
Some useful general definitions.
std::complex< double > complexD
std::vector< complexD > vectorC
std::vector< double > vectorD
std::vector< vectorD > matrixD
std::vector< vectorC > matrixC
Struct to organise eigensystems for caching.
An index sorting comparator.
const vectorD target
Attribute to store the target vector.
bool operator()(int a, int b) const
Compare elements a and b of target vector.
IdxCompare(const vectorD &target)
Take in a target vector.
A struct representing a neutrino path segment.