00001 #ifndef UtilAlgos_SelectedOutputCollectionTrait_h 00002 #define UtilAlgos_SelectedOutputCollectionTrait_h 00003 /* \class helper SelectedOutputCollection 00004 * 00005 * \author Luca Lista, INFN 00006 * 00007 */ 00008 #include "DataFormats/Common/interface/AssociationVector.h" 00009 #include "DataFormats/Common/interface/RefToBase.h" 00010 #include "DataFormats/Common/interface/RefToBaseVector.h" 00011 #include "DataFormats/Common/interface/RefToBaseProd.h" 00012 #include "DataFormats/Common/interface/RefVector.h" 00013 #include "DataFormats/Common/interface/View.h" 00014 00015 namespace helper { 00016 00017 template<typename InputCollection> 00018 struct SelectedOutputCollectionTrait { 00019 typedef InputCollection type; 00020 }; 00021 00022 template<typename K, typename C> 00023 struct SelectedOutputCollectionTrait<edm::AssociationVector<edm::RefProd<K>, C> > { 00024 typedef typename edm::RefProd<K>::product_type type; 00025 }; 00026 00027 template<typename T, typename C> 00028 struct SelectedOutputCollectionTrait<edm::AssociationVector<edm::RefToBaseProd<T>, C> > { 00029 typedef typename edm::RefToBaseVector<T> type; 00030 }; 00031 00032 template<typename T> 00033 struct SelectedOutputCollectionTrait<edm::View<T> > { 00034 typedef typename edm::RefToBaseVector<T> type; 00035 }; 00036 00037 template<typename T> 00038 struct SelectedOutputCollectionTrait<edm::RefToBaseVector<T> > { 00039 typedef typename edm::RefToBaseVector<T> type; 00040 }; 00041 00042 template<typename C> 00043 struct SelectedOutputCollectionTrait<edm::RefVector<C> > { 00044 typedef typename edm::RefVector<C> type; 00045 }; 00046 00047 } 00048 00049 #endif