File indexing completed on 2024-04-06 12:29:39
0001 #ifndef SimDataFormats_Associations_TrackToGenParticleAssociator_h
0002 #define SimDataFormats_Associations_TrackToGenParticleAssociator_h
0003
0004
0005
0006
0007
0008
0009
0010 #include "DataFormats/Common/interface/Handle.h"
0011 #include "DataFormats/HepMCCandidate/interface/GenParticle.h"
0012 #include "DataFormats/HepMCCandidate/interface/GenParticleFwd.h"
0013 #include "DataFormats/Math/interface/LorentzVector.h"
0014 #include "SimDataFormats/Associations/interface/TrackAssociation.h"
0015 #include "SimDataFormats/Track/interface/SimTrackContainer.h"
0016 #include "SimDataFormats/Vertex/interface/SimVertexContainer.h"
0017
0018 #include "SimDataFormats/Associations/interface/TrackToGenParticleAssociatorBaseImpl.h"
0019
0020 #include <memory>
0021
0022
0023
0024
0025
0026 namespace reco {
0027 typedef edm::AssociationMap<
0028 edm::OneToManyWithQualityGeneric<reco::GenParticleCollection, edm::View<reco::Track>, double>>
0029 GenToRecoCollection;
0030 typedef edm::AssociationMap<
0031 edm::OneToManyWithQualityGeneric<edm::View<reco::Track>, reco::GenParticleCollection, double>>
0032 RecoToGenCollection;
0033
0034 class TrackToGenParticleAssociator {
0035 public:
0036
0037 TrackToGenParticleAssociator() = default;
0038 #ifndef __GCCXML__
0039 TrackToGenParticleAssociator(std::unique_ptr<reco::TrackToGenParticleAssociatorBaseImpl>);
0040 #endif
0041 ~TrackToGenParticleAssociator() = default;
0042 TrackToGenParticleAssociator(TrackToGenParticleAssociator &&) = default;
0043 TrackToGenParticleAssociator &operator=(TrackToGenParticleAssociator &&) = default;
0044 TrackToGenParticleAssociator(const TrackToGenParticleAssociator &) = delete;
0045 const TrackToGenParticleAssociator &operator=(const TrackToGenParticleAssociator &) = delete;
0046
0047
0048 reco::RecoToGenCollection associateRecoToGen(const edm::RefToBaseVector<reco::Track> &tracks,
0049 const edm::RefVector<reco::GenParticleCollection> &gens) const {
0050 return m_impl->associateRecoToGen(tracks, gens);
0051 }
0052
0053 reco::GenToRecoCollection associateGenToReco(const edm::RefToBaseVector<reco::Track> &tracks,
0054 const edm::RefVector<reco::GenParticleCollection> &gens) const {
0055 return m_impl->associateGenToReco(tracks, gens);
0056 }
0057
0058
0059 reco::RecoToGenCollection associateRecoToGen(const edm::Handle<edm::View<reco::Track>> &tCH,
0060 const edm::Handle<reco::GenParticleCollection> &tPCH) const {
0061 return m_impl->associateRecoToGen(tCH, tPCH);
0062 }
0063
0064
0065 reco::GenToRecoCollection associateGenToReco(const edm::Handle<edm::View<reco::Track>> &tCH,
0066 const edm::Handle<reco::GenParticleCollection> &tPCH) const {
0067 return m_impl->associateGenToReco(tCH, tPCH);
0068 }
0069
0070 private:
0071 std::unique_ptr<TrackToGenParticleAssociatorBaseImpl> m_impl;
0072 };
0073 }
0074
0075 #endif