Jpp  18.4.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | List of all members
JAANET::JAtmosphericNeutrinoFlux Struct Reference

Implementation of atmospheric neutrino flux using official KM3NeT atmospheric flux function. More...

#include <JAtmosphericNeutrinoFlux.hh>

Inheritance diagram for JAANET::JAtmosphericNeutrinoFlux:
JAANET::JOscFlux JLANG::JEquals< JFirst_t, JSecond_t > JLANG::JClonable< JClonable_t, JDerived_t > JAANET::JEvtWeightFactorHelper< JDiffuseFlux > JOSCPROB::JOscProbHelper

Public Types

typedef JClonable< JClonable_t >
::clone_type 
clone_type
 
typedef JEvtWeightFactorHelper
< JDiffuseFlux
JDiffuseFluxHelper_t
 
typedef std::shared_ptr
< JDiffuseFlux
pointer_type
 
typedef
JOscProbInterface::JOscParameters_t 
JOscParameters_t
 
typedef
JOscProbInterface::JParameter_t 
JParameter_t
 
typedef
JOscProbInterface::argument_type 
argument_type
 

Public Member Functions

 JAtmosphericNeutrinoFlux ()
 Default constructor. More...
 
 JAtmosphericNeutrinoFlux (const JOscProbInterface &oscProbInterface)
 Constructor. More...
 
template<class JFunction_t >
 JAtmosphericNeutrinoFlux (const JOscProbFunction< JFunction_t > &oscProbFunction)
 Constructor. More...
 
template<class JOscProbFunction_t >
 JAtmosphericNeutrinoFlux (const JOscProbFunction_t &oscProbCalculator)
 Constructor. More...
 
double operator() (const Evt &evt) const
 Get flux for given event. More...
 
bool equals (const JOscFlux &object) const
 Check if this flux is equal to given flux. More...
 
double getFactor (const Evt &evt) const override
 Get event-weight factor for given event. More...
 
double getFactor (const int type, const double log10E, const double costh) const
 Get diffuse flux corresponding to given neutrino type, energy and zenith angle. More...
 
virtual clone_type clone () const override
 Get clone of this object. More...
 
void configure (const JDiffuseFlux &diffuseFlux)
 Configure oscillation probability function. More...
 
void configure (const JOscProbInterface &oscProb)
 Configure oscillation probability function. More...
 
JDiffuseFluxgetDiffuseFlux () const
 Get reference to diffuse flux factor. More...
 
JOscProbInterfacegetOscProbInterface () const
 Get reference to oscillation probability interface. More...
 
JOscParameters_tgetParameters () const
 Get reference to oscillation parameters interface. More...
 
void set (const JOscParameters_t &parameters) const
 Set oscillation parameters. More...
 
virtual void set (const std::string &name, const argument_type &value) const
 Set value for a given oscillation parameter. More...
 
template<class... Args>
void set (const std::string &name, const argument_type &value, const Args &...args) const
 Set value for given list of oscillation parameters. More...
 
double getP (const JOscChannel &channel, const double energy, const double costh) const
 Get oscillation probability corresponding to given oscillation channel, neutrino energy and zenith angle. More...
 
double getP (const JOscParameters_t &parameters, const JOscChannel &channel, const double energy, const double costh) const
 Get oscillation probability for a given set of oscillation parameters
and a given oscillation channel. More...
 
double getP (const std::string &name, const double value, const JOscChannel &channel, const double E, const double costh) const
 Get oscillation probability for a given oscillation parameter
and a given oscillation channel. More...
 
template<class... Args>
double getP (const std::string &name, const double value, const Args &...args) const
 Get oscillation probability for a given set of oscillation parameters
and a given oscillation channel. More...
 
virtual double getCosth (const double L) const
 Get cosine zenith angle for a given baseline. More...
 
virtual double getBaseline (const double costh) const
 Get baseline for a given cosine zenith angle. More...
 

Detailed Description

Implementation of atmospheric neutrino flux using official KM3NeT atmospheric flux function.

Definition at line 33 of file JAtmosphericNeutrinoFlux.hh.

Member Typedef Documentation

template<class JClonable_t, class JDerived_t = JNullType>
typedef JClonable<JClonable_t>::clone_type JLANG::JClonable< JClonable_t, JDerived_t >::clone_type
inherited

Definition at line 61 of file JClonable.hh.

Definition at line 112 of file JEvtWeightFactorHelper.hh.

typedef std::shared_ptr<JDiffuseFlux> JAANET::JEvtWeightFactorHelper< JDiffuseFlux >::pointer_type
inherited

Definition at line 113 of file JEvtWeightFactorHelper.hh.

Definition at line 28 of file JOscProbHelper.hh.

Definition at line 29 of file JOscProbHelper.hh.

Definition at line 30 of file JOscProbHelper.hh.

Constructor & Destructor Documentation

JAANET::JAtmosphericNeutrinoFlux::JAtmosphericNeutrinoFlux ( )
inline

Default constructor.

Definition at line 39 of file JAtmosphericNeutrinoFlux.hh.

40  {}
JAANET::JAtmosphericNeutrinoFlux::JAtmosphericNeutrinoFlux ( const JOscProbInterface oscProbInterface)
inlineexplicit

Constructor.

Parameters
oscProbInterfaceoscillation probability interface

Definition at line 48 of file JAtmosphericNeutrinoFlux.hh.

48  :
49  JOscFlux(make_diffuseFluxFunction(Flux_Atmospheric()), oscProbInterface)
50  {}
JEvtWeightFactorFunction< JFunction_t, JDiffuseFlux > make_diffuseFluxFunction(const JFunction_t &flux)
Auxiliary method for creating an interface to a diffuse flux function.
JOscFlux()
Default constructor.
Definition: JOscFlux.hh:50
template<class JFunction_t >
JAANET::JAtmosphericNeutrinoFlux::JAtmosphericNeutrinoFlux ( const JOscProbFunction< JFunction_t > &  oscProbFunction)
inlineexplicit

Constructor.

The template argument refers to an oscillation probability function object or pointer. For this, the copy constructor needs to be defined

Parameters
oscProbFunctionoscillation probability function object

Definition at line 62 of file JAtmosphericNeutrinoFlux.hh.

62  :
63  JAtmosphericNeutrinoFlux(static_cast<const JOscProbInterface&>(oscProbFunction))
64  {}
JAtmosphericNeutrinoFlux()
Default constructor.
template<class JOscProbFunction_t >
JAANET::JAtmosphericNeutrinoFlux::JAtmosphericNeutrinoFlux ( const JOscProbFunction_t &  oscProbCalculator)
inline

Constructor.

The template argument refers to an oscillation probability function object or pointer. For this, the copy constructor needs to be defined

Parameters
oscProbCalculatoroscillation probability calculator

Definition at line 76 of file JAtmosphericNeutrinoFlux.hh.

76  :
78  {}
JOscProbFunction< JFunction_t > make_oscProbFunction(const JFunction_t &function)
Auxiliary method for creating an interface to an oscillation probability function.
JAtmosphericNeutrinoFlux()
Default constructor.

Member Function Documentation

double JAANET::JOscFlux::operator() ( const Evt evt) const
inlineinherited

Get flux for given event.

Note that in this evaluation the zenith-angle is defined
with respect to the line of sight (i.e. a neutrino pointing straight at you
from the center of the Earth has $ cos(\theta) = -1.0 $).

Parameters
evtevent
Returns
flux $ \left[\mathrm{GeV}^{-1} \, \mathrm{m}^{-2} \, \mathrm{sr}^{-1} * \mathrm{s}^{-1}\right] $

Definition at line 78 of file JOscFlux.hh.

79  {
80  using namespace JPP;
81 
82  double flux = 0.0;
83 
84  const Trk& neutrino = get_neutrino(evt);
85  const double costh = -neutrino.dir.z / neutrino.dir.len();
86 
87  for (int i = 0; i != NUMBER_OF_OSCCHANNELS; ++i) {
88 
89  const JOscChannel& channel = getOscChannel[i];
90 
91  const int inType = ((int) channel.Cparity) * ((int) channel.in);
92  const int outType = ((int) channel.Cparity) * ((int) channel.out);
93 
94  if (outType == neutrino.type) {
95 
96  flux += ( JDiffuseFluxHelper::getFactor(inType, log10(neutrino.E), costh) *
97  JOscProbHelper::getP(channel, neutrino.E, costh) );
98  }
99  }
100 
101  return flux;
102  }
double getP(const JOscChannel &channel, const double energy, const double costh) const
Get oscillation probability corresponding to given oscillation channel, neutrino energy and zenith an...
static const unsigned int NUMBER_OF_OSCCHANNELS
Number of neutrino oscillation channels.
Definition: JOscChannel.hh:351
set_variable E_E log10(E_{fit}/E_{#mu})"
static const JOscChannel getOscChannel[]
Declare group of neutrino oscillation channels.
Definition: JOscChannel.hh:326
Neutrino flux.
Definition: JHead.hh:906
double getFactor(const int type, const double log10E, const double costh) const
Get diffuse flux corresponding to given neutrino type, energy and zenith angle.
const Trk & get_neutrino(const Evt &evt)
Get incoming neutrino.
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
Definition: Trk.hh:14
bool JAANET::JOscFlux::equals ( const JOscFlux object) const
inlineinherited

Check if this flux is equal to given flux.

Parameters
objectflux object
Returns
true if this flux is identical to given flux; else false

Definition at line 111 of file JOscFlux.hh.

112  {
113  return (static_cast<const JDiffuseFluxHelper&>(object) == static_cast<const JDiffuseFluxHelper&>(*this) &&
114  static_cast<const JOscProbHelper&>(object) == static_cast<const JOscProbHelper&> (*this));
115  }
double JAANET::JOscFlux::getFactor ( const Evt evt) const
inlineoverrideinherited

Get event-weight factor for given event.

Parameters
evtevent
Returns
event-weight factor [GeV^-1 * m^-2 * sr^-1 * s^-1]

Definition at line 124 of file JOscFlux.hh.

125  {
126  return (*this)(evt);
127  }
double JAANET::JEvtWeightFactorHelper< JDiffuseFlux >::getFactor ( const int  type,
const double  log10E,
const double  costh 
) const
inlineinherited

Get diffuse flux corresponding to given neutrino type, energy and zenith angle.

Parameters
typePDG particle type
log10Elogarithmic neutrino energy [GeV]
costhcosine zenith angle
Returns
diffuse flux [GeV^-1 * m^-2 * sr^-1 * s^-1]

Definition at line 178 of file JEvtWeightFactorHelper.hh.

181  {
182  const JDiffuseFlux& diffuseFlux = getDiffuseFlux();
183 
184  return diffuseFlux.getFactor(type, log10E, costh);
185  }
double getFactor(const Evt &evt) const override
Get event-weight factor for given event.
Definition: JDiffuseFlux.hh:44
Low-level interface for diffuse fluxes.
Definition: JDiffuseFlux.hh:27
JDiffuseFlux & getDiffuseFlux() const
Get reference to diffuse flux factor.
template<class JClonable_t, class JDerived_t = JNullType>
virtual clone_type JLANG::JClonable< JClonable_t, JDerived_t >::clone ( ) const
inlineoverridevirtualinherited
void JAANET::JEvtWeightFactorHelper< JDiffuseFlux >::configure ( const JDiffuseFlux diffuseFlux)
inlineinherited

Configure oscillation probability function.

Parameters
diffuseFluxdiffuse flux function

Definition at line 139 of file JEvtWeightFactorHelper.hh.

140  {
141  using namespace JPP;
142 
143  JDiffuseFlux* p = dynamic_cast<JDiffuseFlux*>(diffuseFlux.clone());
144 
145  if (p != NULL) {
146  reset(p);
147  } else {
148  THROW(JNullPointerException, "JDiffuseFluxHelper::configure(): Unable to retrieve diffuse flux interface.");
149  }
150  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:712
virtual clone_type clone() const override
Get clone of this object.
Definition: JClonable.hh:69
Low-level interface for diffuse fluxes.
Definition: JDiffuseFlux.hh:27
void reset(T &value)
Reset value.
void JOSCPROB::JOscProbHelper::configure ( const JOscProbInterface oscProb)
inlineinherited

Configure oscillation probability function.

Parameters
oscProboscillation probability function

Definition at line 66 of file JOscProbHelper.hh.

67  {
68  this->reset(oscProb.clone());
69  }
virtual clone_type clone() const override
Get clone of this object.
Definition: JClonable.hh:69
void reset(T &value)
Reset value.
JDiffuseFlux& JAANET::JEvtWeightFactorHelper< JDiffuseFlux >::getDiffuseFlux ( ) const
inlineinherited

Get reference to diffuse flux factor.

Returns
reference to diffuse flux factor

Definition at line 158 of file JEvtWeightFactorHelper.hh.

159  {
160  using namespace JPP;
161 
162  if (static_cast<const JDiffuseFluxHelper_t&>(*this)) {
163  return *(this->get());
164  } else {
165  THROW(JNullPointerException, "JDiffuseFluxHelper::getDiffuseFlux(): Diffuse flux factor is not set.");
166  }
167  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:712
JOscProbInterface& JOSCPROB::JOscProbHelper::getOscProbInterface ( ) const
inlineinherited

Get reference to oscillation probability interface.

Returns
oscillation parameters

Definition at line 77 of file JOscProbHelper.hh.

78  {
79  using namespace JPP;
80 
81  if (static_cast<const JOscProbHelper&>(*this)) {
82  return *(this->get());
83  } else {
84  THROW(JNullPointerException, "JOscProbHelper::getOscProbInterface(): Oscillation probability interface is not set.");
85  }
86  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:712
JOscParameters_t& JOSCPROB::JOscProbHelper::getParameters ( ) const
inlineinherited

Get reference to oscillation parameters interface.

Returns
reference to oscillation parameters interface

Definition at line 94 of file JOscProbHelper.hh.

95  {
97  }
JOscProbInterface & getOscProbInterface() const
Get reference to oscillation probability interface.
JOscParameters_t & getParameters() const
Get reference to oscillation parameters interface.
void JOSCPROB::JOscProbHelper::set ( const JOscParameters_t parameters) const
inlineinherited

Set oscillation parameters.

Parameters
parametersoscillation parameters

Definition at line 105 of file JOscProbHelper.hh.

106  {
107  return getParameters().set(parameters);
108  }
JOscParameters_t & getParameters() const
Get reference to oscillation parameters interface.
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
Definition: diff-Tuna.sh:38
void set(const std::string &name, argument_type value)
Set value for a given oscillation parameter.
virtual void JOSCPROB::JOscProbHelper::set ( const std::string name,
const argument_type value 
) const
inlinevirtualinherited

Set value for a given oscillation parameter.

Parameters
nameparameter name
valueparameter value

Definition at line 117 of file JOscProbHelper.hh.

119  {
120  getParameters().set(name, value);
121  }
JOscParameters_t & getParameters() const
Get reference to oscillation parameters interface.
then echo Enter input within $TIMEOUT_S seconds echo n User name
Definition: JCookie.sh:42
void set(const std::string &name, argument_type value)
Set value for a given oscillation parameter.
template<class... Args>
void JOSCPROB::JOscProbHelper::set ( const std::string name,
const argument_type value,
const Args &...  args 
) const
inlineinherited

Set value for given list of oscillation parameters.

Parameters
nameparameter name
valueparameter value
argsremaining pairs of parameter names and values

Definition at line 132 of file JOscProbHelper.hh.

135  {
136  getParameters().set(name, value, args...);
137  }
JOscParameters_t & getParameters() const
Get reference to oscillation parameters interface.
then echo Enter input within $TIMEOUT_S seconds echo n User name
Definition: JCookie.sh:42
void set(const std::string &name, argument_type value)
Set value for a given oscillation parameter.
double JOSCPROB::JOscProbHelper::getP ( const JOscChannel channel,
const double  energy,
const double  costh 
) const
inlineinherited

Get oscillation probability corresponding to given oscillation channel, neutrino energy and zenith angle.

Parameters
channeloscillation channel
energyneutrino energy [GeV]
costhcosine zenith angle
Returns
oscillation probability

Definition at line 149 of file JOscProbHelper.hh.

152  {
153  return getOscProbInterface().getP(channel, energy, costh);
154  }
JOscProbInterface & getOscProbInterface() const
Get reference to oscillation probability interface.
virtual double getP(const JOscChannel &channel, const double E, const double costh) const =0
Get oscillation probability for a given oscillation channel.
then for APP in event gandalf start energy
Definition: JMuonMCEvt.sh:44
double JOSCPROB::JOscProbHelper::getP ( const JOscParameters_t parameters,
const JOscChannel channel,
const double  energy,
const double  costh 
) const
inlineinherited

Get oscillation probability for a given set of oscillation parameters
and a given oscillation channel.

Parameters
channeloscillation channel
parametersoscillation parameters
energyneutrino energy [GeV]
costhcosine zenith angle
Returns
oscillation probability

Definition at line 167 of file JOscProbHelper.hh.

171  {
172  return getOscProbInterface().getP(parameters, channel, energy, costh);
173  }
JOscProbInterface & getOscProbInterface() const
Get reference to oscillation probability interface.
virtual double getP(const JOscChannel &channel, const double E, const double costh) const =0
Get oscillation probability for a given oscillation channel.
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
Definition: diff-Tuna.sh:38
then for APP in event gandalf start energy
Definition: JMuonMCEvt.sh:44
double JOSCPROB::JOscProbHelper::getP ( const std::string name,
const double  value,
const JOscChannel channel,
const double  E,
const double  costh 
) const
inlineinherited

Get oscillation probability for a given oscillation parameter
and a given oscillation channel.

Parameters
nameparameter name
valueparameter value
channeloscillation channel
Eneutrino energy [GeV]
costhcosine zenith angle
Returns
oscillation probability

Definition at line 187 of file JOscProbHelper.hh.

192  {
193  return getOscProbInterface().getP(name, value, channel, E, costh);
194  }
JOscProbInterface & getOscProbInterface() const
Get reference to oscillation probability interface.
virtual double getP(const JOscChannel &channel, const double E, const double costh) const =0
Get oscillation probability for a given oscillation channel.
then usage $script< input file >[option[primary[working directory]]] nWhere option can be E
Definition: JMuonPostfit.sh:40
then echo Enter input within $TIMEOUT_S seconds echo n User name
Definition: JCookie.sh:42
template<class... Args>
double JOSCPROB::JOscProbHelper::getP ( const std::string name,
const double  value,
const Args &...  args 
) const
inlineinherited

Get oscillation probability for a given set of oscillation parameters
and a given oscillation channel.

Parameters
nameparameter name
valueparameter value
argsremaining arguments

Definition at line 206 of file JOscProbHelper.hh.

209  {
210  return getOscProbInterface().getP(name, value, args...);
211  }
JOscProbInterface & getOscProbInterface() const
Get reference to oscillation probability interface.
virtual double getP(const JOscChannel &channel, const double E, const double costh) const =0
Get oscillation probability for a given oscillation channel.
then echo Enter input within $TIMEOUT_S seconds echo n User name
Definition: JCookie.sh:42
virtual double JOSCPROB::JOscProbHelper::getCosth ( const double  L) const
inlinevirtualinherited

Get cosine zenith angle for a given baseline.

Parameters
Lbaseline [km]
Returns
cosine zenith angle

Definition at line 220 of file JOscProbHelper.hh.

221  {
222  return getOscProbInterface().getCosth(L);
223  }
JOscProbInterface & getOscProbInterface() const
Get reference to oscillation probability interface.
virtual double getCosth(const double L) const =0
Get cosine zenith angle for a given baseline.
virtual double JOSCPROB::JOscProbHelper::getBaseline ( const double  costh) const
inlinevirtualinherited

Get baseline for a given cosine zenith angle.

Parameters
costhcosine zenith angle
Returns
baseline [km]

Definition at line 232 of file JOscProbHelper.hh.

233  {
234  return getOscProbInterface().getBaseline(costh);
235  }
JOscProbInterface & getOscProbInterface() const
Get reference to oscillation probability interface.
virtual double getBaseline(const double costh) const =0
Get baseline for a given cosine zenith angle.

The documentation for this struct was generated from the following file: