File indexing completed on 2024-04-06 12:01:09
0001 #ifndef RecoAlgos_TrackToRefCandidate_h
0002 #define RecoAlgos_TrackToRefCandidate_h
0003 #include "CommonTools/RecoAlgos/interface/MassiveCandidateConverter.h"
0004 #include "CommonTools/RecoAlgos/interface/CandidateProducer.h"
0005 #include "DataFormats/TrackReco/interface/Track.h"
0006 #include "DataFormats/RecoCandidate/interface/RecoChargedRefCandidate.h"
0007 #include "DataFormats/RecoCandidate/interface/RecoChargedRefCandidateFwd.h"
0008 #include "DataFormats/Candidate/interface/CandidateFwd.h"
0009
0010 namespace converter {
0011
0012 struct TrackToRefCandidate : public MassiveCandidateConverter {
0013 typedef reco::Track value_type;
0014 typedef reco::TrackCollection Components;
0015 typedef reco::RecoChargedRefCandidate Candidate;
0016 TrackToRefCandidate(const edm::ParameterSet& cfg, edm::ConsumesCollector iC) : MassiveCandidateConverter(cfg, iC) {}
0017 void convert(reco::TrackRef trkRef, reco::RecoChargedRefCandidate& c) const {
0018 c = reco::RecoChargedRefCandidate(trkRef, sqrt(massSqr_));
0019 }
0020 };
0021
0022 namespace helper {
0023 template <>
0024 struct CandConverter<reco::Track> {
0025 typedef TrackToRefCandidate type;
0026 };
0027 }
0028
0029 }
0030
0031 #endif