Jpp test-rotations-old
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 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:240

◆ 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:241

◆ 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.

◆ 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 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 140 of file JOscFlux.hh.

141 {
142 using namespace JPP;
143
144 double flux = 0.0;
145
146 const Trk& neutrino = get_neutrino(evt);
147 const double costh = -neutrino.dir.z;
148
149 const int interactionType = evt.w2list[W2LIST_GSEAGEN_CC];
150
151 if (interactionType == (int) JInteractionTypeGENIE_t::WEAK_CHARGED_CURRENT) {
152
153 for (int i = 0; i != NUMBER_OF_OSCCHANNELS; ++i) {
154
155 const JOscChannel& channel = getOscChannel[i];
156
157 const int inType = ((int) channel.Cparity) * ((int) channel.in);
158 const int outType = ((int) channel.Cparity) * ((int) channel.out);
159
160 if (outType == neutrino.type) {
161
162 flux += ( F.getFlux(inType, log10(neutrino.E), costh) *
163 P.getP (channel, neutrino.E, costh) );
164 }
165 }
166
167 } else if (interactionType == (int) JInteractionTypeGENIE_t::WEAK_NEUTRAL_CURRENT) { // For NC events, the neutrino flavour is irrelevant
168
169 const int Cparity = (int) getChargeParity(neutrino);
170
171 flux += (F.getFlux(Cparity * TRACK_TYPE_NUE, log10(neutrino.E), costh) +
172 F.getFlux(Cparity * TRACK_TYPE_NUMU, log10(neutrino.E), costh) +
173 F.getFlux(Cparity * TRACK_TYPE_NUTAU, log10(neutrino.E), costh));
174 }
175
176 return flux;
177 }
@ 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 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...
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 185 of file JOscFlux.hh.

186 {
187 return JOscFluxHelper(*this, eqpars);
188 }

◆ 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 196 of file JOscFlux.hh.

197 {
198 return JOscFluxHelper(*this, eqpars);
199 }

◆ 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 240 of file JOscFlux.hh.

◆ F

JDiffuseFluxHelper JAANET::JOscFlux::F
privateinherited

Diffuse flux function.

Definition at line 241 of file JOscFlux.hh.


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