Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:01:03

0001 #ifndef CommonTools_CandUtils_CandMapTrait_h
0002 #define CommonTools_CandUtils_CandMapTrait_h
0003 
0004 #include "DataFormats/Common/interface/AssociationMap.h"
0005 #include "DataFormats/Candidate/interface/CandidateFwd.h"
0006 
0007 /* \class reco::helper::CandMapTrait<T>
0008  *
0009  * \author Luca Lista, INFN 
0010  *
0011  * \version $Id: CandMapTrait.h,v 1.2 2007/10/20 16:00:52 llista Exp $
0012  *
0013  */
0014 namespace reco {
0015   namespace helper {
0016     template <typename C1, typename C2 = C1>
0017     struct CandMapTrait {
0018       typedef edm::AssociationMap<edm::OneToOne<C1, C2> > type;
0019     };
0020 
0021     template <typename C1>
0022     struct CandMapTrait<C1, CandidateView> {
0023       typedef edm::AssociationMap<edm::OneToOneGeneric<C1, CandidateView> > type;
0024     };
0025 
0026     template <typename C2>
0027     struct CandMapTrait<CandidateView, C2> {
0028       typedef edm::AssociationMap<edm::OneToOneGeneric<CandidateView, C2> > type;
0029     };
0030 
0031     template <>
0032     struct CandMapTrait<CandidateView, CandidateView> {
0033       typedef edm::AssociationMap<edm::OneToOneGeneric<CandidateView, CandidateView> > type;
0034     };
0035 
0036     template <typename C>
0037     struct CandRefTrait {
0038       typedef edm::Ref<C> ref_type;
0039       typedef edm::RefProd<C> refProd_type;
0040     };
0041 
0042     template <typename T>
0043     struct CandRefTrait<edm::View<T> > {
0044       typedef edm::RefToBase<T> ref_type;
0045       typedef edm::RefToBaseProd<T> refProd_type;
0046     };
0047   }  // namespace helper
0048 }  // namespace reco
0049 
0050 #endif