1 #ifndef __JAANET__JEVTWEIGHTFACTORHELPER__
2 #define __JAANET__JEVTWEIGHTFACTORHELPER__
18 namespace JPP {
using namespace JAANET; }
28 template<
class JEvtWeightFactor_t>
30 public std::shared_ptr<JEvtWeightFactor_t>
63 JEvtWeightFactor_t* p =
dynamic_cast<JEvtWeightFactor_t*
>(factor.clone());
68 THROW(JNullPointerException,
"JEvtWeightFactorHelper::configure(): Invalid downcast to class derived from JEvtWeightFactor.");
82 if (static_cast<const JEvtWeightFactorHelper_t&>(*
this)) {
83 return *(this->
get());
85 THROW(JNullPointerException,
"JEvtWeightFactorHelper::getEvtWeightFactor(): Event-weight factor is not set.");
100 return weightFactor.getFactor(evt);
110 public std::shared_ptr<JDiffuseFlux>
148 THROW(JNullPointerException,
"JDiffuseFluxHelper::configure(): Unable to retrieve diffuse flux interface.");
162 if (static_cast<const JDiffuseFluxHelper_t&>(*
this)) {
163 return *(this->
get());
165 THROW(JNullPointerException,
"JDiffuseFluxHelper::getDiffuseFlux(): Diffuse flux factor is not set.");
180 const double costh)
const
184 return diffuseFlux.
getFactor(type, log10E, costh);
std::shared_ptr< JDiffuseFlux > pointer_type
JEvtWeightFactorHelper()
Default constructor.
double getFactor(const Evt &evt) const override
Get event-weight factor for given event.
JEvtWeightFactorHelper< JEvtWeightFactor_t > JEvtWeightFactorHelper_t
JEvtWeightFactorHelper< JDiffuseFlux > JDiffuseFluxHelper
Type definition of event-weight factor helper for diffuse flux objects.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
std::shared_ptr< JEvtWeightFactor_t > pointer_type
virtual clone_type clone() const override
Get clone of this object.
double getFactor(const Evt &evt) const
Get weight-factor of given event.
void configure(const JDiffuseFlux &diffuseFlux)
Configure oscillation probability function.
JEvtWeightFactorHelper< JFlux > JFluxHelper
Type definition of event-weight factor helper for flux functions.
Explicit emplate specialization of event-weight factor helper for diffuse flux objects.
Helper class for event-weight factor.
Low-level interface for diffuse fluxes.
void configure(const JEvtWeightFactor_t &factor)
Configure event-weight factor.
JEvtWeightFactor_t & getEvtWeightFactor() const
Get reference to event-weight factor.
double getFactor(const Evt &evt) const
Get diffuse flux corresponding to given neutrino type, energy and zenith angle.
JDiffuseFlux & getDiffuseFlux() const
Get reference to diffuse flux factor.
JEvtWeightFactorHelper(const JEvtWeightFactor_t &factor)
Constructor.
then set_variable DETECTOR set_variable OUTPUT_FILE set_variable DAQ_FILE set_variable PMT_FILE else fatal Wrong number of arguments fi JPrintTree f $DAQ_FILE type
JEvtWeightFactorHelper()
Default constructor.
double getFactor(const int type, const double log10E, const double costh) const
Get diffuse flux corresponding to given neutrino type, energy and zenith angle.
JEvtWeightFactorHelper(const JDiffuseFlux &diffuseFlux)
Constructor.
JEvtWeightFactorHelper< JDiffuseFlux > JDiffuseFluxHelper_t
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.