Jpp  17.3.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JOscFlux.hh
Go to the documentation of this file.
1 #ifndef __JAANET__JOSCFLUX__
2 #define __JAANET__JOSCFLUX__
3 
6 
7 #include "flux/Flux.hh"
8 
9 #include "JLang/JClonable.hh"
10 
11 #include "JAAnet/JFlux.hh"
12 #include "JAAnet/JDiffuseFlux.hh"
13 #include "JAAnet/JAAnetToolkit.hh"
15 
16 #include "JOscProb/JOscProb.hh"
17 #include "JOscProb/JOscChannel.hh"
19 
20 
21 /**
22  * \author bjung
23  */
24 
25 namespace JAANET {
26 
27  using JLANG::JClonable;
28 
29  using JOSCPROB::JOscProb;
32 
35 
36 
37  /**
38  * Implementation of oscillated neutrino flux.
39  */
40  struct JOscFlux :
41  public JClonable<JFlux, JOscFlux>,
42  public JDiffuseFluxHelper,
43  public JOscProbHelper
44  {
45  /**
46  * Default constructor.
47  */
49  {}
50 
51 
52  /**
53  * Constructor.
54  *
55  * \param diffuseFlux diffuse flux object
56  * \param oscProb oscillation probability interface
57  */
58  JOscFlux(const JDiffuseFlux& diffuseFlux,
59  const JOscProb& oscProb)
60  {
61  JDiffuseFluxHelper::configure(diffuseFlux);
63  }
64 
65 
66  /**
67  * Get flux for given event.
68  *
69  * Note that in this evaluation the zenith-angle is defined\n
70  * with respect to the line of sight (i.e. a neutrino pointing straight at you\n
71  * from the center of the Earth has \f$ cos(\theta) = -1.0 \f$).
72  *
73  * \param evt event
74  * \return flux \f$ \left[\mathrm{GeV}^{-1} \, \mathrm{m}^{-2} \, \mathrm{sr}^{-1} * \mathrm{s}^{-1}\right] \f$
75  */
76  double operator()(const Evt& evt) const
77  {
78  double flux = 0.0;
79 
80  const Trk& neutrino = get_neutrino(evt);
81  const double costh = -neutrino.dir.z / neutrino.dir.len();
82 
83  for (int i = 0; i != NUMBER_OF_OSCCHANNELS; ++i) {
84 
85  const JOscChannel& channel = getOscChannel[i];
86 
87  const int inType = ((int) channel.Cparity) * ((int) channel.in);
88  const int outType = ((int) channel.Cparity) * ((int) channel.out);
89 
90  if (outType == neutrino.type) {
91 
92  flux += ( JDiffuseFluxHelper::getFactor(inType, log10(neutrino.E), costh) *
93  JOscProbHelper::getOscProb(channel, neutrino.E, costh) );
94  }
95  }
96 
97  return flux;
98  }
99 
100 
101  /**
102  * Get event-weight factor for given event.
103  *
104  * \param evt event
105  * \return event-weight factor [GeV^-1 * m^-2 * sr^-1 * s^-1]
106  */
107  double getFactor(const Evt& evt) const override
108  {
109  return (*this)(evt);
110  }
111  };
112 }
113 
114 #endif
Low-level interface for retrieving the oscillation probability corresponding to a given oscillation c...
Definition: JOscProb.hh:22
Neutrino oscillation channel.
Definition: JOscChannel.hh:110
double z
Definition: Vec.hh:14
Implementation of oscillated neutrino flux.
Definition: JOscFlux.hh:40
static const unsigned int NUMBER_OF_OSCCHANNELS
Number of neutrino oscillation channels.
Definition: JOscChannel.hh:351
JFlavour_t in
Incoming flavour.
Definition: JOscChannel.hh:285
virtual double getOscProb(const JOscChannel &oscChannel, const double energy, const double costh) const
Get oscillation probability corresponding to given oscillation channel, neutrino energy and zenith an...
Vec dir
track direction
Definition: Trk.hh:18
Helper class for oscillation probabilities.
double E
Energy [GeV] (either MC truth or reconstructed)
Definition: Trk.hh:20
double len() const
Get length.
Definition: Vec.hh:145
JOscFlux(const JDiffuseFlux &diffuseFlux, const JOscProb &oscProb)
Constructor.
Definition: JOscFlux.hh:58
JOscFlux()
Default constructor.
Definition: JOscFlux.hh:48
void configure(const JDiffuseFlux &diffuseFlux)
Configure oscillation probability function.
set_variable E_E log10(E_{fit}/E_{#mu})"
static const JOscChannel getOscChannel[]
Declare group of neutrino oscillation channels.
Definition: JOscChannel.hh:326
JChargeParity_t Cparity
Charge-parity.
Definition: JOscChannel.hh:287
Neutrino flux.
Definition: JHead.hh:893
Explicit emplate specialization of event-weight factor helper for diffuse flux objects.
Definition of hit and track types and auxiliary methods for handling Monte Carlo data.
Template class for object cloning.
Definition: JClonable.hh:20
double getFactor(const Evt &evt) const override
Get event-weight factor for given event.
Definition: JOscFlux.hh:107
Low-level interface for diffuse fluxes.
Definition: JDiffuseFlux.hh:24
double operator()(const Evt &evt) const
Get flux for given event.
Definition: JOscFlux.hh:76
int type
MC: particle type in PDG encoding.
Definition: Trk.hh:24
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
virtual void configure(const JOscProb &oscProb)
Configure oscillation probability function.
JFlavour_t out
Outcoming flavour.
Definition: JOscChannel.hh:286
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
Definition: Evt.hh:20