44 JParser<> zap(
"Test program for vertex fit.");
55 catch(
const exception& error) {
56 FATAL(error.what() << endl);
60 TH1D hx(
"hx", NULL, 101, -1.0, +1.0);
61 TH1D hy(
"hy", NULL, 101, -1.0, +1.0);
62 TH1D ht(
"ht", NULL, 101, -1.0, +1.0);
73 if (inputFile !=
"") {
75 ifstream in(inputFile.c_str());
77 for (
double x,
y, z; in >>
x >>
y >> z; ) {
87 for (
int i = 0; i != numberOfPMTs; ++i) {
95 const double xmin = -1.0;
96 const double xmax = +1.0;
98 const double tmin = -1.0;
99 const double tmax = +1.0;
101 for (
int i = 0; i != numberOfEvents; ++i) {
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);
113 <<
FIXED(12,5) << line.getX() <<
' '
114 <<
FIXED(12,5) << line.getY() <<
' '
115 <<
FIXED(12,5) << line.getZ() <<
' '
116 <<
FIXED(12,5) << line.getT() << endl);
122 for (JDetector_t::const_iterator pos =
detector.begin(); pos !=
detector.end(); ++pos) {
123 data.push_back(
JHit_t(*pos, line.getT(*pos)));
128 <<
FIXED(12,5) << hit->getX() <<
' '
129 <<
FIXED(12,5) << hit->getY() <<
' '
130 <<
FIXED(12,5) << hit->getZ() <<
' '
131 <<
FIXED(12,5) << hit->getT() << endl);
146 hx.Fill(line.getX() -
result.getX());
147 hy.Fill(line.getY() -
result.getY());
148 ht.Fill(line.getT() -
result.getT());
150 Qx.put(line.getX() -
result.getX());
151 Qy.put(line.getY() -
result.getY());
152 Qt.put(line.getT() -
result.getT());
165 out << hx << hy << ht;
171 ASSERT(numberOfEvents > 0);
173 ASSERT(fabs(Qx.getMean()) <= precision);
174 ASSERT(fabs(Qy.getMean()) <= precision);
175 ASSERT(fabs(Qt.getMean()) <= precision);
177 ASSERT(Qx.getSTDev() <= precision);
178 ASSERT(Qy.getSTDev() <= precision);
179 ASSERT(Qt.getSTDev() <= precision);
#define DEBUG(A)
Message macros.
#define ASSERT(A,...)
Assert macro.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Linear fit of straight line parallel to z-axis to set of hits (objects with position and time).
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.
Utility class to parse command line options.
JVector3D getRandomPosition(const JSphere3D &sphere)
Get random position.
const double getSpeedOfLight()
Get speed of light.
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.