CMS 3D CMS Logo

CMSSW_4_4_3_patch1/src/SimTracker/TrackAssociation/interface/TrackAssociatorByHits.h

Go to the documentation of this file.
00001 #ifndef TrackAssociatorByHits_h
00002 #define TrackAssociatorByHits_h
00003 
00004 #include "FWCore/Framework/interface/Frameworkfwd.h"
00005 #include "FWCore/Framework/interface/Event.h"
00006 #include "FWCore/Framework/interface/EventSetup.h"
00007 #include "FWCore/Framework/interface/ESHandle.h"
00008 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00009 #include "DataFormats/Common/interface/Ref.h"
00010 #include "SimTracker/TrackerHitAssociation/interface/TrackerHitAssociator.h"
00011 
00012 //reco track
00013 #include "DataFormats/TrackReco/interface/TrackFwd.h"
00014 #include "DataFormats/TrackReco/interface/Track.h"
00015 #include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h"
00016 //TrackingParticle
00017 #include "SimDataFormats/TrackingAnalysis/interface/TrackingParticle.h"
00018 #include "SimDataFormats/EncodedEventId/interface/EncodedEventId.h"
00019 #include "SimTracker/TrackAssociation/interface/TrackAssociatorBase.h"
00020 
00021 class TrackAssociatorByHits : public TrackAssociatorBase {
00022   
00023  public:
00024 
00025   enum SimToRecoDenomType {denomnone,denomsim,denomreco};
00026 
00027   explicit TrackAssociatorByHits( const edm::ParameterSet& );  
00028   ~TrackAssociatorByHits();
00029   
00030   /* Associate SimTracks to RecoTracks By Hits */
00031  
00033   reco::RecoToSimCollection associateRecoToSim(const edm::RefToBaseVector<reco::Track>&,
00034                                                const edm::RefVector<TrackingParticleCollection>&,
00035                                                const edm::Event * event = 0,
00036                                                const edm::EventSetup * setup = 0 ) const ;
00038   reco::SimToRecoCollection associateSimToReco(const edm::RefToBaseVector<reco::Track>&,
00039                                                const edm::RefVector<TrackingParticleCollection>&,
00040                                                const edm::Event * event = 0,
00041                                                const edm::EventSetup * setup = 0 ) const ;
00042   
00044   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     return TrackAssociatorBase::associateRecoToSim(tCH,tPCH,event,setup);
00049   }
00050   
00052   reco::SimToRecoCollection associateSimToReco(edm::Handle<edm::View<reco::Track> >& tCH, 
00053                                                edm::Handle<TrackingParticleCollection>& tPCH,
00054                                                const edm::Event * event = 0,
00055                                                const edm::EventSetup * setup = 0) const {
00056     return TrackAssociatorBase::associateSimToReco(tCH,tPCH,event,setup);
00057   }  
00058 
00059   //seed
00060   reco::RecoToSimCollectionSeed associateRecoToSim(edm::Handle<edm::View<TrajectorySeed> >&, 
00061                                                    edm::Handle<TrackingParticleCollection>&, 
00062                                                    const edm::Event * event = 0,
00063                                                    const edm::EventSetup * setup = 0) const;
00064   
00065   reco::SimToRecoCollectionSeed associateSimToReco(edm::Handle<edm::View<TrajectorySeed> >&, 
00066                                                    edm::Handle<TrackingParticleCollection>&, 
00067                                                    const edm::Event * event = 0,
00068                                                    const edm::EventSetup * setup = 0) const;
00069   template<typename iter>
00070   void getMatchedIds(std::vector<SimHitIdpr>&, 
00071                      std::vector<SimHitIdpr>&, 
00072                      int&, 
00073                      iter,
00074                      iter,
00075                      TrackerHitAssociator*) const;
00076   
00077   int getShared(std::vector<SimHitIdpr>&, 
00078                 std::vector<SimHitIdpr>&,
00079                 TrackingParticleCollection::const_iterator) const;
00080 
00081   template<typename iter>
00082   int getDoubleCount(iter,iter,TrackerHitAssociator*,TrackingParticleCollection::const_iterator) const;
00083 
00084  private:
00085   // ----- member data
00086   const edm::ParameterSet& conf_;
00087   const bool AbsoluteNumberOfHits;
00088   SimToRecoDenomType SimToRecoDenominator;
00089   const double quality_SimToReco;
00090   const double purity_SimToReco;
00091   const double cut_RecoToSim;
00092   const bool UsePixels;
00093   const bool UseGrouped;
00094   const bool UseSplitting;
00095   const bool ThreeHitTracksAreSpecial;
00096   int LayerFromDetid(const DetId&) const;
00097 
00098   const TrackingRecHit* getHitPtr(edm::OwnVector<TrackingRecHit>::const_iterator iter) const {return &*iter;}
00099   const TrackingRecHit* getHitPtr(trackingRecHit_iterator iter) const {return &**iter;}
00100 };
00101 
00102 #endif