#ifndef EVENT_POINT_H_ #define EVENT_POINT_H_ /** @file event-point.h event point structure header */ /** a single event point structure */ struct EventPoint { /** creates a new event point */ EventPoint(float x, float y, float z, float r, int evtId); /** parses an event point from a null-terminated string */ EventPoint(const char *str); /** real point coordinates */ float x, y; /** z coordinate; can be used to store some other information */ float z; /** the radius associated with the track */ float r; /** the event id */ int evtid; }; /** a single track structure; can be a track created from the input event, or a reconstructed track */ struct Track { /** creates a new track with specific parameters */ #ifdef __CUDACC__ __host__ __device__ #endif Track(float x0, float y0, float r, int npoints, int evtid); /** track center coordinates */ float x0, y0; /** track radius */ float r; /** number of points on the track */ int npoints; /** event id of the track */ int evtid; }; // struct Track /** */ /** comparing tracks for equality */ inline bool operator==(const Track &a, const Track &b) { return a.x0 == b.x0 && a.y0 == b.y0 && a.r == b.r && a.npoints == b.npoints && a.evtid == b.evtid; } /** comparing tracks for inequality */ inline bool operator!=(const Track &a, const Track &b) { return a.x0 != b.x0 || a.y0 != b.y0 || a.r != b.r || a.npoints != b.npoints || a.evtid != b.evtid; } /** less track comparison (for maps only); excludes event id and number of points comparison */ inline bool operator<(const Track &a, const Track &b) { if(a.x0 != b.x0) return a.x0 < b.x0; else if(a.y0 != b.y0) return a.y0 < b.y0; else return a.r < b.r; } // operator < /** compares two tracks with eps precision @remarks for y, only absolute values are compared, as the sign cannot be reconstructed from the input */ bool equal_eps(const Track &a, const Track &b, float eps); #endif