Test program for JFIT::JEstimator<JPoint3D> fit.
More...
#include <string>
#include <iostream>
#include <iomanip>
#include <vector>
#include "TROOT.h"
#include "TFile.h"
#include "TH1D.h"
#include "TRandom3.h"
#include "JGeometry3D/JAxis3D.hh"
#include "JFit/JPoint3D.hh"
#include "JFit/JPoint3DEstimator.hh"
#include "JROOT/JRootToolkit.hh"
#include "JTools/JStats.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"
#include "Jeep/JPrint.hh"
Go to the source code of this file.
|
| int | main (int argc, char **argv) |
| |
Test program for JFIT::JEstimator<JPoint3D> fit.
- Author
- mdejong
Definition in file JPoint3D.cc.
◆ main()
| int main |
( |
int | argc, |
|
|
char ** | argv ) |
Definition at line 28 of file JPoint3D.cc.
29{
32
34 int numberOfEvents;
36 double sigma;
37 double precision;
39
40 try {
41
43
50
52 }
53 catch(const exception &error) {
55 }
56
57
58 TH1D hx(
"hx",
NULL, 101, -1.0, +1.0);
59 TH1D hy(
"hy",
NULL, 101, -1.0, +1.0);
60 TH1D hz(
"hz",
NULL, 101, -1.0, +1.0);
61
65
66
67 for (int i = 0; i != numberOfEvents; ++i) {
68
70
71
72
74
76
77 const double x =
gRandom->Gaus(0.0, sigma);
78 const double y =
gRandom->Gaus(0.0, sigma);
79 const double z =
gRandom->Gaus(0.0, sigma);
80
81 const double dx =
gRandom->Uniform(-1, +1);
82 const double dy =
gRandom->Uniform(-1, +1);
83 const double dz =
gRandom->Uniform(-1, +1);
84
86 }
87
88
89
91
95
99 }
100
101 if (
debug >= debug_t) {
105 }
106
108
110
111 out << hx << hy << hz;
112
113 out.Write();
114 out.Close();
115 }
116
117 ASSERT(numberOfEvents > 0);
118
119 ASSERT(fabs(Qx.getMean()) <= precision);
120 ASSERT(fabs(
Qy.getMean()) <= precision);
121 ASSERT(fabs(
Qz.getMean()) <= precision);
122
123 ASSERT(Qx.getSTDev() <= precision);
126
127 return 0;
128}
#define ASSERT(A,...)
Assert macro.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Data structure for vector in three dimensions.
Data structure for normalised vector in three dimensions.
Template definition of a multi-dimensional oscillation probability interpolation table.
Utility class to parse command line options.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).