30int main(
int argc,
char **argv)
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) {
88 detector.push_back(getRandomPosition(cylinder));
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);
122 for (JDetector_t::const_iterator pos =
detector.begin(); pos !=
detector.end(); ++pos) {
123 data.push_back(
JHit_t(*pos, line.
getT(*pos)));
126 for (vector<JHit_t>::const_iterator hit = data.begin(); hit != data.end(); ++hit) {
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);
138 result.setZ(line.
getZ(), getSpeedOfLight());
141 <<
FIXED(12,5) << result.getX() <<
' '
142 <<
FIXED(12,5) << result.getY() <<
' '
143 <<
FIXED(12,5) << result.getZ() <<
' '
144 <<
FIXED(12,5) << result.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());
155 if (
debug >= debug_t) {
165 out << hx << hy << ht;
171 ASSERT(numberOfEvents > 0);