00001 #ifndef Candidate_CandAssociation_h 00002 #define Candidate_CandAssociation_h 00003 // 00004 // \author Luca Lista, INFN 00005 // 00006 #include "DataFormats/Common/interface/AssociationVector.h" 00007 #include "DataFormats/Common/interface/ValueMap.h" 00008 #include "DataFormats/Candidate/interface/Candidate.h" 00009 #include <vector> 00010 00011 namespace edm { 00012 namespace helper { 00013 struct CandMasterKeyReference { 00014 template<typename CandRef> 00015 static const CandRef & get( const CandRef & t, edm::ProductID id ) { 00016 if ( id == t.id() ) return t; 00017 else return t->masterClone().template castTo<CandRef>(); 00018 } 00019 }; 00020 00021 template<> 00022 struct AssociationKeyReferenceTrait<reco::CandidateCollection> { 00023 typedef CandMasterKeyReference type; 00024 }; 00025 } 00026 } 00027 00028 namespace reco { 00029 typedef edm::AssociationVector<CandidateRefProd, std::vector<float> > CandFloatAssociations; 00030 typedef edm::AssociationVector<CandidateRefProd, std::vector<double> > CandDoubleAssociations; 00031 typedef edm::AssociationVector<CandidateRefProd, std::vector<int> > CandIntAssociations; 00032 typedef edm::AssociationVector<CandidateRefProd, std::vector<unsigned int> > CandUIntAssociations; 00033 typedef edm::AssociationVector<CandidateBaseRefProd, std::vector<float> > CandViewFloatAssociations; 00034 typedef edm::AssociationVector<CandidateBaseRefProd, std::vector<double> > CandViewDoubleAssociations; 00035 typedef edm::AssociationVector<CandidateBaseRefProd, std::vector<int> > CandViewIntAssociations; 00036 typedef edm::AssociationVector<CandidateBaseRefProd, std::vector<unsigned int> > CandViewUIntAssociations; 00037 typedef edm::ValueMap<CandidateBaseRef> CandRefValueMap; 00038 } 00039 00040 #endif