CMS 3D CMS Logo

QuickTrackAssociatorByHitsImpl.h
Go to the documentation of this file.
1 #ifndef QuickTrackAssociatorByHitsImpl_h
2 #define QuickTrackAssociatorByHitsImpl_h
3 
5 
7 
9 
11 
12 // Forward declarations
14 
15 namespace edm {
16  class EDProductGetter;
17 }
18 
67 public:
69 
71  std::unique_ptr<const TrackerHitAssociator> hitAssoc,
72  const ClusterTPAssociation* clusterToTPMap,
73  bool absoluteNumberOfHits,
74  double qualitySimToReco,
75  double puritySimToReco,
76  double cutRecoToSim,
77  double pixelHitWeight,
78  bool threeHitTracksAreSpecial,
79  SimToRecoDenomType simToRecoDenominator);
80 
82  const edm::Handle<edm::View<reco::Track> >& trackCollectionHandle,
83  const edm::Handle<TrackingParticleCollection>& trackingParticleCollectionHandle) const override;
85  const edm::Handle<edm::View<reco::Track> >& trackCollectionHandle,
86  const edm::Handle<TrackingParticleCollection>& trackingParticleCollectionHandle) const override;
90 
94 
95  //seed
97  const edm::Handle<TrackingParticleCollection>&) const override;
98 
100  const edm::Handle<TrackingParticleCollection>&) const override;
101 
102 private:
103  typedef std::pair<uint32_t, EncodedEventId>
105 
107 
108  // - added by S. Sarkar
110  std::pair<edm::Ref<TrackingParticleCollection>, size_t> j) {
111  return (i.first.key() > j.first.key());
112  }
113 
120  template <class T_TrackCollection, class T_TrackingParticleCollection, class T_hitOrClusterAssociator>
122  const T_TrackCollection& trackCollection,
123  const T_TrackingParticleCollection& trackingParticleCollection,
124  const TrackingParticleRefKeySet* trackingParticleKeys,
125  T_hitOrClusterAssociator hitOrClusterAssociator) const;
126 
133  template <class T_TrackCollection, class T_TrackingParticleCollection, class T_hitOrClusterAssociator>
135  const T_TrackCollection& trackCollection,
136  const T_TrackingParticleCollection& trackingParticleCollection,
137  const TrackingParticleRefKeySet* trackingParticleKeys,
138  T_hitOrClusterAssociator hitOrClusterAssociator) const;
139 
145  template <typename T_TPCollection, typename iter>
146  std::vector<std::pair<edm::Ref<TrackingParticleCollection>, double> > associateTrack(
148  const T_TPCollection& trackingParticles,
149  const TrackingParticleRefKeySet* trackingParticleKeys,
150  iter begin,
151  iter end) const;
159  template <typename T_TPCollection, typename iter>
160  std::vector<std::pair<edm::Ref<TrackingParticleCollection>, double> > associateTrack(
161  const ClusterTPAssociation& clusterToTPMap,
162  const T_TPCollection& trackingParticles,
163  const TrackingParticleRefKeySet* trackingParticleKeys,
164  iter begin,
165  iter end) const;
166 
168  bool trackingParticleContainsIdentifier(const TrackingParticle* pTrackingParticle,
169  const SimTrackIdentifiers& identifier) const;
170 
175  template <typename iter>
177  iter begin,
178  iter end,
179  TrackingParticleRef associatedTrackingParticle) const;
182  template <typename iter>
183  double getDoubleCount(const ClusterTPAssociation& clusterToTPList,
184  iter begin,
185  iter end,
186  TrackingParticleRef associatedTrackingParticle) const;
187 
194  template <typename iter>
195  std::vector<std::pair<SimTrackIdentifiers, double> > getAllSimTrackIdentifiers(
196  const TrackerHitAssociator& hitAssociator, iter begin, iter end) const;
197 
198  // The last parameter is used to decide whether we cound hits or clusters
203 
204  // called only by weightedNumberOfTrackClusters(..., ClusterTPAssociation)
205  template <typename iter>
206  double weightedNumberOfTrackClusters(iter begin, iter end) const;
207 
221  //void prepareEitherHitAssociatorOrClusterToTPMap( const edm::Event* pEvent, std::unique_ptr<ClusterTPAssociation>& pClusterToTPMap, std::unique_ptr<TrackerHitAssociator>& pHitAssociator ) const;
222 
224  std::unique_ptr<const TrackerHitAssociator> hitAssociator_;
226 
234 
235  // Added by S. Sarkar
236  //bool useClusterTPAssociation_;
237 }; // end of the QuickTrackAssociatorByHitsImpl class
238 
239 #endif // end of ifndef QuickTrackAssociatorByHitsImpl_h
QuickTrackAssociatorByHitsImpl::tpIntPairGreater
static bool tpIntPairGreater(std::pair< edm::Ref< TrackingParticleCollection >, size_t > i, std::pair< edm::Ref< TrackingParticleCollection >, size_t > j)
Definition: QuickTrackAssociatorByHitsImpl.h:109
QuickTrackAssociatorByHitsImpl::associateRecoToSimImplementation
reco::RecoToSimCollection associateRecoToSimImplementation(const T_TrackCollection &trackCollection, const T_TrackingParticleCollection &trackingParticleCollection, const TrackingParticleRefKeySet *trackingParticleKeys, T_hitOrClusterAssociator hitOrClusterAssociator) const
The method that does the work for both overloads of associateRecoToSim.
Definition: QuickTrackAssociatorByHitsImpl.cc:166
QuickTrackAssociatorByHitsImpl::absoluteNumberOfHits_
bool absoluteNumberOfHits_
Definition: QuickTrackAssociatorByHitsImpl.h:233
mps_fire.i
i
Definition: mps_fire.py:355
QuickTrackAssociatorByHitsImpl::associateRecoToSim
reco::RecoToSimCollection associateRecoToSim(const edm::Handle< edm::View< reco::Track > > &trackCollectionHandle, const edm::Handle< TrackingParticleCollection > &trackingParticleCollectionHandle) const override
Definition: QuickTrackAssociatorByHitsImpl.cc:115
QuickTrackAssociatorByHitsImpl::associateSimToRecoImplementation
reco::SimToRecoCollection associateSimToRecoImplementation(const T_TrackCollection &trackCollection, const T_TrackingParticleCollection &trackingParticleCollection, const TrackingParticleRefKeySet *trackingParticleKeys, T_hitOrClusterAssociator hitOrClusterAssociator) const
The method that does the work for both overloads of associateSimToReco.
Definition: QuickTrackAssociatorByHitsImpl.cc:228
QuickTrackAssociatorByHitsImpl::QuickTrackAssociatorByHitsImpl
QuickTrackAssociatorByHitsImpl(edm::EDProductGetter const &productGetter, std::unique_ptr< const TrackerHitAssociator > hitAssoc, const ClusterTPAssociation *clusterToTPMap, bool absoluteNumberOfHits, double qualitySimToReco, double puritySimToReco, double cutRecoToSim, double pixelHitWeight, bool threeHitTracksAreSpecial, SimToRecoDenomType simToRecoDenominator)
Definition: QuickTrackAssociatorByHitsImpl.cc:93
QuickTrackAssociatorByHitsImpl::associateSimToReco
reco::SimToRecoCollection associateSimToReco(const edm::Handle< edm::View< reco::Track > > &trackCollectionHandle, const edm::Handle< TrackingParticleCollection > &trackingParticleCollectionHandle) const override
Definition: QuickTrackAssociatorByHitsImpl.cc:127
edm
HLT enums.
Definition: AlignableModifier.h:19
ClusterTPAssociation
Definition: ClusterTPAssociation.h:21
QuickTrackAssociatorByHitsImpl::weightedNumberOfTrackClusters
double weightedNumberOfTrackClusters(const reco::Track &track, const TrackerHitAssociator &) const
Definition: QuickTrackAssociatorByHitsImpl.cc:754
QuickTrackAssociatorByHitsImpl::getDoubleCount
double getDoubleCount(const TrackerHitAssociator &hitAssociator, iter begin, iter end, TrackingParticleRef associatedTrackingParticle) const
This method was copied almost verbatim from the standard TrackAssociatorByHits.
Definition: QuickTrackAssociatorByHitsImpl.cc:494
edm::RefVector< TrackingParticleCollection >
edm::Handle
Definition: AssociativeIterator.h:50
TrackQuality_cff.hitAssociator
hitAssociator
Definition: TrackQuality_cff.py:10
end
#define end
Definition: vmac.h:39
edm::Ref< TrackingParticleCollection >
edm::EDProductGetter
Definition: EDProductGetter.h:32
QuickTrackAssociatorByHitsImpl::puritySimToReco_
double puritySimToReco_
Definition: QuickTrackAssociatorByHitsImpl.h:228
QuickTrackAssociatorByHitsImpl::SimToRecoDenomType
SimToRecoDenomType
Definition: QuickTrackAssociatorByHitsImpl.h:68
reco::TrackToTrackingParticleAssociatorBaseImpl
Definition: TrackToTrackingParticleAssociatorBaseImpl.h:33
QuickTrackAssociatorByHitsImpl::qualitySimToReco_
double qualitySimToReco_
Definition: QuickTrackAssociatorByHitsImpl.h:227
QuickTrackAssociatorByHitsImpl::denomnone
Definition: QuickTrackAssociatorByHitsImpl.h:68
TrackingParticle
Monte Carlo truth information used for tracking validation.
Definition: TrackingParticle.h:29
PrimaryVertexAnalyzer4PUSlimmed_cfi.trackingParticleCollection
trackingParticleCollection
Definition: PrimaryVertexAnalyzer4PUSlimmed_cfi.py:21
reco::Track
Definition: Track.h:27
IndexSet.h
QuickTrackAssociatorByHitsImpl::denomsim
Definition: QuickTrackAssociatorByHitsImpl.h:68
QuickTrackAssociatorByHitsImpl::threeHitTracksAreSpecial_
bool threeHitTracksAreSpecial_
Definition: QuickTrackAssociatorByHitsImpl.h:232
QuickTrackAssociatorByHitsImpl::productGetter_
edm::EDProductGetter const * productGetter_
creates either a ClusterTPAssociation OR a TrackerHitAssociator and stores it in the provided unique_...
Definition: QuickTrackAssociatorByHitsImpl.h:223
QuickTrackAssociatorByHitsImpl::pixelHitWeight_
double pixelHitWeight_
Definition: QuickTrackAssociatorByHitsImpl.h:229
QuickTrackAssociatorByHitsImpl::TrackingParticleRefKeySet
edm::IndexSet TrackingParticleRefKeySet
Set for TrackingParticleRef keys.
Definition: QuickTrackAssociatorByHitsImpl.h:106
QuickTrackAssociatorByHitsImpl::getAllSimTrackIdentifiers
std::vector< std::pair< SimTrackIdentifiers, double > > getAllSimTrackIdentifiers(const TrackerHitAssociator &hitAssociator, iter begin, iter end) const
Returns a vector of pairs where first is a SimTrackIdentifiers (see typedef above) and second is the ...
Definition: QuickTrackAssociatorByHitsImpl.cc:430
edm::View
Definition: CaloClusterFwd.h:14
TrackToTrackingParticleAssociator.h
QuickTrackAssociatorByHitsImpl::trackingParticleContainsIdentifier
bool trackingParticleContainsIdentifier(const TrackingParticle *pTrackingParticle, const SimTrackIdentifiers &identifier) const
Returns true if the supplied TrackingParticle has the supplied g4 track identifiers.
Definition: QuickTrackAssociatorByHitsImpl.cc:476
EDProductGetter
QuickTrackAssociatorByHitsImpl::denomreco
Definition: QuickTrackAssociatorByHitsImpl.h:68
duplicaterechits_cfi.trackCollection
trackCollection
Definition: duplicaterechits_cfi.py:4
edm::AssociationMap< edm::OneToManyWithQualityGeneric< edm::View< reco::Track >, TrackingParticleCollection, double > >
muonClassificationByHits_cfi.trackingParticles
trackingParticles
Definition: muonClassificationByHits_cfi.py:28
edm::IndexSet
Definition: IndexSet.h:22
QuickTrackAssociatorByHitsImpl::associateTrack
std::vector< std::pair< edm::Ref< TrackingParticleCollection >, double > > associateTrack(const TrackerHitAssociator &hitAssociator, const T_TPCollection &trackingParticles, const TrackingParticleRefKeySet *trackingParticleKeys, iter begin, iter end) const
Returns the TrackingParticle that has the most associated hits to the given track.
Definition: QuickTrackAssociatorByHitsImpl.cc:307
edm::refcoreimpl::productGetter
EDProductGetter const * productGetter(std::atomic< void const * > const &iCache)
Definition: refcore_implementation.h:72
edm::RefToBaseVector< reco::Track >
OmniClusterRef.h
QuickTrackAssociatorByHitsImpl::cutRecoToSim_
double cutRecoToSim_
Definition: QuickTrackAssociatorByHitsImpl.h:230
TrackerHitAssociator
Definition: TrackerHitAssociator.h:55
QuickTrackAssociatorByHitsImpl::clusterToTPMap_
const ClusterTPAssociation * clusterToTPMap_
Definition: QuickTrackAssociatorByHitsImpl.h:225
QuickTrackAssociatorByHitsImpl::SimTrackIdentifiers
std::pair< uint32_t, EncodedEventId > SimTrackIdentifiers
This is enough information to uniquely identify a sim track.
Definition: QuickTrackAssociatorByHitsImpl.h:104
QuickTrackAssociatorByHitsImpl
TrackToTrackingParticleAssociator that associates by hits a bit quicker than the normal TrackAssociat...
Definition: QuickTrackAssociatorByHitsImpl.h:66
TrajectorySeed
Definition: TrajectorySeed.h:17
HLT_2018_cff.track
track
Definition: HLT_2018_cff.py:10352
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
begin
#define begin
Definition: vmac.h:32
QuickTrackAssociatorByHitsImpl::hitAssociator_
std::unique_ptr< const TrackerHitAssociator > hitAssociator_
Definition: QuickTrackAssociatorByHitsImpl.h:224
SurveyInfoScenario_cff.seed
seed
Definition: SurveyInfoScenario_cff.py:295
ClusterTPAssociation.h
QuickTrackAssociatorByHitsImpl::simToRecoDenominator_
SimToRecoDenomType simToRecoDenominator_
Definition: QuickTrackAssociatorByHitsImpl.h:231