31{
34
35 string inputFile;
37 int numberOfEvents;
39 double precision;
41
42 try {
43
45
52
54 }
55 catch(const exception& error) {
57 }
58
59
60 TH1D hx(
"hx",
NULL, 101, -1.0, +1.0);
61 TH1D hy(
"hy",
NULL, 101, -1.0, +1.0);
63
67
68
70
72
73 if (inputFile != "") {
74
75 ifstream in(inputFile.c_str());
76
77 for (
double x, y, z; in >>
x >>
y >> z; ) {
79 }
80
81 in.close();
82
83 } else {
84
86
89 }
90 }
91
92
94
95 const double xmin = -1.0;
96 const double xmax = +1.0;
97
98 const double tmin = -1.0;
99 const double tmax = +1.0;
100
101 for (int i = 0; i != numberOfEvents; ++i) {
102
103
104
105 const double x = 0.0 +
gRandom->Uniform(xmin, xmax);
106 const double y = 0.0 +
gRandom->Uniform(xmin, xmax);
107 const double z = 0.0;
108 const double t = 0.0 +
gRandom->Uniform(tmin, tmax);
109
111
113 <<
FIXED(12,5) << line.getX() <<
' '
114 <<
FIXED(12,5) << line.getY() <<
' '
115 <<
FIXED(12,5) << line.getZ() <<
' '
117
118
119
121
122 for (JDetector_t::const_iterator pos =
detector.begin(); pos !=
detector.end(); ++pos) {
123 data.push_back(
JHit_t(*pos, line.getT(*pos)));
124 }
125
128 <<
FIXED(12,5) <<
hit->getX() <<
' '
129 <<
FIXED(12,5) <<
hit->getY() <<
' '
130 <<
FIXED(12,5) <<
hit->getZ() <<
' '
132 }
133
134
135
137
138 result.setZ(line.getZ(), getSpeedOfLight());
139
145
146 hx.Fill(line.getX() -
result.getX());
147 hy.Fill(line.getY() -
result.getY());
148 ht.Fill(line.getT() -
result.getT());
149
150 Qx.put(line.getX() -
result.getX());
151 Qy.put(line.getY() -
result.getY());
152 Qt.put(line.getT() -
result.getT());
153 }
154
155 if (
debug >= debug_t) {
159 }
160
162
164
165 out << hx << hy <<
ht;
166
167 out.Write();
168 out.Close();
169 }
170
171 ASSERT(numberOfEvents > 0);
172
173 ASSERT(fabs(Qx.getMean()) <= precision);
174 ASSERT(fabs(
Qy.getMean()) <= precision);
175 ASSERT(fabs(Qt.getMean()) <= precision);
176
177 ASSERT(Qx.getSTDev() <= precision);
179 ASSERT(Qt.getSTDev() <= precision);
180
181 return 0;
182}
#define DEBUG(A)
Message macros.
#define ASSERT(A,...)
Assert macro.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Data structure for fit of straight line paralel to z-axis.
Data structure for circle in two dimensions.
Data structure for vector in two dimensions.
Data structure for vector in three dimensions.
Template definition of a multi-dimensional oscillation probability interpolation table.
Utility class to parse command line options.
JVector3D getRandomPosition(const JSphere3D &sphere)
Get random position.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for floating point format specification.
Auxiliary class to set-up Hit.