#ifndef __JAANET__JATMOSPHERICNEUTRINOFLUX__ #define __JAANET__JATMOSPHERICNEUTRINOFLUX__ #include "flux/Flux.hh" #include "JAAnet/JEvtWeightFactorFunction.hh" #include "JAAnet/JOscFlux.hh" #include "JOscProb/JOscProbFunction.hh" #include "JOscProb/JOscProbInterpolator.hh" /** * \author bjung */ namespace JAANET {} namespace JPP { using namespace JAANET; } namespace JAANET { using JOSCPROB::make_oscProbFunction; using JOSCPROB::JOscProbInterpolator; using JOSCPROB::JOscProbFunction; using JOSCPROB::JOscParameters; /** * Implementation of atmospheric neutrino flux using official KM3NeT atmospheric flux function. * */ struct JAtmosphericNeutrinoFlux : public JOscFlux { /** * Default constructor. */ JAtmosphericNeutrinoFlux() {} /** * Constructor. * * \param oscProbInterface oscillation probability interface */ explicit JAtmosphericNeutrinoFlux(const JOscProb& oscProbInterface) : JOscFlux(make_diffuseFluxFunction(Flux_Atmospheric()), oscProbInterface) {} /** * Constructor. * * The template argument refers to an oscillation probability function object or pointer. * For this, the copy constructor needs to be defined * * \param oscProbFunction oscillation probability function object */ template explicit JAtmosphericNeutrinoFlux(const JOscProbFunction& oscProbFunction) : JAtmosphericNeutrinoFlux(static_cast(oscProbFunction)) {} /** * Constructor. * * The template argument refers to an oscillation probability function object or pointer. * For this, the copy constructor needs to be defined * * \param oscProbCalculator oscillation probability calculator */ template JAtmosphericNeutrinoFlux(const JOscProbFunction_t& oscProbCalculator) : JAtmosphericNeutrinoFlux(make_oscProbFunction(oscProbCalculator)) {} }; /** * Auxiliary method for creating an interface to an atmospheric neutrino flux function\n * using an oscillation probability interpolation table. * * \param oscProbTableFile oscillation probability interpolation table * \param oscParameters oscillation parameters */ template > inline JEvtWeightFactorFunction make_atmosphericNeutrinoFluxFunction(const std::string& oscProbTableFile, const JOscParameters& oscParameters) { const JOscProbInterpolator_t interpolator(oscProbTableFile.c_str(), oscParameters); const JAtmosphericNeutrinoFlux flux(interpolator); return make_fluxFunction(flux); } } #endif