CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_1/src/SimTracker/TrackAssociation/interface/TrackAssociatorBase.h

Go to the documentation of this file.
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,
00047                                                        const edm::EventSetup * setup = 0) const {
00048     edm::RefToBaseVector<reco::Track> tc(tCH);
00049     for (unsigned int j=0; j<tCH->size();j++)
00050       tc.push_back(edm::RefToBase<reco::Track>(tCH,j));
00051 
00052     edm::RefVector<TrackingParticleCollection> tpc(tPCH.id());
00053     for (unsigned int j=0; j<tPCH->size();j++)
00054       tpc.push_back(edm::Ref<TrackingParticleCollection>(tPCH,j));
00055 
00056     return associateRecoToSim(tc,tpc,event,setup);
00057   }
00058   
00060   virtual reco::SimToRecoCollection associateSimToReco(edm::Handle<edm::View<reco::Track> >& tCH, 
00061                                                        edm::Handle<TrackingParticleCollection>& tPCH,
00062                                                        const edm::Event * event = 0,
00063                                                        const edm::EventSetup * setup = 0) const {
00064     edm::RefToBaseVector<reco::Track> tc(tCH);
00065     for (unsigned int j=0; j<tCH->size();j++)
00066       tc.push_back(edm::RefToBase<reco::Track>(tCH,j));
00067 
00068     edm::RefVector<TrackingParticleCollection> tpc(tPCH.id());
00069     for (unsigned int j=0; j<tPCH->size();j++)
00070       tpc.push_back(edm::Ref<TrackingParticleCollection>(tPCH,j));
00071 
00072     return associateSimToReco(tc,tpc,event,setup);
00073   }  
00074   
00076   virtual  reco::RecoToSimCollection associateRecoToSim(const edm::RefToBaseVector<reco::Track> & tc,
00077                                                         const edm::RefVector<TrackingParticleCollection>& tpc,
00078                                                         const edm::Event * event = 0,
00079                                                         const edm::EventSetup * setup = 0 ) const = 0 ;
00081   virtual  reco::SimToRecoCollection associateSimToReco(const edm::RefToBaseVector<reco::Track> & tc,
00082                                                         const edm::RefVector<TrackingParticleCollection>& tpc ,
00083                                                         const edm::Event * event = 0,
00084                                                         const edm::EventSetup * setup = 0 ) const = 0 ; 
00085 
00086   //TrajectorySeed
00087   virtual reco::RecoToSimCollectionSeed associateRecoToSim(const edm::Handle<edm::View<TrajectorySeed> >&, 
00088                                                            const edm::Handle<TrackingParticleCollection>&, 
00089                                                            const edm::Event * event = 0,
00090                                                            const edm::EventSetup * setup = 0) const {
00091     reco::RecoToSimCollectionSeed empty;
00092     return empty;
00093   }
00094   
00095   virtual reco::SimToRecoCollectionSeed associateSimToReco(const edm::Handle<edm::View<TrajectorySeed> >&, 
00096                                                            const edm::Handle<TrackingParticleCollection>&, 
00097                                                            const edm::Event * event = 0,
00098                                                            const edm::EventSetup * setup = 0) const {
00099     reco::SimToRecoCollectionSeed empty;
00100     return empty;
00101   }
00102 
00103   //TrackCandidate
00104   virtual reco::RecoToSimCollectionTCandidate associateRecoToSim(const edm::Handle<TrackCandidateCollection>&, 
00105                                                                  const edm::Handle<TrackingParticleCollection>&, 
00106                                                                  const edm::Event * event = 0,
00107                                                                  const edm::EventSetup * setup = 0) const {
00108     reco::RecoToSimCollectionTCandidate empty;
00109     return empty;
00110   }
00111   
00112   virtual reco::SimToRecoCollectionTCandidate associateSimToReco(const edm::Handle<TrackCandidateCollection>&, 
00113                                                                  const edm::Handle<TrackingParticleCollection>&, 
00114                                                                  const edm::Event * event = 0,
00115                                                                  const edm::EventSetup * setup = 0) const {
00116     reco::SimToRecoCollectionTCandidate empty;
00117     return empty;
00118   }
00119 
00120 };
00121 
00122 
00123 #endif