#include #include #include #include #include "TROOT.h" #include "TFile.h" #include "TH1D.h" #include "TGraph.h" #include "JCompass/JNOAA.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * \file * * Example program to plot NOAA functions. * \author mdejong */ int main(int argc, char **argv) { using namespace std; using namespace JPP; string outputFile; int debug; try { JParser<> zap("Example program to plot NOAA functions."); zap['o'] = make_field(outputFile) = "noaa.root"; zap['d'] = make_field(debug) = 2; zap(argc, argv); } catch(const exception &error) { FATAL(error.what() << endl); } TFile out(outputFile.c_str(), "recreate"); TH1D h1("[ARCA]", NULL, 1000, getARCAMagneticDeclination.getXmin(), getARCAMagneticDeclination.getXmax()); TH1D h2("[ORCA]", NULL, 1000, getARCAMagneticDeclination.getXmin(), getARCAMagneticDeclination.getXmax()); for (Int_t ix = 1; ix <= h1.GetXaxis()->GetNbins(); ++ix) { const double x = h1.GetBinCenter(ix); const double y1 = getARCAMagneticDeclination(x); const double y2 = getORCAMagneticDeclination(x); h1.SetBinContent(ix, y1); h2.SetBinContent(ix, y2); } out.Write(); out.Close(); }