00001 #ifndef TrackAssociatorBase_h
00002 #define TrackAssociatorBase_h
00003
00012 #include "DataFormats/Common/interface/Handle.h"
00013 #include "FWCore/Framework/interface/Event.h"
00014 #include "DataFormats/RecoCandidate/interface/TrackAssociation.h"
00015
00016 #include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h"
00017 #include "DataFormats/TrackCandidate/interface/TrackCandidateCollection.h"
00018
00019 namespace reco{
00020 typedef edm::AssociationMap<edm::OneToManyWithQualityGeneric
00021 <TrackingParticleCollection, edm::View<TrajectorySeed>, double> >
00022 SimToRecoCollectionSeed;
00023 typedef edm::AssociationMap<edm::OneToManyWithQualityGeneric
00024 <edm::View<TrajectorySeed>, TrackingParticleCollection, double> >
00025 RecoToSimCollectionSeed;
00026
00027 typedef edm::AssociationMap<edm::OneToManyWithQualityGeneric
00028 <TrackingParticleCollection, TrackCandidateCollection, double> >
00029 SimToRecoCollectionTCandidate;
00030 typedef edm::AssociationMap<edm::OneToManyWithQualityGeneric
00031 <TrajectorySeedCollection, TrackCandidateCollection, double> >
00032 RecoToSimCollectionTCandidate;
00033 }
00034
00035 class TrackAssociatorBase {
00036 public:
00038 TrackAssociatorBase() {;}
00040 virtual ~TrackAssociatorBase() {;}
00041
00042
00044 virtual reco::RecoToSimCollection associateRecoToSim(edm::Handle<edm::View<reco::Track> >& tCH,
00045 edm::Handle<TrackingParticleCollection>& tPCH,
00046 const edm::Event * event = 0) const {
00047 edm::RefToBaseVector<reco::Track> tc(tCH);
00048 for (unsigned int j=0; j<tCH->size();j++)
00049 tc.push_back(edm::RefToBase<reco::Track>(tCH,j));
00050
00051 edm::RefVector<TrackingParticleCollection> tpc(tPCH.id());
00052 for (unsigned int j=0; j<tPCH->size();j++)
00053 tpc.push_back(edm::Ref<TrackingParticleCollection>(tPCH,j));
00054
00055 return associateRecoToSim(tc,tpc,event);
00056 }
00057
00059 virtual reco::SimToRecoCollection associateSimToReco(edm::Handle<edm::View<reco::Track> >& tCH,
00060 edm::Handle<TrackingParticleCollection>& tPCH,
00061 const edm::Event * event = 0) const {
00062 edm::RefToBaseVector<reco::Track> tc(tCH);
00063 for (unsigned int j=0; j<tCH->size();j++)
00064 tc.push_back(edm::RefToBase<reco::Track>(tCH,j));
00065
00066 edm::RefVector<TrackingParticleCollection> tpc(tPCH.id());
00067 for (unsigned int j=0; j<tPCH->size();j++)
00068 tpc.push_back(edm::Ref<TrackingParticleCollection>(tPCH,j));
00069
00070 return associateSimToReco(tc,tpc,event);
00071 }
00072
00074 virtual reco::RecoToSimCollection associateRecoToSim(edm::RefToBaseVector<reco::Track> & tc,
00075 edm::RefVector<TrackingParticleCollection>& tpc,
00076 const edm::Event * event = 0 ) const = 0 ;
00078 virtual reco::SimToRecoCollection associateSimToReco(edm::RefToBaseVector<reco::Track> & tc,
00079 edm::RefVector<TrackingParticleCollection>& tpc ,
00080 const edm::Event * event = 0 ) const = 0 ;
00081
00082
00083 virtual reco::RecoToSimCollectionSeed associateRecoToSim(edm::Handle<edm::View<TrajectorySeed> >&,
00084 edm::Handle<TrackingParticleCollection>&,
00085 const edm::Event * event = 0) const {
00086 reco::RecoToSimCollectionSeed empty;
00087 return empty;
00088 }
00089
00090 virtual reco::SimToRecoCollectionSeed associateSimToReco(edm::Handle<edm::View<TrajectorySeed> >&,
00091 edm::Handle<TrackingParticleCollection>&,
00092 const edm::Event * event = 0) const {
00093 reco::SimToRecoCollectionSeed empty;
00094 return empty;
00095 }
00096
00097
00098 virtual reco::RecoToSimCollectionTCandidate associateRecoToSim(edm::Handle<TrackCandidateCollection>&,
00099 edm::Handle<TrackingParticleCollection>&,
00100 const edm::Event * event = 0) const {
00101 reco::RecoToSimCollectionTCandidate empty;
00102 return empty;
00103 }
00104
00105 virtual reco::SimToRecoCollectionTCandidate associateSimToReco(edm::Handle<TrackCandidateCollection>&,
00106 edm::Handle<TrackingParticleCollection>&,
00107 const edm::Event * event = 0) const {
00108 reco::SimToRecoCollectionTCandidate empty;
00109 return empty;
00110 }
00111
00112 };
00113
00114
00115 #endif