CMS 3D CMS Logo

Functions

CMSSW_4_4_3_patch1/src/TrackingTools/RoadSearchHitAccess/src/DetHitAccess.cc File Reference

#include "TrackingTools/RoadSearchHitAccess/interface/DetHitAccess.h"

Go to the source code of this file.

Functions

template<typename T >
edmNew::DetSet< TdetSetOrEmpty (const edmNew::DetSetVector< T > &dsv, DetId detid)
 I need this because DetHitAccess assumes that it can search a hit container using a detid which is not there.

Function Documentation

template<typename T >
edmNew::DetSet<T> detSetOrEmpty ( const edmNew::DetSetVector< T > &  dsv,
DetId  detid 
) [inline]

I need this because DetHitAccess assumes that it can search a hit container using a detid which is not there.

Definition at line 5 of file DetHitAccess.cc.

References edmNew::DetSetVector< T >::end(), edmNew::DetSetVector< T >::find(), and DetId::rawId().

Referenced by DetHitAccess::getHitVector().

                                                                                    {
    typename edmNew::DetSetVector<T>::const_iterator iter = dsv.find(detid.rawId());
    if (iter == dsv.end()) {
        return typename edmNew::DetSet<T>(detid.rawId(), static_cast<const T *>(0), size_t(0) );
    } else {
        return *iter;
    }
}