PMNS_Base.cxx
//.....................................................................
///
/// Compute the average probability of nu_in going to flvf
/// over a bin of energy E with width dE.
///
/// This gets transformed into L/E, since the oscillation terms
/// have arguments linear in L/E and not E.
///
/// This function works best for single paths.
/// In multiple paths the accuracy may be somewhat worse.
/// If needed, average over smaller energy ranges.
///
/// Flavours are:
/// <pre>
///   0 = nue, 1 = numu, 2 = nutau
///   3 = sterile_1, 4 = sterile_2, etc.
/// </pre>
/// @param nu_in - The neutrino initial state in flavour.
/// @param flvf  - The neutrino final flavour.
/// @param E     - The neutrino energy in the bin center in GeV
/// @param dE    - The energy bin width in GeV
///
/// @return Average neutrino oscillation probability
///
Compute the average probability of nu_in going to flvf
over a bin of energy E with width dE.

This gets transformed into L/E, since the oscillation terms
have arguments linear in L/E and not E.

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


Compute the average probability of nu_in going to flvf over a bin of energy E with width dE . This gets transformed into L / E since the oscillation terms have arguments linear in L / E and not E . This function works best for single paths . In multiple paths the accuracy may be somewhat worse . If needed average over smaller energy ranges .
double PMNS_Base::AvgProb(std::vector<complexD> nu_in, int flvf, double E, double dE)
{
  if(E<=0) return 0;
  if(fNuPaths.empty()) return 0;
  if(dE<=0) return Prob(nu_in, flvf, E);
  SetCurPath(AvgPath(fNuPaths));
  double LoE = 0;
  double dLoE = 0;
  double minE = 0.1 * E;
  if(E-dE/2 > minE){
    LoE = 0.5 * (fPath.length/(E-dE/2) + fPath.length/(E+dE/2));
    dLoE = fPath.length/(E-dE/2) - fPath.length/(E+dE/2);
  }
  else{
    LoE = 0.5 * (fPath.length/minE + fPath.length/(E+dE/2));
    dLoE = fPath.length/minE - fPath.length/(E+dE/2);
  }
  return AvgProbLoE(nu_in, flvf, LoE, dLoE);
}
double PMNS_Base :: AvgProb ( std :: vector < complexD > nu_in , int flvf , double E , double dE ) { if ( E <= 0 ) return 0 ; if ( fNuPaths . empty ( ) ) return 0 ; if ( dE <= 0 ) return Prob ( nu_in , flvf , E ) ; SetCurPath ( AvgPath ( fNuPaths ) ) ; double LoE = 0 ; double dLoE = 0 ; double minE = 0.1 * E ; if ( E - dE / 2 > minE ) { LoE = 0.5 * ( fPath . length / ( E - dE / 2 ) + fPath . length / ( E + dE / 2 ) ) ; dLoE = fPath . length / ( E - dE / 2 ) - fPath . length / ( E + dE / 2 ) ; } else { LoE = 0.5 * ( fPath . length / minE + fPath . length / ( E + dE / 2 ) ) ; dLoE = fPath . length / minE - fPath . length / ( E + dE / 2 ) ; } return AvgProbLoE ( nu_in , flvf , LoE , dLoE ) ; }
.....................................................................
Compute the average probability of nu_in going to flvf
over a bin of energy E with width dE.
..................................................................... Compute the average probability of nu_in going to flvf over a bin of energy E with width dE .
// Do nothing if energy is not positive // Don't average zero width // Make sure fPath is set // Use average if multiple paths // Define L/E variables // Set a minimum energy // Transform range to L/E // Full range if low edge > minE // Else start at minE // Compute average in LoE