Jpp  18.2.1-ARCA-DF-PATCH
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 namespace JPP { using namespace JAANET; }
27 
28 namespace JAANET {
29 
30  using JLANG::JClonable;
31 
32  using JOSCPROB::JOscProb;
34 
35 
36  /**
37  * Implementation of oscillated neutrino flux.
38  */
39  struct JOscFlux :
40  public JClonable<JFlux, JOscFlux>,
41  public JDiffuseFluxHelper,
42  public JOscProbHelper
43  {
44  /**
45  * Default constructor.
46  */
48  {}
49 
50 
51  /**
52  * Constructor.
53  *
54  * \param diffuseFlux diffuse flux object
55  * \param oscProb oscillation probability interface
56  */
57  JOscFlux(const JDiffuseFlux& diffuseFlux,
58  const JOscProb& oscProb)
59  {
60  JDiffuseFluxHelper::configure(diffuseFlux);
62  }
63 
64 
65  /**
66  * Get flux for given event.
67  *
68  * Note that in this evaluation the zenith-angle is defined\n
69  * with respect to the line of sight (i.e. a neutrino pointing straight at you\n
70  * from the center of the Earth has \f$ cos(\theta) = -1.0 \f$).
71  *
72  * \param evt event
73  * \return flux \f$ \left[\mathrm{GeV}^{-1} \, \mathrm{m}^{-2} \, \mathrm{sr}^{-1} * \mathrm{s}^{-1}\right] \f$
74  */
75  double operator()(const Evt& evt) const
76  {
77  using namespace JPP;
78 
79  double flux = 0.0;
80 
81  const Trk& neutrino = get_neutrino(evt);
82  const double costh = -neutrino.dir.z / neutrino.dir.len();
83 
84  for (int i = 0; i != NUMBER_OF_OSCCHANNELS; ++i) {
85 
86  const JOscChannel& channel = getOscChannel[i];
87 
88  const int inType = ((int) channel.Cparity) * ((int) channel.in);
89  const int outType = ((int) channel.Cparity) * ((int) channel.out);
90 
91  if (outType == neutrino.type) {
92 
93  flux += ( JDiffuseFluxHelper::getFactor(inType, log10(neutrino.E), costh) *
94  JOscProbHelper::getOscProb(channel, neutrino.E, costh) );
95  }
96  }
97 
98  return flux;
99  }
100 
101 
102  /**
103  * Get event-weight factor for given event.
104  *
105  * \param evt event
106  * \return event-weight factor [GeV^-1 * m^-2 * sr^-1 * s^-1]
107  */
108  double getFactor(const Evt& evt) const override
109  {
110  return (*this)(evt);
111  }
112  };
113 }
114 
115 #endif
Low-level interface for retrieving the oscillation probability corresponding to a given oscillation c...
Definition: JOscProb.hh:25
Implementation of oscillated neutrino flux.
Definition: JOscFlux.hh:39
static const unsigned int NUMBER_OF_OSCCHANNELS
Number of neutrino oscillation channels.
Definition: JOscChannel.hh:351
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...
Helper class for oscillation probabilities.
JOscFlux(const JDiffuseFlux &diffuseFlux, const JOscProb &oscProb)
Constructor.
Definition: JOscFlux.hh:57
JOscFlux()
Default constructor.
Definition: JOscFlux.hh:47
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
Neutrino flux.
Definition: JHead.hh:906
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:108
Low-level interface for diffuse fluxes.
Definition: JDiffuseFlux.hh:27
double operator()(const Evt &evt) const
Get flux for given event.
Definition: JOscFlux.hh:75
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.
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
Definition: Evt.hh:20