Jpp  18.2.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JFlatFlux.hh
Go to the documentation of this file.
1 #ifndef __JAANET__JFLATFLUX__
2 #define __JAANET__JFLATFLUX__
3 
5 
6 
7 /**
8  * \author bjung
9  */
10 
11 namespace JAANET {}
12 namespace JPP { using namespace JAANET; }
13 
14 namespace JAANET {
15 
16 
17  /**
18  * Function object for constant fluxes.
19  */
20  struct JFlatFlux
21  {
22  /**
23  * Default constructor.
24  */
26  flux(0.0)
27  {}
28 
29 
30  /**
31  * Constructor.
32  *
33  * \param flux [GeV * m^-2 * sr^-1 * s^-1]
34  */
35  JFlatFlux(const double flux) :
36  flux(flux)
37  {}
38 
39 
40  /**
41  * Get flux of given event.
42  *
43  * \param evt event
44  * \return flux [GeV * m^-2 * sr^-1 * s^-1]
45  */
46  double operator()(const Evt& evt) const
47  {
48  return flux;
49  }
50 
51 
52  /**
53  * Stream input.
54  *
55  * \param in input stream
56  * \param object uniform flux
57  * \return input stream
58  */
59  friend inline std::istream& operator>>(std::istream& in, JFlatFlux& object)
60  {
61  in >> object.flux;
62 
63  return in;
64  }
65 
66 
67  /**
68  * Write flux to output stream.
69  *
70  * \param out output stream
71  * \param object uniform
72  * \return output stream
73  */
74  friend inline std::ostream& operator<<(std::ostream& out, const JFlatFlux& object)
75  {
76  const JFormat format(out);
77 
78  out << FIXED(5,3) << object.flux;
79 
80  return out;
81  }
82 
83  double flux; //!< flux [GeV * m^-2 * sr^-1 * s^-1]
84  };
85 
86 
87  /**
88  * Auxiliary method for creating an interface to a flat flux function.
89  *
90  * \param flux flux [GeV * m^-2 * sr^-1 * s^-1]
91  */
93 
94  const JFlatFlux flatFlux(flux);
95 
96  return make_fluxFunction(flatFlux);
97  }
98 }
99 
100 #endif
Implementation of event-weight factor interface.
JFlatFlux(const double flux)
Constructor.
Definition: JFlatFlux.hh:35
Auxiliary data structure for floating point format specification.
Definition: JManip.hh:446
JEvtWeightFactorFunction< JFunction_t, JFlux > make_fluxFunction(const JFunction_t &flux)
Auxiliary method for creating an interface to a flux function.
Auxiliary class to temporarily define format specifications.
Definition: JManip.hh:632
Neutrino flux.
Definition: JHead.hh:906
friend std::istream & operator>>(std::istream &in, JFlatFlux &object)
Stream input.
Definition: JFlatFlux.hh:59
friend std::ostream & operator<<(std::ostream &out, const JFlatFlux &object)
Write flux to output stream.
Definition: JFlatFlux.hh:74
double operator()(const Evt &evt) const
Get flux of given event.
Definition: JFlatFlux.hh:46
Function object for constant fluxes.
Definition: JFlatFlux.hh:20
double flux
flux [GeV * m^-2 * sr^-1 * s^-1]
Definition: JFlatFlux.hh:83
JFlatFlux()
Default constructor.
Definition: JFlatFlux.hh:25
JEvtWeightFactorFunction< JFlatFlux, JFlux > make_flatFluxFunction(const double flux)
Auxiliary method for creating an interface to a flat flux function.
Definition: JFlatFlux.hh:92
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
Definition: Evt.hh:20