Jpp  16.0.1
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 
21  /**
22  * Low-level interface for diffuse fluxes.
23  */
24  struct JDiffuseFlux :
25  public JFlux,
26  public DiffuseFlux
27  {
28  /**
29  * Virtual destructor.
30  */
31  virtual ~JDiffuseFlux()
32  {}
33 
34 
35  /**
36  * Get event-weight factor for given event.
37  *
38  * \param evt event
39  * \return event-weight factor [GeV^-1 * m^-2 * sr^-1 * s^-1]
40  */
41  double getFactor(const Evt& evt) const override
42  {
43  const Trk& neutrino = get_neutrino(evt);
44  const double log10E = log10(neutrino.E);
45  const double costh = neutrino.dir.z / neutrino.dir.len();
46 
47  return dNdEdOmega(neutrino.type, log10E, costh);
48  }
49 
50 
51  /**
52  * Get event-weight factor for given particle PDG-identifier, energy and zenith-angle.
53  *
54  * \param type PDG particle type
55  * \param log10E logarithmic energy
56  * \param costh cosine zenith angle
57  * \return diffuse flux [GeV^-1 * m^-2 * sr^-1 * s^-1]
58  */
59  double getFactor(const int type,
60  const double log10E,
61  const double costh) const
62  {
63  return dNdEdOmega(type, log10E, costh);
64  }
65 
66 
67  /**
68  * Get event-weight factor for given particle PDG-identifier, energy and zenith-angle.
69  *
70  * \param type PDG particle type
71  * \param log10E logarithmic energy
72  * \param costh cosine zenith angle
73  * \return diffuse flux [GeV^-1 * m^-2 * sr^-1 * s^-1]
74  */
75  double getFlux(const int type,
76  const double log10E,
77  const double costh) const
78  {
79  return dNdEdOmega(type, log10E, costh);
80  }
81 
82 
83  /**
84  * Print flux information.
85  */
86  virtual void Print() override
87  {
88  prnt(std::cout);
89  }
90  };
91 }
92 
93 #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:75
double z
Definition: Vec.hh:14
double getFactor(const Evt &evt) const override
Get event-weight factor for given event.
Definition: JDiffuseFlux.hh:41
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
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:59
Definition of hit and track types and auxiliary methods for handling Monte Carlo data.
Low-level interface for diffuse fluxes.
Definition: JDiffuseFlux.hh:24
Low-level interface for retrieving the flux corresponding to a given event.
Definition: JFlux.hh:18
int type
MC: particle type in PDG encoding.
Definition: Trk.hh:24
virtual void Print() override
Print flux information.
Definition: JDiffuseFlux.hh:86
virtual ~JDiffuseFlux()
Virtual destructor.
Definition: JDiffuseFlux.hh:31
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:19