Jpp  18.0.0
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 
13 
14  /**
15  * Function object for constant fluxes.
16  */
17  struct JFlatFlux
18  {
19  /**
20  * Default constructor.
21  */
23  flux(0.0)
24  {}
25 
26 
27  /**
28  * Constructor.
29  *
30  * \param flux [GeV * m^-2 * sr^-1 * s^-1]
31  */
32  JFlatFlux(const double flux) :
33  flux(flux)
34  {}
35 
36 
37  /**
38  * Get flux of given event.
39  *
40  * \param evt event
41  * \return flux [GeV * m^-2 * sr^-1 * s^-1]
42  */
43  double operator()(const Evt& evt) const
44  {
45  return flux;
46  }
47 
48 
49  /**
50  * Stream input.
51  *
52  * \param in input stream
53  * \param object uniform flux
54  * \return input stream
55  */
56  friend inline std::istream& operator>>(std::istream& in, JFlatFlux& object)
57  {
58  in >> object.flux;
59 
60  return in;
61  }
62 
63 
64  /**
65  * Write flux to output stream.
66  *
67  * \param out output stream
68  * \param object uniform
69  * \return output stream
70  */
71  friend inline std::ostream& operator<<(std::ostream& out, const JFlatFlux& object)
72  {
73  const JFormat format(out);
74 
75  out << FIXED(5,3) << object.flux;
76 
77  return out;
78  }
79 
80  double flux; //!< flux [GeV * m^-2 * sr^-1 * s^-1]
81  };
82 
83 
84  /**
85  * Auxiliary method for creating an interface to a flat flux function.
86  *
87  * \param flux flux [GeV * m^-2 * sr^-1 * s^-1]
88  */
90 
91  const JFlatFlux flatFlux(flux);
92 
93  return make_fluxFunction(flatFlux);
94  }
95 }
96 
97 #endif
Implementation of event-weight factor interface.
JFlatFlux(const double flux)
Constructor.
Definition: JFlatFlux.hh:32
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:893
friend std::istream & operator>>(std::istream &in, JFlatFlux &object)
Stream input.
Definition: JFlatFlux.hh:56
friend std::ostream & operator<<(std::ostream &out, const JFlatFlux &object)
Write flux to output stream.
Definition: JFlatFlux.hh:71
double operator()(const Evt &evt) const
Get flux of given event.
Definition: JFlatFlux.hh:43
Function object for constant fluxes.
Definition: JFlatFlux.hh:17
double flux
flux [GeV * m^-2 * sr^-1 * s^-1]
Definition: JFlatFlux.hh:80
JFlatFlux()
Default constructor.
Definition: JFlatFlux.hh:22
JEvtWeightFactorFunction< JFlatFlux, JFlux > make_flatFluxFunction(const double flux)
Auxiliary method for creating an interface to a flat flux function.
Definition: JFlatFlux.hh:89
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