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; ) {
85 const JCylinder3D cylinder(JCircle2D(JVector2D(0.0, 0.0), 100.0), -50.0, +50.0);
87 for (
int i = 0;
i != numberOfPMTs; ++
i) {
93 typedef JVertex3D JHit_t;
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);
110 JLine1Z line(JVector3D(x,y,z), t);
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);
136 JEstimator<JLine1Z>
result(data.begin(), data.end());
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);
Utility class to parse command line options.
Auxiliary data structure for floating point format specification.
#define ASSERT(A,...)
Assert macro.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
JVector3D getRandomPosition(const JSphere3D &sphere)
Get random position.
const double getSpeedOfLight()
Get speed of light.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
do set_variable DETECTOR_TXT $WORKDIR detector
#define DEBUG(A)
Message macros.