Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
JDiffuseFluxHelper.hh
Go to the documentation of this file.
1#ifndef __JAANET__JDIFFUSEFLUXHELPER__
2#define __JAANET__JDIFFUSEFLUXHELPER__
3
5
10
11
12/**
13 * \author bjung
14 */
15
16namespace JAANET {}
17namespace JPP { using namespace JAANET; }
18
19namespace JAANET {
20
21 /**
22 * Helper class for diffuse flux factor.
23 */
25 public JFluxHelper
26 {
28
29
30 /**
31 * Default constructor.
32 */
35
36
37 /**
38 * Constructor.
39 *
40 * \param flux diffuse flux
41 */
45
46
47 /**
48 * Constructor.
49 *
50 * \param flux diffuse flux
51 */
56
57
58 /**
59 * Get reference to diffuse flux function.
60 *
61 * \return reference to diffuse flux function.
62 */
64 {
65 using namespace JPP;
66
68
69 JDiffuseFlux* p = dynamic_cast<JDiffuseFlux*>(&factor);
70
71 if (p != NULL) {
72 return *p;
73 } else {
74 THROW(JNullPointerException, "JDiffuseFluxHelper::getDiffuseFlux(): Cannot convert event-weight factor to diffuse flux function.");
75 }
76 }
77
78
79 /**
80 * Get flux for given particle PDG-identifier, energy and zenith-angle.
81 *
82 * \param type PDG particle type
83 * \param log10E logarithmic neutrino energy [GeV]
84 * \param costh cosine zenith angle
85 * \return diffuse flux [GeV^-1 * m^-2 * sr^-1 * s^-1]
86 */
87 double getFactor(const int type,
88 const double log10E,
89 const double costh) const
90 {
92
93 return flux(type, log10E, costh);
94 }
95
96
97 /**
98 * Get flux for given particle PDG-identifier, energy and zenith-angle.
99 *
100 * \param type PDG particle type
101 * \param log10E logarithmic neutrino energy [GeV]
102 * \param costh cosine zenith angle
103 * \return diffuse flux [GeV^-1 * m^-2 * sr^-1 * s^-1]
104 */
105 double getFlux(const int type,
106 const double log10E,
107 const double costh) const
108 {
109 return getFactor(type, log10E, costh);
110 }
111
112
113 /**
114 * Get flux for given particle PDG-identifier, energy and zenith-angle.
115 *
116 * \param type PDG particle type
117 * \param log10E logarithmic neutrino energy [GeV]
118 * \param costh cosine zenith angle
119 * \return diffuse flux [GeV^-1 * m^-2 * sr^-1 * s^-1]
120 */
121 double operator()(const int type,
122 const double log10E,
123 const double costh) const
124 {
125 return getFactor(type, log10E, costh);
126 }
127 };
128}
129
130#endif
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Exception for null pointer operation.
Extensions to Evt data format.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Helper class for diffuse flux factor.
double operator()(const int type, const double log10E, const double costh) const
Get flux for given particle PDG-identifier, energy and zenith-angle.
double getFlux(const int type, const double log10E, const double costh) const
Get flux for given particle PDG-identifier, energy and zenith-angle.
JFluxHelper::pointer_type pointer_type
double getFactor(const int type, const double log10E, const double costh) const
Get flux for given particle PDG-identifier, energy and zenith-angle.
JDiffuseFluxHelper(const pointer_type &flux)
Constructor.
JDiffuseFlux & getDiffuseFlux() const
Get reference to diffuse flux function.
JDiffuseFluxHelper(const JDiffuseFlux &flux)
Constructor.
JDiffuseFluxHelper()
Default constructor.
Low-level interface for diffuse fluxes.
void configure(const pointer_type &p)
Configure event-weight factor.
JEvtWeightFactor & getFactor() const
Get reference to event-weight factor.
Abstract base class for specifiable event-weight factors.
Helper class for flux function.
JEvtWeightFactorHelper::pointer_type pointer_type
Neutrino flux.
Definition JHead.hh:906