Jpp  18.3.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JOscProbFunction.hh
Go to the documentation of this file.
1 #ifndef __JOSCPROB__JOSCPROBFUNCTION__
2 #define __JOSCPROB__JOSCPROBFUNCTION__
3 
4 #include "JLang/JClonable.hh"
5 
9 
10 
11 /**
12  * \author bjung
13  */
14 
15 namespace JOSCPROB {}
16 namespace JPP { using namespace JOSCPROB; }
17 
18 namespace JOSCPROB {
19 
20  using JLANG::JClonable;
21 
22 
23  /**
24  * Implementation of oscillation probability function interface.
25  *
26  * The template argument refers to a function of which the copy constuctor needs to be defined\n
27  * and which must contain the methods `setParameters(const JOscParameters&)` and `getP(const JOscChannel&, const double, const double)`.
28  */
29  template<class JFunction_t>
31  public JClonable<JOscProbInterface, JOscProbFunction<JFunction_t> >
32  {
34 
35  /**
36  * Constructor.
37  *
38  * \param function oscillation probability function
39  */
40  JOscProbFunction(const JFunction_t& function) :
42  {}
43 
44 
45  /**
46  * Set oscillation parameters.
47  *
48  * \param parameters oscillation parameters
49  */
51  {
52  function.setParameters(parameters);
53  }
54 
55 
56  /**
57  * Get cosine zenith angle for a given baseline.
58  *
59  * \param L baseline [km]
60  * \return cosine zenith angle
61  */
62  double getCosth(const double L) const override
63  {
64  return function.getCosth(L);
65  }
66 
67 
68  /**
69  * Get baseline for a given cosine zenith angle.
70  *
71  * \param costh cosine zenith angle
72  * \return baseline [km]
73  */
74  double getBaseline(const double costh) const override
75  {
76  return function.getBaseline(costh);
77  }
78 
79 
80  /**
81  * Get oscillation probability for given oscillation channel.
82  *
83  * \param channel oscillation channel
84  * \param energy neutrino energy [GeV]
85  * \param costh cosine zenith angle
86  * \return oscillation probability
87  */
88  double getP(const JOscChannel& channel,
89  const double energy,
90  const double costh) const override
91  {
92  return function.getP(channel, energy, costh);
93  }
94 
95 
96  private:
97 
98  JFunction_t function; //!< oscillation probability function
99  };
100 
101 
102  /**
103  * Auxiliary method for creating an interface to an oscillation probability function.
104  *
105  * \param function oscillation probability function object
106  * \return oscillation probability function interface
107  */
108  template<class JFunction_t>
109  inline JOscProbFunction<JFunction_t> make_oscProbFunction(const JFunction_t& function) {
110  return JOscProbFunction<JFunction_t>(function);
111  }
112 }
113 
114 #endif
double getCosth(const double L) const override
Get cosine zenith angle for a given baseline.
Implementation of oscillation probability function interface.
Neutrino oscillation channel.
Definition: JOscChannel.hh:110
JFunction_t function
oscillation probability function
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
Definition: diff-Tuna.sh:38
double getBaseline(const double costh) const override
Get baseline for a given cosine zenith angle.
JOscProbFunction< JFunction_t > make_oscProbFunction(const JFunction_t &function)
Auxiliary method for creating an interface to an oscillation probability function.
Template class for object cloning.
Definition: JClonable.hh:20
JOscProbFunction(const JFunction_t &function)
Constructor.
then for APP in event gandalf start energy
Definition: JMuonMCEvt.sh:44
JOscProbInterface::JOscParameters_t JOscParameters_t
void setParameters(const JOscParameters_t &parameters) const
Set oscillation parameters.
Interface class for sets of oscillation parameters.
double getP(const JOscChannel &channel, const double energy, const double costh) const override
Get oscillation probability for given oscillation channel.