30{
33
35 int numberOfEvents;
38
39 try {
40
41 JParser<> zap(
"Example program to test JOmega3D class.");
42
47
48 zap(argc, argv);
49 }
50 catch(const exception &error) {
51 FATAL(error.what() << endl);
52 }
53
54
55 const int N = 10;
56
60
61
64
65 for (int i = 1; i <= h0.GetNbinsX(); ++i) {
66
67 const Double_t
x = h0.GetBinCenter(i);
68
69 omega .push_back(
JOmega3D(x * PI/180.0));
71 }
72
73
74 for (int i = 0; i != numberOfEvents; ++i) {
75
76 STATUS(
"event: " << setw(10) << i <<
'\r');
DEBUG(endl);
77
78 const double theta = gRandom->Uniform(0.0, PI);
79 const double phi = gRandom->Uniform(0.0, 2*PI);
80
82
83 for (
size_t j = 0;
j != omega.size(); ++
j) {
84
85 const int pos = omega[
j].find(angle);
86 const double dot = angle.getDot(omega[j][pos]);
87
88 quantile[
j].put(acos(dot) * 180.0/PI);
89 }
90 }
92
93
94 for (int i = 1; i <= h0.GetNbinsX(); ++i) {
95 h0.SetBinContent(i, omega [i-1].size());
96 h1.SetBinContent(i, quantile[i-1].getSTDev());
97 h2.SetBinContent(i, quantile[i-1].getDeviation());
98 }
99
101
103
104 out << h0 << h1 << h2;
105
106 out.Write();
107 out.Close();
108 }
109
110 for (int i = 1; i <= h2.GetNbinsX(); ++i) {
111
112 const Double_t
x = h2.GetBinCenter (i);
113 const Double_t
y = h2.GetBinContent(i);
114
115 NOTICE(
"Grid test " << x <<
" [deg]: " << y <<
" [deg]." << endl);
117 }
118
119 return 0;
120}
#define DEBUG(A)
Message macros.
#define ASSERT(A,...)
Assert macro.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Data structure for angles in three dimensions.
Direction set covering (part of) solid angle.
Utility class to parse command line options.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).