/** @file event-point.cpp implementation of event point functions */ #include #include #include #include #include "event-point.h" EventPoint::EventPoint(float x, float y, float z, float r, int evtid) : x(x), y(y), z(z), r(r), evtid(evtid) {} EventPoint::EventPoint(const char *s) { // can scan only into doubles double dx, dy, dz, dr; //fprintf(stderr, "%s\n", s); if(sscanf(s, "%lf %lf %lf %lf %d", &dx, &dy, &dz, &dr, &evtid) < 5) { fprintf(stderr, "%s: cannot parse event point string\n", s); exit(-1); } x = float(dx); y = float(dy); z = float(dz); r = float(dr); } // EventPoint __host__ __device__ Track::Track(float x0, float y0, float r, int npoints, int evtid) : x0(x0), y0(y0), r(r), npoints(npoints), evtid(evtid) {} bool equal_eps(const Track &a, const Track &b, float eps) { return abs(a.x0 - b.x0) < eps && abs(abs(a.y0) - abs(b.y0)) < eps && abs(a.r - b.r) < eps; } // equal_eps