Jpp master_rocky-44-g75b7c4f75
the software that should make you happy
Loading...
Searching...
No Matches
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
18namespace JOSCPROB {}
19namespace JPP { using namespace JOSCPROB; }
20
21namespace JOSCPROB {
22
23 using JLANG::JClonable;
24
25
26 /**
27 * Low-level interface for oscillation probability calculators.
28 */
30 public JBaselineComputer,
31 public JOscParametersHelper<double&>,
32 public JClonable<JOscProbInterface>
33 {
34 public:
35
37
40
43
44
45 /**
46 * Default constructor.
47 */
50
51
52 /**
53 * Constructor.
54 *
55 * \param parameters oscillation parameters
56 */
58 JOscParametersHelper_t(parameters)
59 {}
60
61
62 /**
63 * Constructor.
64 *
65 * \param parameters oscillation parameters
66 * \param name parameter name
67 * \param value parameter value
68 * \param args remaining pairs of parameter names and values
69 */
70 template<class ...Args>
72 const std::string& name,
73 double& value,
74 const Args& ...args) :
75 JOscParametersHelper_t(parameters, name, value, args...)
76 {}
77
78
79 /**
80 * Virtual destructor.
81 */
83 {}
84
85
86 /**
87 * Get oscillation probability for a given oscillation channel.
88 *
89 * \param channel oscillation channel
90 * \param E neutrino energy [GeV]
91 * \param costh cosine zenith angle
92 * \return oscillation probability
93 */
94 virtual double getP(const JOscChannel& channel,
95 const double E,
96 const double costh) const = 0;
97
98
99 /**
100 * Get oscillation probability for a given set of oscillation parameters\n
101 * and a given oscillation channel.
102 *
103 * \param channel oscillation channel
104 * \param parameters oscillation parameters
105 * \param E neutrino energy [GeV]
106 * \param costh cosine zenith angle
107 * \return oscillation probability
108 */
109 double getP(const JOscParameters_t& parameters,
110 const JOscChannel& channel,
111 const double E,
112 const double costh) const
113 {
114 this->set(parameters);
115
116 return getP(channel, E, costh);
117 }
118
119
120 /**
121 * Get oscillation probability for a given oscillation parameter\n
122 * and a given oscillation channel.
123 *
124 * \param name parameter name
125 * \param value parameter value
126 * \param channel oscillation channel
127 * \param E neutrino energy [GeV]
128 * \param costh cosine zenith angle
129 * \return oscillation probability
130 */
131 double getP(const std::string& name,
132 const double value,
133 const JOscChannel& channel,
134 const double E,
135 const double costh) const
136 {
137 this->set(name, value);
138
139 return getP(channel, E, costh);
140 }
141
142
143 /**
144 * Get oscillation probability for a given set of oscillation parameters\n
145 * and a given oscillation channel.
146 *
147 * \param name parameter name
148 * \param value parameter value
149 * \param args remaining arguments
150 */
151 template<class ...Args>
152 double getP(const std::string& name,
153 const double value,
154 const Args& ...args) const
155 {
156 this->set(name, value);
157
158 return getP(args...);
159 }
160
161
162 /**
163 * Get oscillation probability for a given oscillation channel.
164 *
165 * \param channel oscillation channel
166 * \param E neutrino energy [GeV]
167 * \param costh cosine zenith angle
168 * \return oscillation probability
169 */
170 double operator()(const JOscChannel& channel,
171 const double E,
172 const double costh) const
173 {
174 return getP(channel, E, costh);
175 }
176
177
178 /**
179 * Get oscillation probability for a given set of oscillation parameters\n
180 * and a given oscillation channel.
181 *
182 * \param channel oscillation channel
183 * \param parameters oscillation parameters
184 * \param E neutrino energy [GeV]
185 * \param costh cosine zenith angle
186 * \return oscillation probability
187 */
188 double operator()(const JOscParameters_t& parameters,
189 const JOscChannel& channel,
190 const double E,
191 const double costh) const
192 {
193 return getP(parameters, channel, E, costh);
194 }
195
196
197 /**
198 * Get oscillation probability for a given oscillation parameter\n
199 * and a given oscillation channel.
200 *
201 * \param name parameter name
202 * \param value parameter value
203 * \param channel oscillation channel
204 * \param E neutrino energy [GeV]
205 * \param costh cosine zenith angle
206 * \return oscillation probability
207 */
208 double operator()(const std::string& name,
209 const double value,
210 const JOscChannel& channel,
211 const double E,
212 const double costh) const
213 {
214 return getP(name, value, channel, E, costh);
215 }
216
217
218 /**
219 * Get oscillation probability for a given set of oscillation parameters\n
220 * and a given oscillation channel.
221 *
222 * \param name parameter name
223 * \param value parameter value
224 * \param args remaining arguments
225 */
226 template<class ...Args>
227 double operator()(const std::string& name,
228 const double value,
229 const Args& ...args) const
230 {
231 return getP(name, value, args...);
232 }
233 };
234}
235
236#endif
Exceptions.
Parameter class.
Definition JParameter.hh:36
Interface class for sets of oscillation parameters.
Low-level interface for oscillation probability calculators.
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.
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...
JOscProbInterface()
Default constructor.
JOscParametersHelper< double & > JOscParametersHelper_t
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...
JOscParameters_t::JOscParameter_t JOscParameter_t
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...
virtual double getP(const JOscChannel &channel, const double E, const double costh) const =0
Get oscillation probability for 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.
virtual ~JOscProbInterface()
Virtual destructor.
JOscProbInterface(const JOscParameterReferences_t &parameters, const std::string &name, double &value, const Args &...args)
Constructor.
JOscParametersInterface< double & > JOscParameterReferences_t
JOscParameters_t::JParameter_t JParameter_t
double operator()(const JOscChannel &channel, const double E, const double costh) const
Get oscillation probability for a given oscillation channel.
JOscParametersInterface< double > JOscParameters_t
JOscProbInterface(const JOscParameterReferences_t &parameters)
Constructor.
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...
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Template class for object cloning.
Definition JClonable.hh:59
Auxiliary data structure for storing and calculating baselines.
Neutrino oscillation channel.
Abstract base class for oscillation parameter.
Helper class for oscillation parameters.
void set(const std::string &name, const value_type &value) const