Jpp  18.0.0-rc.2
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
JPrintOscProb.cc File Reference

Example program to print oscillation probabilities interpolated in energy and zenith-angle. More...

#include <iostream>
#include <iomanip>
#include <string>
#include <map>
#include "Jeep/JPrint.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"
#include "JOscProb/JOscChannel.hh"
#include "JOscProb/JOscParameters.hh"
#include "JOscProb/JOscProbInterpolator.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Example program to print oscillation probabilities interpolated in energy and zenith-angle.

Author
bjung

Definition in file JPrintOscProb.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 21 of file JPrintOscProb.cc.

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))")
39  zap['@'] = make_field(parameters, "Oscillation parameters")
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 }
Utility class to parse command line options.
Definition: JParser.hh:1514
*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
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Definition: JParser.hh:83
Auxiliary data structure for floating point format specification.
Definition: JManip.hh:446
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1989
#define NOTICE(A)
Definition: JMessage.hh:64
#define FATAL(A)
Definition: JMessage.hh:67
then for APP in event gandalf start energy
Definition: JMuonMCEvt.sh:44
int debug
debug level
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62