Jpp 19.3.0-rc.3
the software that should make you happy
Loading...
Searching...
No Matches
JFluxHelper.hh
Go to the documentation of this file.
1#ifndef __JAANET__JFLUXHELPER__
2#define __JAANET__JFLUXHELPER__
3
5
7
8#include "JAAnet/JFlux.hh"
9
10
11/**
12 * \author bjung
13 */
14
15namespace JAANET {}
16namespace JPP { using namespace JAANET; }
17
18namespace JAANET {
19
20 /**
21 * Helper class for flux function.
22 */
23 struct JFluxHelper :
25 {
27
28
29 /**
30 * Default constructor.
31 */
33 {}
34
35
36 /**
37 * Constructor.
38 *
39 * \param flux flux function
40 */
44
45
46 /**
47 * Constructor.
48 *
49 * \param flux flux function
50 */
52 {
54 }
55
56
57 /**
58 * Get reference to flux function.
59 *
60 * \return reference to flux function
61 */
62 JFlux& getFlux() const
63 {
64 using namespace JPP;
65
66 JEvtWeightFactor& factor = this->getFactor();
67
68 JFlux* p = dynamic_cast<JFlux*>(&factor);
69
70 if (p != NULL) {
71 return *p;
72 } else {
73 THROW(JNullPointerException, "JFluxHelper::getFlux(): Cannot convert event-weight factor to flux function.");
74 }
75 }
76
77
78 /**
79 * Get flux of given event.
80 *
81 * \param evt event
82 * \return flux [GeV^-1 * m^-2 * sr^-1 * s^-1]
83 */
84 double getFlux(const Evt& evt) const
85 {
86 return getFactor(evt);
87 }
88 };
89}
90
91#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).
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
Definition Evt.hh:21
Helper class for event-weight factor.
std::shared_ptr< JEvtWeightFactor > pointer_type
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.
JFlux & getFlux() const
Get reference to flux function.
JFluxHelper()
Default constructor.
JFluxHelper(const JFlux &flux)
Constructor.
JFluxHelper(const pointer_type &flux)
Constructor.
double getFlux(const Evt &evt) const
Get flux of given event.
JEvtWeightFactorHelper::pointer_type pointer_type
Low-level interface for retrieving the flux corresponding to a given event.
Definition JFlux.hh:23
Neutrino flux.
Definition JHead.hh:906