Jpp  18.3.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JDiffuseFlux.hh
Go to the documentation of this file.
1 #ifndef __JAANET__JDIFFUSEFLUX__
2 #define __JAANET__JDIFFUSEFLUX__
3 
4 #include <iostream>
5 
8 
9 #include "JAAnet/JFlux.hh"
10 #include "JAAnet/JAAnetToolkit.hh"
11 
12 #include "flux/Flux.hh"
13 
14 
15 /**
16  * \author bjung
17  */
18 
19 namespace JAANET {}
20 namespace JPP { using namespace JAANET; }
21 
22 namespace JAANET {
23 
24  /**
25  * Low-level interface for diffuse fluxes.
26  */
27  struct JDiffuseFlux :
28  public JFlux,
29  public DiffuseFlux
30  {
31  /**
32  * Virtual destructor.
33  */
34  virtual ~JDiffuseFlux()
35  {}
36 
37 
38  /**
39  * Get event-weight factor for given event.
40  *
41  * \param evt event
42  * \return event-weight factor [GeV^-1 * m^-2 * sr^-1 * s^-1]
43  */
44  double getFactor(const Evt& evt) const override
45  {
46  const Trk& neutrino = get_neutrino(evt);
47  const double log10E = log10(neutrino.E);
48  const double costh = neutrino.dir.z / neutrino.dir.len();
49 
50  return dNdEdOmega(neutrino.type, log10E, costh);
51  }
52 
53 
54  /**
55  * Get event-weight factor for given particle PDG-identifier, energy and zenith-angle.
56  *
57  * \param type PDG particle type
58  * \param log10E logarithmic neutrino energy [GeV]
59  * \param costh cosine zenith angle
60  * \return diffuse flux [GeV^-1 * m^-2 * sr^-1 * s^-1]
61  */
62  double getFactor(const int type,
63  const double log10E,
64  const double costh) const
65  {
66  return dNdEdOmega(type, log10E, costh);
67  }
68 
69 
70  /**
71  * Get event-weight factor for given particle PDG-identifier, energy and zenith-angle.
72  *
73  * \param type PDG particle type
74  * \param log10E logarithmic neutrino energy [GeV]
75  * \param costh cosine zenith angle
76  * \return diffuse flux [GeV^-1 * m^-2 * sr^-1 * s^-1]
77  */
78  double getFlux(const int type,
79  const double log10E,
80  const double costh) const
81  {
82  return dNdEdOmega(type, log10E, costh);
83  }
84 
85 
86  /**
87  * Print flux information.
88  */
89  virtual void Print() const override
90  {
91  prnt(std::cout);
92  }
93  };
94 }
95 
96 #endif
double getFlux(const int type, const double log10E, const double costh) const
Get event-weight factor for given particle PDG-identifier, energy and zenith-angle.
Definition: JDiffuseFlux.hh:78
double z
Definition: Vec.hh:14
double getFactor(const Evt &evt) const override
Get event-weight factor for given event.
Definition: JDiffuseFlux.hh:44
Vec dir
track direction
Definition: Trk.hh:18
double E
Energy [GeV] (either MC truth or reconstructed)
Definition: Trk.hh:20
double len() const
Get length.
Definition: Vec.hh:145
virtual void Print() const override
Print flux information.
Definition: JDiffuseFlux.hh:89
set_variable E_E log10(E_{fit}/E_{#mu})"
double getFactor(const int type, const double log10E, const double costh) const
Get event-weight factor for given particle PDG-identifier, energy and zenith-angle.
Definition: JDiffuseFlux.hh:62
Definition of hit and track types and auxiliary methods for handling Monte Carlo data.
Low-level interface for diffuse fluxes.
Definition: JDiffuseFlux.hh:27
Low-level interface for retrieving the flux corresponding to a given event.
Definition: JFlux.hh:21
int type
MC: particle type in PDG encoding.
Definition: Trk.hh:24
virtual ~JDiffuseFlux()
Virtual destructor.
Definition: JDiffuseFlux.hh:34
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
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
Definition: Evt.hh:20