Jpp 19.3.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
JNOAA.cc File Reference

Example program to plot NOAA functions. More...

#include <iostream>
#include <iomanip>
#include <vector>
#include <map>
#include "TROOT.h"
#include "TFile.h"
#include "TH1D.h"
#include "TGraph.h"
#include "JCompass/JNOAA.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Example program to plot NOAA functions.

Author
mdejong

Definition in file JNOAA.cc.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 23 of file JNOAA.cc.

24{
25 using namespace std;
26 using namespace JPP;
27
28 string outputFile;
29 int debug;
30
31 try {
32
33 JParser<> zap("Example program to plot NOAA functions.");
34
35 zap['o'] = make_field(outputFile) = "noaa.root";
36 zap['d'] = make_field(debug) = 2;
37
38 zap(argc, argv);
39 }
40 catch(const exception &error) {
41 FATAL(error.what() << endl);
42 }
43
44
45 TFile out(outputFile.c_str(), "recreate");
46
47 TH1D h1("[ARCA]", NULL, 1000, getARCAMagneticDeclination.getXmin(), getARCAMagneticDeclination.getXmax());
48 TH1D h2("[ORCA]", NULL, 1000, getARCAMagneticDeclination.getXmin(), getARCAMagneticDeclination.getXmax());
49
50 for (Int_t ix = 1; ix <= h1.GetXaxis()->GetNbins(); ++ix) {
51
52 const double x = h1.GetBinCenter(ix);
53 const double y1 = getARCAMagneticDeclination(x);
54 const double y2 = getORCAMagneticDeclination(x);
55
56 DEBUG(FIXED(12,1) << x << ' ' << FIXED(7,3) << y1 << ' ' << FIXED(7,3) << y2 << endl);
57
58 h1.SetBinContent(ix, y1);
59 h2.SetBinContent(ix, y2);
60 }
61
62 out.Write();
63 out.Close();
64}
string outputFile
#define DEBUG(A)
Message macros.
Definition JMessage.hh:62
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:72
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
Utility class to parse command line options.
Definition JParser.hh:1698
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for floating point format specification.
Definition JManip.hh:448