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