Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:29:39

0001 #ifndef SimDataFormats_Associations_TrackToGenParticleAssociatorBaseImpl_h
0002 #define SimDataFormats_Associations_TrackToGenParticleAssociatorBaseImpl_h
0003 
0004 /** \class TrackToGenParticleAssociatorBaseImpl
0005  *  Base class for implementations of a Track to GenParticle associator
0006  *
0007  *  \author cerati, magni
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 namespace reco {
0021   typedef edm::AssociationMap<
0022       edm::OneToManyWithQualityGeneric<reco::GenParticleCollection, edm::View<reco::Track>, double>>
0023       GenToRecoCollection;
0024   typedef edm::AssociationMap<
0025       edm::OneToManyWithQualityGeneric<edm::View<reco::Track>, reco::GenParticleCollection, double>>
0026       RecoToGenCollection;
0027 
0028   class TrackToGenParticleAssociatorBaseImpl {
0029   public:
0030     /// Constructor
0031     TrackToGenParticleAssociatorBaseImpl();
0032     TrackToGenParticleAssociatorBaseImpl(const TrackToGenParticleAssociatorBaseImpl &) = delete;  // stop default
0033     const TrackToGenParticleAssociatorBaseImpl &operator=(const TrackToGenParticleAssociatorBaseImpl &) =
0034         delete;  // stop default
0035     virtual ~TrackToGenParticleAssociatorBaseImpl();
0036 
0037     /// Association Sim To Reco with Collections (Gen Particle version)
0038     virtual reco::RecoToGenCollection associateRecoToGen(
0039         const edm::RefToBaseVector<reco::Track> &tracks,
0040         const edm::RefVector<reco::GenParticleCollection> &gens) const = 0;
0041 
0042     /// Association Sim To Reco with Collections (Gen Particle version)
0043     virtual reco::GenToRecoCollection associateGenToReco(
0044         const edm::RefToBaseVector<reco::Track> &tracks,
0045         const edm::RefVector<reco::GenParticleCollection> &gens) const = 0;
0046 
0047     /// compare reco to sim the handle of reco::Track and GenParticle collections
0048     virtual reco::RecoToGenCollection associateRecoToGen(
0049         const edm::Handle<edm::View<reco::Track>> &tCH, const edm::Handle<reco::GenParticleCollection> &tPCH) const = 0;
0050 
0051     /// compare reco to sim the handle of reco::Track and GenParticle collections
0052     virtual reco::GenToRecoCollection associateGenToReco(
0053         const edm::Handle<edm::View<reco::Track>> &tCH, const edm::Handle<reco::GenParticleCollection> &tPCH) const = 0;
0054   };
0055 }  // namespace reco
0056 
0057 #endif