Jpp 21.0.0
the software that should make you happy
Loading...
Searching...
No Matches
JAANET::JAtmosphericNeutrinoFlux Struct Referencefinal

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

#include <JAtmosphericNeutrinoFlux.hh>

Inheritance diagram for JAANET::JAtmosphericNeutrinoFlux:
JAANET::JOscFlux JLANG::JClonable< JClonable_t, JDerived_t >

Public Types

typedef JClonable< JClonable_t >::clone_type clone_type
 

Public Member Functions

 JAtmosphericNeutrinoFlux (const JOscProbHelper &pOscProb)
 Constructor.
 
 JAtmosphericNeutrinoFlux (const JOscProbInterface &oscProbInterface)
 Constructor.
 
const JOscProbHelper & getOscProb () const
 Get oscillation probability calculator.
 
void setOscProb (const JOscProbHelper oscProb)
 Set oscillation probability calculator.
 
const JDiffuseFluxHelper & getDiffuseFlux () const
 Get diffuse flux function.
 
void setDiffuseFlux (const JDiffuseFluxHelper flux)
 Set diffuse flux function.
 
bool is_valid () const override final
 Check whether this oscillated neutrino flux object is valid.
 
double dNdEdOmega (int type, double log10E, double costh) const override final
 Get diffuse oscillated flux for given neutrino PDG-identifier, energy and zenith-angle.
 
double getFactor (const Evt &evt) const override final
 Get flux for given event.
 
JProperties getProperties (const JEquationParameters &eqpars=JEvtWeightFactor::getEquationParameters()) override final
 Get properties of this class.
 
JProperties getProperties (const JEquationParameters &eqpars=JEvtWeightFactor::getEquationParameters()) const override final
 Get properties of this class.
 
virtual clone_type clone () const override
 Get clone of this object.
 

Private Attributes

JOscProbHelper P
 Oscillation probability calculator.
 
JDiffuseFluxHelper F
 Diffuse flux function.
 

Static Private Attributes

static const JDiffuseFluxHelper pFlux = JDiffuseFluxHelper(JFluxAtmospheric())
 Initialisation of atmospheric neutrino flux function.
 

Detailed Description

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


Definition at line 30 of file JAtmosphericNeutrinoFlux.hh.

Member Typedef Documentation

◆ clone_type

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

Definition at line 61 of file JClonable.hh.

Constructor & Destructor Documentation

◆ JAtmosphericNeutrinoFlux() [1/2]

JAANET::JAtmosphericNeutrinoFlux::JAtmosphericNeutrinoFlux ( const JOscProbHelper & pOscProb)
inline

Constructor.

Parameters
pOscProbshared pointer to oscillation probability interface

Definition at line 38 of file JAtmosphericNeutrinoFlux.hh.

38 :
39 JOscFlux(pFlux, pOscProb)
40 {}
static const JDiffuseFluxHelper pFlux
Initialisation of atmospheric neutrino flux function.
JOscFlux(const JDiffuseFluxHelper &diffuseFlux, const JOscProbHelper &oscProb)
Constructor.
Definition JOscFlux.hh:51

◆ JAtmosphericNeutrinoFlux() [2/2]

JAANET::JAtmosphericNeutrinoFlux::JAtmosphericNeutrinoFlux ( const JOscProbInterface & oscProbInterface)
inline

Constructor.

Parameters
oscProbInterfaceoscillation probability interface

Definition at line 48 of file JAtmosphericNeutrinoFlux.hh.

48 :
49 JOscFlux(pFlux, oscProbInterface)
50 {}

Member Function Documentation

◆ getOscProb()

const JOscProbHelper & JAANET::JOscFlux::getOscProb ( ) const
inlineinherited

Get oscillation probability calculator.

Returns
oscillation probability calculator

Definition at line 65 of file JOscFlux.hh.

66 {
67 return P;
68 }
JOscProbHelper P
Oscillation probability calculator.
Definition JOscFlux.hh:266

◆ setOscProb()

void JAANET::JOscFlux::setOscProb ( const JOscProbHelper oscProb)
inlineinherited

Set oscillation probability calculator.

Parameters
oscProboscillation probability calculator.

Definition at line 76 of file JOscFlux.hh.

77 {
78 using namespace JPP;
79
80 if (oscProb) {
81 this->P = oscProb;
82 } else {
83 THROW(JNullPointerException, "JOscFlux::setOscProb(): Given oscillation probability calculator is invalid.");
84 }
85 }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Exception for null pointer operation.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).

◆ getDiffuseFlux()

const JDiffuseFluxHelper & JAANET::JOscFlux::getDiffuseFlux ( ) const
inlineinherited

Get diffuse flux function.

Returns
diffuse flux function

Definition at line 93 of file JOscFlux.hh.

94 {
95 return F;
96 }
JDiffuseFluxHelper F
Diffuse flux function.
Definition JOscFlux.hh:267

◆ setDiffuseFlux()

void JAANET::JOscFlux::setDiffuseFlux ( const JDiffuseFluxHelper flux)
inlineinherited

Set diffuse flux function.

Parameters
fluxdiffuse flux function

Definition at line 104 of file JOscFlux.hh.

105 {
106 using namespace std;
107 using namespace JPP;
108
109 if (flux && flux->is_valid()) {
110 this->F = flux;
111 } else if (flux) {
112 THROW(JValueOutOfRange, "JOscFlux::setFlux(): Given flux function is invalid: " << endl << *flux);
113 } else {
114 THROW(JNullPointerException, "JOscFlux::setFlux(): Given flux function is invalid.");
115 }
116 }
Exception for accessing a value in a collection that is outside of its range.
Neutrino flux.
Definition JHead.hh:906

◆ is_valid()

bool JAANET::JOscFlux::is_valid ( ) const
inlinefinaloverrideinherited

Check whether this oscillated neutrino flux object is valid.

Returns
true if valid; else false

Definition at line 124 of file JOscFlux.hh.

125 {
126 return (P && F && F->is_valid());
127 }
bool is_valid() const
Check whether this event-weight factor is valid.

◆ dNdEdOmega()

double JAANET::JOscFlux::dNdEdOmega ( int type,
double log10E,
double costh ) const
inlinefinaloverrideinherited

Get diffuse oscillated flux for given neutrino PDG-identifier, energy and zenith-angle.

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

Definition at line 138 of file JOscFlux.hh.

141 {
142 using namespace JPP;
143
144 double flux = 0.0;
145
146 const double E = pow(10.0, log10E);
147
148 for (int i = 0; i != NUMBER_OF_OSCCHANNELS; ++i) {
149
150 const JOscChannel& channel = getOscChannel[i];
151
152 const int inType = ((int) channel.Cparity) * ((int) channel.in);
153 const int outType = ((int) channel.Cparity) * ((int) channel.out);
154
155 if (outType == type) {
156
157 flux += ( F.getFlux(inType, log10E, costh) *
158 P.getP (channel, E, costh) );
159 }
160 }
161
162 return flux;
163 }
T pow(const T &x, const double y)
Power .
Definition JMath.hh:97
double getFlux(const int type, const double log10E, const double costh) const
Get flux for given particle PDG-identifier, energy and zenith-angle.
Neutrino oscillation channel.
JChargeParity_t Cparity
Charge-parity.
JFlavour_t in
Incoming flavour.
JFlavour_t out
Outcoming flavour.
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...

◆ getFactor()

double JAANET::JOscFlux::getFactor ( const Evt & evt) const
inlinefinaloverrideinherited

Get flux for given event.

Note that in this evaluation the zenith-angle is defined
with respect to the negative z-axis (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 176 of file JOscFlux.hh.

177 {
178 using namespace JPP;
179
180 double flux = 0.0;
181
182 const Trk& neutrino = get_neutrino(evt);
183
184 const double costh = -neutrino.dir.z;
185 const double log10E = log10(neutrino.E);
186
187 const int interactionType = evt.w2list[W2LIST_GSEAGEN_CC];
188
189 if (interactionType == (int) JGENIEInteractionType_t::WEAK_CHARGED_CURRENT) {
190
191 return dNdEdOmega(neutrino.type, log10E, costh);
192
193 } else if (interactionType == (int) JGENIEInteractionType_t::WEAK_NEUTRAL_CURRENT) { // For NC events, the neutrino flavour is irrelevant
194
195 const int Cparity = (int) getChargeParity(neutrino);
196
197 flux += (F.getFlux(Cparity * TRACK_TYPE_NUE, log10E, costh) +
198 F.getFlux(Cparity * TRACK_TYPE_NUMU, log10E, costh) +
199 F.getFlux(Cparity * TRACK_TYPE_NUTAU, log10E, costh));
200 }
201
202 return flux;
203 }
@ WEAK_NEUTRAL_CURRENT
Weak neutral current interaction.
@ WEAK_CHARGED_CURRENT
Weak charged current interaction.
const Trk & get_neutrino(const Evt &evt)
Get incoming neutrino.
JChargeParity_t getChargeParity(const int pdgType)
Auxiliary function for retrieving the charge-parity of a given PDG type.
std::vector< double > w2list
MC: factors that make up w[1]=w2 (see e.g. Tag list or km3net-dataformat/definitions)
Definition Evt.hh:43
double dNdEdOmega(int type, double log10E, double costh) const override final
Get diffuse oscillated flux for given neutrino PDG-identifier, energy and zenith-angle.
Definition JOscFlux.hh:138
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
Definition Trk.hh:15
int type
MC: particle type in PDG encoding.
Definition Trk.hh:24
Vec dir
track direction
Definition Trk.hh:18
double E
Energy [GeV] (either MC truth or reconstructed)
Definition Trk.hh:20
double z
Definition Vec.hh:14
static const int W2LIST_GSEAGEN_CC
Charged current interaction flag.

◆ getProperties() [1/2]

JProperties JAANET::JOscFlux::getProperties ( const JEquationParameters & eqpars = JEvtWeightFactor::getEquationParameters())
inlinefinaloverrideinherited

Get properties of this class.

Parameters
eqparsequation parameters

Definition at line 211 of file JOscFlux.hh.

212 {
213 return JOscFluxHelper(*this, eqpars);
214 }

◆ getProperties() [2/2]

JProperties JAANET::JOscFlux::getProperties ( const JEquationParameters & eqpars = JEvtWeightFactor::getEquationParameters()) const
inlinefinaloverrideinherited

Get properties of this class.

Parameters
eqparsequation parameters

Definition at line 222 of file JOscFlux.hh.

223 {
224 return JOscFluxHelper(*this, eqpars);
225 }

◆ clone()

template<class JClonable_t , class JDerived_t >
virtual clone_type JLANG::JClonable< JClonable_t, JDerived_t >::clone ( ) const
inlineoverridevirtualinherited

Member Data Documentation

◆ pFlux

const JDiffuseFluxHelper JAANET::JAtmosphericNeutrinoFlux::pFlux = JDiffuseFluxHelper(JFluxAtmospheric())
staticprivate

Initialisation of atmospheric neutrino flux function.

Definition at line 55 of file JAtmosphericNeutrinoFlux.hh.

◆ P

JOscProbHelper JAANET::JOscFlux::P
privateinherited

Oscillation probability calculator.

Definition at line 266 of file JOscFlux.hh.

◆ F

JDiffuseFluxHelper JAANET::JOscFlux::F
privateinherited

Diffuse flux function.

Definition at line 267 of file JOscFlux.hh.


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