Jpp  19.1.0-rc.1
the software that should make you happy
Classes | Public Types | Public Member Functions | Protected Attributes | List of all members
JAANET::JOscFlux Struct Reference

Implementation of oscillated neutrino flux. More...

#include <JOscFlux.hh>

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

Classes

struct  JOscFluxHelper
 Auxiliary class for I/O of oscillated flux. More...
 

Public Types

typedef JClonable< JClonable_t >::clone_type clone_type
 

Public Member Functions

 JOscFlux (const JDiffuseFluxHelper &diffuseFlux, const JOscProbHelper &oscProb)
 Constructor. More...
 
bool is_valid () const override final
 Check whether this oscillated neutrino flux object is valid. More...
 
double getFactor (const Evt &evt) const override final
 Get flux for given event. More...
 
JProperties getProperties (const JEquationParameters &eqpars=JEvtWeightFactor::getEquationParameters()) override final
 Get properties of this class. More...
 
JProperties getProperties (const JEquationParameters &eqpars=JEvtWeightFactor::getEquationParameters()) const override final
 Get properties of this class. More...
 
std::istream & read (std::istream &in) override final
 Stream input. More...
 
virtual clone_type clone () const override
 Get clone of this object. More...
 

Protected Attributes

JOscProbHelper P
 
JDiffuseFluxHelper F
 

Detailed Description

Implementation of oscillated neutrino flux.

Definition at line 42 of file JOscFlux.hh.

Member Typedef Documentation

◆ clone_type

template<class JClonable_t , class JDerived_t >
typedef 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

◆ JOscFlux()

JAANET::JOscFlux::JOscFlux ( const JDiffuseFluxHelper diffuseFlux,
const JOscProbHelper oscProb 
)
inline

Constructor.

Parameters
diffuseFluxdiffuse flux function object
oscProboscillation probability function object

Definition at line 51 of file JOscFlux.hh.

52  :
53  P(oscProb),
54  F(diffuseFlux)
55  {}
JOscProbHelper P
Definition: JOscFlux.hh:169
JDiffuseFluxHelper F
Definition: JOscFlux.hh:170

Member Function Documentation

◆ is_valid()

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

Check whether this oscillated neutrino flux object is valid.

Returns
true if valid; else false

Definition at line 63 of file JOscFlux.hh.

64  {
65  return (F && F->is_valid() &&
66  P && P->getParameters().is_valid());
67  }
bool is_valid() const
Check validity of oscillation parameters.
bool is_valid() const
Check whether this event-weight factor is valid.
JOscParameterReferences_t & getParameters() const
Get reference to oscillation parameters interface.

◆ getFactor()

double JAANET::JOscFlux::getFactor ( const Evt evt) const
inlinefinaloverride

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

81  {
82  using namespace JPP;
83 
84  double flux = 0.0;
85 
86  const Trk& neutrino = get_neutrino(evt);
87  const double costh = -neutrino.dir.z;
88 
89  const int interactionType = evt.w2list[W2LIST_GSEAGEN_CC];
90 
91  if (interactionType == (int) JInteractionTypeGENIE_t::WEAK_CHARGED_CURRENT) {
92 
93  for (int i = 0; i != NUMBER_OF_OSCCHANNELS; ++i) {
94 
95  const JOscChannel& channel = getOscChannel[i];
96 
97  const int inType = ((int) channel.Cparity) * ((int) channel.in);
98  const int outType = ((int) channel.Cparity) * ((int) channel.out);
99 
100  if (outType == neutrino.type) {
101 
102  flux += ( F.getFlux(inType, log10(neutrino.E), costh) *
103  P.getP (channel, neutrino.E, costh) );
104  }
105  }
106 
107  } else if (interactionType == (int) JInteractionTypeGENIE_t::WEAK_NEUTRAL_CURRENT) { // For NC events, the neutrino flavour is irrelevant
108 
109  const int Cparity = (int) getChargeParity(neutrino);
110 
111  flux += (F.getFlux(Cparity * TRACK_TYPE_NUE, log10(neutrino.E), costh) +
112  F.getFlux(Cparity * TRACK_TYPE_NUMU, log10(neutrino.E), costh) +
113  F.getFlux(Cparity * TRACK_TYPE_NUTAU, log10(neutrino.E), costh));
114  }
115 
116  return flux;
117  }
const Trk & get_neutrino(const Evt &evt)
Get incoming neutrino.
@ WEAK_NEUTRAL_CURRENT
Weak neutral current interaction.
@ WEAK_CHARGED_CURRENT
Weak charged current interaction.
@ TRACK_TYPE_NUTAU
@ TRACK_TYPE_NUE
@ TRACK_TYPE_NUMU
static const JOscChannel getOscChannel[]
Declare group of neutrino oscillation channels.
Definition: JOscChannel.hh:326
static const unsigned int NUMBER_OF_OSCCHANNELS
Number of neutrino oscillation channels.
Definition: JOscChannel.hh:351
JChargeParity_t getChargeParity(const int pdgType)
Auxiliary function for retrieving the charge-parity of a given PDG type.
Definition: JOscChannel.hh:83
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
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 flux.
Definition: JHead.hh:906
Neutrino oscillation channel.
Definition: JOscChannel.hh:112
JChargeParity_t Cparity
Charge-parity.
Definition: JOscChannel.hh:287
JFlavour_t in
Incoming flavour.
Definition: JOscChannel.hh:285
JFlavour_t out
Outcoming flavour.
Definition: JOscChannel.hh:286
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())
inlinefinaloverride

Get properties of this class.

Parameters
eqparsequation parameters

Definition at line 125 of file JOscFlux.hh.

126  {
127  return JOscFluxHelper(*this, eqpars);
128  }

◆ getProperties() [2/2]

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

Get properties of this class.

Parameters
eqparsequation parameters

Definition at line 136 of file JOscFlux.hh.

137  {
138  return JOscFluxHelper(*this, eqpars);
139  }

◆ read()

std::istream& JAANET::JOscFlux::read ( std::istream &  in)
inlinefinaloverride

Stream input.

Parameters
ininput stream
Returns
input stream

Definition at line 148 of file JOscFlux.hh.

149  {
150  using namespace std;
151  using namespace JPP;
152 
153  if (F) {
154  F->read(in);
155  }
156 
157  if (P) {
158  in >> P->getParameters();
159  }
160 
161  check_validity();
162 
163  return in;
164  }
Definition: JSTDTypes.hh:14

◆ clone()

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

Member Data Documentation

◆ P

JOscProbHelper JAANET::JOscFlux::P
protected

Definition at line 169 of file JOscFlux.hh.

◆ F

JDiffuseFluxHelper JAANET::JOscFlux::F
protected

Definition at line 170 of file JOscFlux.hh.


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