PMNS_Base.cxx
//.....................................................................
///
/// Compute the average probability of nu_in going to flvf
/// over a bin of L/E with width dLoE.
///
/// The probabilities are weighted by (L/E)^-2 so that event
/// density is flat in energy. This avoids giving too much
/// weight to low energies. Better approximations would be
/// achieved if we used an interpolated event density.
///
/// This function works best for single paths.
/// In multiple paths the accuracy may be somewhat worse.
/// If needed, average over smaller L/E ranges.
///
/// Flavours are:
/// <pre>
///   0 = nue, 1 = numu, 2 = nutau
///   3 = sterile_1, 4 = sterile_2, etc.
/// </pre>
/// @param nu_in - The neutrino intial state in flavour basis.
/// @param flvf  - The neutrino final flavour.
/// @param LoE   - The neutrino  L/E value in the bin center in km/GeV
/// @param dLoE  - The L/E bin width in km/GeV
///
/// @return Average neutrino oscillation probability
///
Compute the average probability of nu_in going to flvf
over a bin of L/E with width dLoE.

The probabilities are weighted by (L/E)^-2 so that event
density is flat in energy. This avoids giving too much
weight to low energies. Better approximations would be
achieved if we used an interpolated event density.

This function works best for single paths.
In multiple paths the accuracy may be somewhat worse.
If needed, average over smaller L/E ranges.


Compute the average probability of nu_in going to flvf over a bin of L / E with width dLoE . The probabilities are weighted by ( L / E ) ^ - 2 so that event density is flat in energy . This avoids giving too much weight to low energies . Better approximations would be achieved if we used an interpolated event density . This function works best for single paths . In multiple paths the accuracy may be somewhat worse . If needed average over smaller L / E ranges .
double PMNS_Base::AvgProbLoE(std::vector<complexD> nu_in, int flvf, double LoE, double dLoE)
{
  if(LoE<=0) return 0;
  if(fNuPaths.empty()) return 0;
  SetCurPath(AvgPath(fNuPaths));
  SetEnergy(fPath.length/LoE);
  if(dLoE<=0) return Prob(nu_in, flvf);
  vector<double> samples = GetSamplePoints(LoE, dLoE);
  double sumw = 0;
  double prob = 0;
  double length = fPath.length;
  for(int j=0; j<int(samples.size()); j++){
    double w = 1./pow(samples[j],2);
    prob += w * Prob(nu_in, flvf, length / samples[j]);
    sumw += w;
  }
  return prob / sumw;
}
double PMNS_Base :: AvgProbLoE ( std :: vector < complexD > nu_in , int flvf , double LoE , double dLoE ) { if ( LoE <= 0 ) return 0 ; if ( fNuPaths . empty ( ) ) return 0 ; SetCurPath ( AvgPath ( fNuPaths ) ) ; SetEnergy ( fPath . length / LoE ) ; if ( dLoE <= 0 ) return Prob ( nu_in , flvf ) ; vector < double > samples = GetSamplePoints ( LoE , dLoE ) ; double sumw = 0 ; double prob = 0 ; double length = fPath . length ; for ( int j = 0 ; j < int ( samples . size ( ) ) ; j ++ ) { double w = 1. / pow ( samples [ j ] , 2 ) ; prob += w * Prob ( nu_in , flvf , length / samples [ j ] ) ; sumw += w ; } return prob / sumw ; }
.....................................................................
Compute the average probability of nu_in going to flvf
over a bin of L/E with width dLoE.
..................................................................... Compute the average probability of nu_in going to flvf over a bin of L / E with width dLoE .
// Do nothing if L/E is not positive // Make sure fPath is set // Use average if multiple paths // Set the energy at bin center // Don't average zero width // Get sample points for this bin // Variables to fill sample // probabilities and weights // Loop over all sample points // Set (L/E)^-2 weights // Add weighted probability // Increment sum of weights // Return weighted average of probabilities