49 map<int, double> id2time;
50 map<int, int > id2idx ;
51 for (
unsigned int idx = 0; idx < vec_in->
size(); idx++) {
52 const SQHit* hit = vec_in->
at(idx);
56 if (id2time.find(ele_id) == id2time.end() || time > id2time[ele_id]) {
57 id2time[ele_id] = time;
58 id2idx [ele_id] = idx;
64 for (map<int, int>::iterator it = id2idx.begin(); it != id2idx.end(); it++) {
std::vector< SQHit * >::const_iterator ConstIter
An SQ interface class to hold one detector hit.
virtual ConstIter end() const
virtual SQHitVector * Clone() const
virtual const SQHit * at(const size_t idkey) const
virtual short get_detector_id() const
Return the detector ID of this hit.
virtual void push_back(const SQHit *hit)
virtual float get_tdc_time() const
Return the TDC time (nsec) of this hit.
An SQ interface class to hold a list of SQHit objects.
static GeomSvc * instance()
singlton instance
virtual size_t size() const
SQHitVector * FindFirstHits(const SQHitVector *vec_in, const std::string det_name)
Extract a set of first hits that are of the given detector (det_name), where "first" means the earlie...
int getDetectorID(const std::string &detectorName) const
Get the plane position.
virtual short get_element_id() const
Return the element ID of this hit.
virtual ConstIter begin() const
SQHitVector * FindHits(const SQHitVector *vec_in, const std::string det_name)
Extract a set of hits that are of the given detector (det_name).