CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/SimTracker/TrackAssociation/interface/QuickTrackAssociatorByHits.h

Go to the documentation of this file.
00001 #ifndef QuickTrackAssociatorByHits_h
00002 #define QuickTrackAssociatorByHits_h
00003 
00004 #include "SimTracker/TrackAssociation/interface/TrackAssociatorBase.h"
00005 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00006 
00007 // Forward declarations
00008 class TrackerHitAssociator;
00009 
00049 class QuickTrackAssociatorByHits : public TrackAssociatorBase
00050 {
00051 public:
00052         QuickTrackAssociatorByHits( const edm::ParameterSet& config );
00053         ~QuickTrackAssociatorByHits();
00054         QuickTrackAssociatorByHits( const QuickTrackAssociatorByHits& otherAssociator );
00055         QuickTrackAssociatorByHits& operator=( const QuickTrackAssociatorByHits& otherAssociator );
00056         reco::RecoToSimCollection associateRecoToSim( edm::Handle<edm::View<reco::Track> >& trackCollectionHandle,
00057                                                       edm::Handle<TrackingParticleCollection>& trackingParticleCollectionHandle,
00058                                                       const edm::Event* pEvent=0,
00059                                                       const edm::EventSetup* pSetup=0 ) const;
00060         reco::SimToRecoCollection associateSimToReco( edm::Handle<edm::View<reco::Track> >& trackCollectionHandle,
00061                                                       edm::Handle<TrackingParticleCollection>& trackingParticleCollectionHandle,
00062                                                       const edm::Event* pEvent=0,
00063                                                       const edm::EventSetup* pSetup=0 ) const;
00064         reco::RecoToSimCollection associateRecoToSim( const edm::RefToBaseVector<reco::Track>& trackCollection,
00065                                                                                                   const edm::RefVector<TrackingParticleCollection>& trackingParticleCollection,
00066                                                                                                   const edm::Event* pEvent=0,
00067                                                                                                   const edm::EventSetup* pSetup=0 ) const;
00068         reco::SimToRecoCollection associateSimToReco( const edm::RefToBaseVector<reco::Track>& trackCollection,
00069                                                                                                   const edm::RefVector<TrackingParticleCollection>& trackingParticleCollection,
00070                                                                                                   const edm::Event* pEvent=0,
00071                                                                                                   const edm::EventSetup* pSetup=0 ) const;
00072 private:
00073         typedef std::pair<uint32_t,EncodedEventId> SimTrackIdentifiers;
00074         enum SimToRecoDenomType {denomnone,denomsim,denomreco};
00075 
00078         reco::RecoToSimCollection associateRecoToSimImplementation() const;
00079 
00082         reco::SimToRecoCollection associateSimToRecoImplementation() const;
00083 
00089         std::vector< std::pair<edm::Ref<TrackingParticleCollection>,size_t> > associateTrack( const reco::Track* pTrack ) const;
00090 
00092         bool trackingParticleContainsIdentifier( const TrackingParticle* pTrackingParticle, const SimTrackIdentifiers& identifier ) const;
00093 
00095         int getDoubleCount( trackingRecHit_iterator begin, trackingRecHit_iterator end, const TrackingParticle& associatedTrackingParticle ) const;
00096 
00103         std::vector< std::pair<SimTrackIdentifiers,size_t> > getAllSimTrackIdentifiers( const reco::Track* pTrack ) const;
00104 
00105         //
00106         // Members. Note that there are custom copy constructor and assignment operators, so if any members are added
00107         // those methods will need to be updated.
00108         //
00109         mutable TrackerHitAssociator* pHitAssociator_;
00110         const mutable edm::Event* pEventForWhichAssociatorIsValid_;
00111         void initialiseHitAssociator( const edm::Event* event ) const;
00112 
00113         edm::ParameterSet hitAssociatorParameters_;
00114 
00115         bool absoluteNumberOfHits_;
00116         double qualitySimToReco_;
00117         double puritySimToReco_;
00118         double cutRecoToSim_;
00119         bool threeHitTracksAreSpecial_;
00120         SimToRecoDenomType simToRecoDenominator_;
00121 
00130         mutable edm::Handle<edm::View<reco::Track> >* pTrackCollectionHandle_;
00131 
00137         mutable const edm::RefToBaseVector<reco::Track>* pTrackCollection_;
00138 
00144         mutable edm::Handle<TrackingParticleCollection>* pTrackingParticleCollectionHandle_;
00145 
00151         mutable const edm::RefVector<TrackingParticleCollection>* pTrackingParticleCollection_;
00152 }; // end of the QuickTrackAssociatorByHits class
00153 
00154 #endif // end of ifndef QuickTrackAssociatorByHits_h