Jpp  18.3.0-rc.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JOscProbInterface.hh
Go to the documentation of this file.
1 #ifndef __JOSCPROB__JOSCPROBINTERFACE__
2 #define __JOSCPROB__JOSCPROBINTERFACE__
3 
4 #include <memory>
5 
6 #include "JLang/JClonable.hh"
7 #include "JLang/JException.hh"
8 
12 
13 
14 /**
15  * \author bjung, mdejong
16  */
17 
18 namespace JOSCPROB {}
19 namespace JPP { using namespace JOSCPROB; }
20 
21 namespace JOSCPROB {
22 
23  using JLANG::JClonable;
24 
25 
26  /**
27  * Low-level interface for oscillation probability calculators.
28  */
31  public JOscParametersHelper<double>,
32  public JClonable<JOscProbInterface>
33  {
34  public:
35 
37 
42 
43 
44  /**
45  * Default constructor.
46  */
48  {}
49 
50 
51  /**
52  * Virtual destructor.
53  */
55  {}
56 
57 
58  /**
59  * Get oscillation probability for a given oscillation channel.
60  *
61  * \param channel oscillation channel
62  * \param E neutrino energy [GeV]
63  * \param costh cosine zenith angle
64  * \return oscillation probability
65  */
66  virtual double getP(const JOscChannel& channel,
67  const double E,
68  const double costh) const = 0;
69 
70 
71  /**
72  * Get oscillation probability for a given set of oscillation parameters\n
73  * and a given oscillation channel.
74  *
75  * \param channel oscillation channel
76  * \param parameters oscillation parameters
77  * \param E neutrino energy [GeV]
78  * \param costh cosine zenith angle
79  * \return oscillation probability
80  */
82  const JOscChannel& channel,
83  const double E,
84  const double costh) const
85  {
86  this->set(parameters);
87 
88  return getP(channel, E, costh);
89  }
90 
91 
92  /**
93  * Get oscillation probability for a given oscillation parameter\n
94  * and a given oscillation channel.
95  *
96  * \param name parameter name
97  * \param value parameter value
98  * \param channel oscillation channel
99  * \param E neutrino energy [GeV]
100  * \param costh cosine zenith angle
101  * \return oscillation probability
102  */
103  double getP(const std::string& name,
104  const double value,
105  const JOscChannel& channel,
106  const double E,
107  const double costh) const
108  {
109  this->set(name, value);
110 
111  return getP(channel, E, costh);
112  }
113 
114 
115  /**
116  * Get oscillation probability for a given set of oscillation parameters\n
117  * and a given oscillation channel.
118  *
119  * \param name parameter name
120  * \param value parameter value
121  * \param args remaining arguments
122  */
123  template<class ...Args>
124  double getP(const std::string& name,
125  const double value,
126  const Args& ...args) const
127  {
128  this->set(name, value);
129 
130  return getP(args...);
131  }
132 
133 
134  /**
135  * Get oscillation probability for a given oscillation channel.
136  *
137  * \param channel oscillation channel
138  * \param E neutrino energy [GeV]
139  * \param costh cosine zenith angle
140  * \return oscillation probability
141  */
142  double operator()(const JOscChannel& channel,
143  const double E,
144  const double costh) const
145  {
146  return getP(channel, E, costh);
147  }
148 
149 
150  /**
151  * Get oscillation probability for a given set of oscillation parameters\n
152  * and a given oscillation channel.
153  *
154  * \param channel oscillation channel
155  * \param parameters oscillation parameters
156  * \param E neutrino energy [GeV]
157  * \param costh cosine zenith angle
158  * \return oscillation probability
159  */
161  const JOscChannel& channel,
162  const double E,
163  const double costh) const
164  {
165  return getP(parameters, channel, E, costh);
166  }
167 
168 
169  /**
170  * Get oscillation probability for a given oscillation parameter\n
171  * and a given oscillation channel.
172  *
173  * \param name parameter name
174  * \param value parameter value
175  * \param channel oscillation channel
176  * \param E neutrino energy [GeV]
177  * \param costh cosine zenith angle
178  * \return oscillation probability
179  */
180  double operator()(const std::string& name,
181  const double value,
182  const JOscChannel& channel,
183  const double E,
184  const double costh) const
185  {
186  return getP(name, value, channel, E, costh);
187  }
188 
189 
190  /**
191  * Get oscillation probability for a given set of oscillation parameters\n
192  * and a given oscillation channel.
193  *
194  * \param name parameter name
195  * \param value parameter value
196  * \param args remaining arguments
197  */
198  template<class ...Args>
199  double operator()(const std::string& name,
200  const double value,
201  const Args& ...args) const
202  {
203  return getP(name, value, args...);
204  }
205  };
206 }
207 
208 #endif
Abstract base class for oscillation parameter.
Exceptions.
virtual double getP(const JOscChannel &channel, const double E, const double costh) const =0
Get oscillation probability for a given oscillation channel.
then usage $script< input file >[option[primary[working directory]]] nWhere option can be E
Definition: JMuonPostfit.sh:40
Neutrino oscillation channel.
Definition: JOscChannel.hh:110
Parameter class.
Definition: JParameter.hh:34
JOscParametersHelper_t::JOscParameters_t JOscParameters_t
JOscParametersHelper_t::JOscParameter_t JOscParameter_t
JOscParametersHelper< double > JOscParametersHelper_t
Low-level interface for oscillation baseline calculators.
Low-level interface for oscillation probability calculators.
then echo Enter input within $TIMEOUT_S seconds echo n User name
Definition: JCookie.sh:42
*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
virtual ~JOscProbInterface()
Virtual destructor.
double getP(const JOscParameters_t &parameters, const JOscChannel &channel, const double E, const double costh) const
Get oscillation probability for a given set of oscillation parameters and a given oscillation channel...
virtual void set(const std::string &name, argument_type value) const
Set value for a given oscillation parameter.
double operator()(const JOscParameters_t &parameters, const JOscChannel &channel, const double E, const double costh) const
Get oscillation probability for a given set of oscillation parameters and a given oscillation channel...
Helper class for oscillation parameters.
JOscParametersHelper_t::JParameter_t JParameter_t
Template class for object cloning.
Definition: JClonable.hh:20
then awk string
JOscParametersHelper_t::argument_type argument_type
double getP(const std::string &name, const double value, const Args &...args) const
Get oscillation probability for a given set of oscillation parameters and a given oscillation channel...
JOscProbInterface()
Default constructor.
double operator()(const std::string &name, const double value, const Args &...args) const
Get oscillation probability for a given set of oscillation parameters and a given oscillation channel...
double getP(const std::string &name, const double value, const JOscChannel &channel, const double E, const double costh) const
Get oscillation probability for a given oscillation parameter and a given oscillation channel...
double operator()(const JOscChannel &channel, const double E, const double costh) const
Get oscillation probability for a given oscillation channel.
JOscParameters_t::argument_type argument_type
Interface class for sets of oscillation parameters.
double operator()(const std::string &name, const double value, const JOscChannel &channel, const double E, const double costh) const
Get oscillation probability for a given oscillation parameter and a given oscillation channel...