Jpp 21.0.0-rc.3
the software that should make you happy
Loading...
Searching...
No Matches
JPDFSupportkit.cc File Reference

Program to plot PDF support data. More...

#include <string>
#include <iostream>
#include <iomanip>
#include "TROOT.h"
#include "TFile.h"
#include "TH1D.h"
#include "JPhysics/Antares.hh"
#include "JPhysics/KM3NeT.hh"
#include "JPhysics/JPDFSupportkit.hh"
#include "Jeep/JProperties.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

Program to plot PDF support data.

Author
mdejong

Definition in file examples/JPhysics/JPDFSupportkit.cc.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 24 of file examples/JPhysics/JPDFSupportkit.cc.

25{
26 using namespace std;
27 using namespace JPP;
28
29 PDF::configuration_type configuration;
30 string outputFile;
31 int debug;
32
33
34 JProperties properties = configuration.getProperties();
35
36 try {
37
38 JParser<> zap("Program to plot PDF support data.");
39
40 zap['@'] = make_field(properties, PDF::help() << configuration) = JPARSER::initialised();
41 zap['o'] = make_field(outputFile) = "pdf.root";
42 zap['d'] = make_field(debug) = 0;
43
44 zap(argc, argv);
45 }
46 catch(const exception &error) {
47 FATAL(error.what() << endl);
48 }
49
50 TFile out(outputFile.c_str(), "recreate");
51
52 TH1D h1("h1", NULL, 900, 240.0, 800.0);
53 TH1D h2("h2", NULL, 900, 240.0, 800.0);
54 TH1D h3("h3", NULL, 900, 240.0, 800.0);
55 TH1D h4("h4", NULL, 900, -1.0, +1.0);
56 TH1D h5("h5", NULL, 900, -1.0, +1.0);
57
58 for(int ix = 1; ix <= h1.GetNbinsX(); ++ix) {
59
60 const double x = h1.GetBinCenter(ix);
61 const double y = PDF::getAbsorptionLength(x);
62
63 h1.SetBinContent(ix, y);
64 }
65
66 for(int ix = 1; ix <= h2.GetNbinsX(); ++ix) {
67
68 const double x = h2.GetBinCenter(ix);
69 const double y = PDF::getScatteringLength(x);
70
71 h2.SetBinContent(ix, y);
72 }
73
74 for(int ix = 1; ix <= h3.GetNbinsX(); ++ix) {
75
76 const double x = h3.GetBinCenter(ix);
77 const double y = PDF::getQE(x);
78
79 h3.SetBinContent(ix, y);
80 }
81
82 for(int ix = 1; ix <= h4.GetNbinsX(); ++ix) {
83
84 const double x = h4.GetBinCenter(ix);
85 const double y = PDF::getAngularAcceptance(x);
86
87 h4.SetBinContent(ix, y);
88 }
89
90 for(int ix = 1; ix <= h5.GetNbinsX(); ++ix) {
91
92 const double x = h5.GetBinCenter(ix);
93 const double y = PDF::getScatteringProbability(x);
94
95 h5.SetBinContent(ix, y);
96 }
97
98 out.Write();
99 out.Close();
100}
string outputFile
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:74
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2107
Utility class to parse parameter values.
Utility class to parse command line options.
Definition JParser.hh:1664
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Definition JParser.hh:66
Auxiliary data structure for complete configuration.
JProperties getProperties()
Get properties.
Manipulator for help output.