Jpp
17.3.0-rc.2
the software that should make you happy
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
examples
JOscProb
JPrintOscProb.cc
Go to the documentation of this file.
1
#include <iostream>
2
#include <iomanip>
3
#include <string>
4
#include <map>
5
6
#include "
Jeep/JPrint.hh
"
7
#include "
Jeep/JParser.hh
"
8
#include "
Jeep/JMessage.hh
"
9
10
#include "
JOscProb/JOscChannel.hh
"
11
#include "
JOscProb/JOscParameters.hh
"
12
#include "
JOscProb/JOscProbInterpolator.hh
"
13
14
15
/**
16
* \file
17
* Example program to print oscillation probabilities interpolated in energy and zenith-angle.
18
*
19
* \author bjung
20
*/
21
int
main
(
int
argc,
char
**argv)
22
{
23
using namespace
std;
24
using namespace
JPP;
25
26
string
inputFile;
27
JOscParameters
parameters
;
28
map<double, double>
interpolationValues;
29
JOscChannel channel;
30
int
debug
;
31
32
try
{
33
34
JParser<>
zap;
35
36
zap[
'f'
] =
make_field
(inputFile,
"8D oscillation probability table file"
);
37
zap[
'x'
] =
make_field
(interpolationValues,
"Map of interpolation values in (energy [GeV], cos(theta))"
)
38
=
JPARSER::initialised
();
39
zap[
'@'
] =
make_field
(
parameters
,
"Oscillation parameters"
)
40
=
JPARSER::initialised
();
41
zap[
'#'
] =
make_field
(channel,
"Oscillation channel"
)
42
= JOscChannel(JFlavour_t::MUON, JFlavour_t::MUON, JChargeParity_t::PARTICLE);
43
zap[
'd'
] =
make_field
(
debug
)
44
= 3;
45
46
zap(argc, argv);
47
}
48
catch
(
const
exception& error) {
49
FATAL
(error.what() << endl);
50
}
51
52
53
JOscProbInterpolator<> interpolator(inputFile.c_str(),
parameters
);
54
55
NOTICE
(
RIGHT
(15) <<
"Energy [GeV]"
<<
56
RIGHT
(15) <<
"cos(theta)"
<<
57
RIGHT
(15) <<
"P"
<< endl);
58
59
for
(
map<double, double>::const_iterator
i = interpolationValues.cbegin(); i != interpolationValues.cend(); ++i) {
60
61
const
double
energy
= i->first;
62
const
double
costh = i->second;
63
64
const
double
oscProb = interpolator(channel, energy, costh);
65
66
NOTICE
(
FIXED
(15,3) << energy <<
67
FIXED
(15,3) << costh <<
68
FIXED
(15,3) << oscProb <<
'\r'
);
DEBUG
(endl);
69
}
70
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1517
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
std::map
Definition:
JSTDTypes.hh:16
parameters
*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
JPARSER::initialised
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Definition:
JParser.hh:83
FIXED
Auxiliary data structure for floating point format specification.
Definition:
JManip.hh:446
JPrint.hh
I/O formatting auxiliaries.
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1993
NOTICE
#define NOTICE(A)
Definition:
JMessage.hh:64
JMessage.hh
General purpose messaging.
JOscProbInterpolator.hh
JLANG::RIGHT
Definition:
JTwosome.hh:18
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
energy
then for APP in event gandalf start energy
Definition:
JMuonMCEvt.sh:44
JParser.hh
Utility class to parse command line options.
JOscChannel.hh
JOscParameters.hh
debug
int debug
debug level
Definition:
archive-put-wiki-detectors.sh:92
DEBUG
#define DEBUG(A)
Message macros.
Definition:
JMessage.hh:62
Generated by
1.8.5