Jpp  debug
the software that should make you happy
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  using JFlux::getFlux;
32 
33  /**
34  * Virtual destructor.
35  */
36  virtual ~JDiffuseFlux()
37  {}
38 
39 
40  /**
41  * Get diffuse flux for given event.
42  *
43  * \param evt event
44  * \return diffuse flux [GeV^-1 * m^-2 * sr^-1 * s^-1]
45  */
46  double getFactor(const Evt& evt) const override
47  {
48  const Trk& neutrino = get_neutrino(evt);
49  const double log10E = log10(neutrino.E);
50  const double costh = neutrino.dir.z;
51 
52  return dNdEdOmega(neutrino.type, log10E, costh);
53  }
54 
55 
56  /**
57  * Get diffuse flux for given particle PDG-identifier, energy and zenith-angle.
58  *
59  * \param type PDG particle type
60  * \param log10E logarithmic neutrino energy [GeV]
61  * \param costh cosine zenith angle
62  * \return diffuse flux [GeV^-1 * m^-2 * sr^-1 * s^-1]
63  */
64  double getFactor(const int type,
65  const double log10E,
66  const double costh) const
67  {
68  return dNdEdOmega(type, log10E, costh);
69  }
70 
71 
72  /**
73  * Get diffuse flux for given particle PDG-identifier, energy and zenith-angle.
74  *
75  * \param type PDG particle type
76  * \param log10E logarithmic neutrino energy [GeV]
77  * \param costh cosine zenith angle
78  * \return diffuse flux [GeV^-1 * m^-2 * sr^-1 * s^-1]
79  */
80  double getFlux(const int type,
81  const double log10E,
82  const double costh) const
83  {
84  return dNdEdOmega(type, log10E, costh);
85  }
86 
87 
88  /**
89  * Get diffuse flux for given particle PDG-identifier, energy and zenith-angle.
90  *
91  * \param type PDG particle type
92  * \param log10E logarithmic neutrino energy [GeV]
93  * \param costh cosine zenith angle
94  * \return diffuse flux [GeV^-1 * m^-2 * sr^-1 * s^-1]
95  */
96  double operator()(const int type,
97  const double log10E,
98  const double costh) const
99  {
100  return dNdEdOmega(type, log10E, costh);
101  }
102 
103 
104  /**
105  * Print flux information.
106  */
107  void Print() const override
108  {
109  prnt(std::cout);
110  }
111  };
112 }
113 
114 #endif
Definition of hit and track types and auxiliary methods for handling Monte Carlo data.
Extensions to Evt data format.
const Trk & get_neutrino(const Evt &evt)
Get incoming neutrino.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
Definition: Evt.hh:21
Low-level interface for diffuse fluxes.
Definition: JDiffuseFlux.hh:30
double getFactor(const int type, const double log10E, const double costh) const
Get diffuse flux for given particle PDG-identifier, energy and zenith-angle.
Definition: JDiffuseFlux.hh:64
virtual ~JDiffuseFlux()
Virtual destructor.
Definition: JDiffuseFlux.hh:36
double getFactor(const Evt &evt) const override
Get diffuse flux for given event.
Definition: JDiffuseFlux.hh:46
double operator()(const int type, const double log10E, const double costh) const
Get diffuse flux for given particle PDG-identifier, energy and zenith-angle.
Definition: JDiffuseFlux.hh:96
void Print() const override
Print flux information.
double getFlux(const int type, const double log10E, const double costh) const
Get diffuse flux for given particle PDG-identifier, energy and zenith-angle.
Definition: JDiffuseFlux.hh:80
Low-level interface for retrieving the flux corresponding to a given event.
Definition: JFlux.hh:23
double getFlux(const Evt &evt) const
Get flux of given event.
Definition: JFlux.hh:37
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