CMS 3D CMS Logo

MuonAssociatorByHitsHelper.h
Go to the documentation of this file.
1 #ifndef MuonAssociatorByHitsHelper_h
2 #define MuonAssociatorByHitsHelper_h
3 
21 
22 #include <vector>
23 #include <memory>
24 #include <functional>
25 
26 class TrackerTopology;
27 
29 public:
30  typedef std::pair<uint32_t, EncodedEventId> SimHitIdpr;
31  // typedef std::map<unsigned int, std::vector<SimHitIdpr> > MapOfMatchedIds;
32  typedef std::pair<unsigned int, std::vector<SimHitIdpr>> uint_SimHitIdpr_pair;
33  typedef std::vector<std::unique_ptr<uint_SimHitIdpr_pair>> MapOfMatchedIds;
34  typedef std::vector<std::pair<trackingRecHit_iterator, trackingRecHit_iterator>> TrackHitsCollection;
35 
37 
38  struct Resources {
46  };
47 
48  struct IndexMatch {
49  IndexMatch(size_t index, double global_quality) : idx(index), quality(global_quality) {}
50  size_t idx;
51  double quality;
52  bool operator<(const IndexMatch &other) const { return other.quality < quality; }
53  };
54  typedef std::map<size_t, std::vector<IndexMatch>> IndexAssociation;
55 
58  Resources const &) const;
59 
62  Resources const &) const;
63 
64 private:
65  void getMatchedIds(MapOfMatchedIds &tracker_matchedIds_valid,
66  MapOfMatchedIds &muon_matchedIds_valid,
67  MapOfMatchedIds &tracker_matchedIds_INVALID,
68  MapOfMatchedIds &muon_matchedIds_INVALID,
69  int &n_tracker_valid,
70  int &n_dt_valid,
71  int &n_csc_valid,
72  int &n_rpc_valid,
73  int &n_gem_valid,
74  int &n_tracker_matched_valid,
75  int &n_dt_matched_valid,
76  int &n_csc_matched_valid,
77  int &n_rpc_matched_valid,
78  int &n_gem_matched_valid,
79  int &n_tracker_INVALID,
80  int &n_dt_INVALID,
81  int &n_csc_INVALID,
82  int &n_rpc_INVALID,
83  int &n_gem_INVALID,
84  int &n_tracker_matched_INVALID,
85  int &n_dt_matched_INVALID,
86  int &n_csc_matched_INVALID,
87  int &n_rpc_matched_INVALID,
88  int &n_gem_matched_INVALID,
91  const TrackerHitAssociator *trackertruth,
92  const DTHitAssociator &dttruth,
93  const CSCHitAssociator &csctruth,
94  const RPCHitAssociator &rpctruth,
95  const GEMHitAssociator &gemtruth,
96  bool printRts,
97  const TrackerTopology *) const;
98 
99  int getShared(MapOfMatchedIds &matchedIds, TrackingParticleCollection::const_iterator trpart) const;
100 
103  const bool rejectBadGlobal;
105  bool UseMuon;
107  unsigned int NHitCut_track;
111  unsigned int NHitCut_muon;
114  const bool UsePixels;
115  const bool UseGrouped;
116  const bool UseSplitting;
118  const bool dumpDT;
119 
120  int LayerFromDetid(const DetId &) const;
122  const TrackingRecHit *getHitPtr(const trackingRecHit_iterator &iter) const { return &**iter; }
123 
124  std::string write_matched_simtracks(const std::vector<SimHitIdpr> &) const;
125 };
126 
127 #endif
MuonAssociatorByHitsHelper::getMatchedIds
void getMatchedIds(MapOfMatchedIds &tracker_matchedIds_valid, MapOfMatchedIds &muon_matchedIds_valid, MapOfMatchedIds &tracker_matchedIds_INVALID, MapOfMatchedIds &muon_matchedIds_INVALID, int &n_tracker_valid, int &n_dt_valid, int &n_csc_valid, int &n_rpc_valid, int &n_gem_valid, int &n_tracker_matched_valid, int &n_dt_matched_valid, int &n_csc_matched_valid, int &n_rpc_matched_valid, int &n_gem_matched_valid, int &n_tracker_INVALID, int &n_dt_INVALID, int &n_csc_INVALID, int &n_rpc_INVALID, int &n_gem_INVALID, int &n_tracker_matched_INVALID, int &n_dt_matched_INVALID, int &n_csc_matched_INVALID, int &n_rpc_matched_INVALID, int &n_gem_matched_INVALID, trackingRecHit_iterator begin, trackingRecHit_iterator end, const TrackerHitAssociator *trackertruth, const DTHitAssociator &dttruth, const CSCHitAssociator &csctruth, const RPCHitAssociator &rpctruth, const GEMHitAssociator &gemtruth, bool printRts, const TrackerTopology *) const
Definition: MuonAssociatorByHitsHelper.cc:851
CSCHitAssociator.h
MuonAssociatorByHitsHelper::rejectBadGlobal
const bool rejectBadGlobal
Definition: MuonAssociatorByHitsHelper.h:103
Handle.h
MuonAssociatorByHitsHelper::SimHitIdpr
std::pair< uint32_t, EncodedEventId > SimHitIdpr
Definition: MuonAssociatorByHitsHelper.h:30
MuonAssociatorByHitsHelper::UseGrouped
const bool UseGrouped
Definition: MuonAssociatorByHitsHelper.h:115
MuonAssociatorByHitsHelper::PurityCut_muon
double PurityCut_muon
Definition: MuonAssociatorByHitsHelper.h:113
MuonAssociatorByHitsHelper::MuonAssociatorByHitsHelper
MuonAssociatorByHitsHelper(const edm::ParameterSet &conf)
Definition: MuonAssociatorByHitsHelper.cc:17
MuonAssociatorByHitsHelper::IndexMatch::idx
size_t idx
Definition: MuonAssociatorByHitsHelper.h:50
TrackerTopology
Definition: TrackerTopology.h:16
MuonAssociatorByHitsHelper::NHitCut_track
unsigned int NHitCut_track
Definition: MuonAssociatorByHitsHelper.h:107
DTHitAssociator.h
TrackAssociation.h
TrackerHitAssociator.h
edm::RefVector< TrackingParticleCollection >
MuonAssociatorByHitsHelper::TrackHitsCollection
std::vector< std::pair< trackingRecHit_iterator, trackingRecHit_iterator > > TrackHitsCollection
Definition: MuonAssociatorByHitsHelper.h:34
MuonAssociatorByHitsHelper::UsePixels
const bool UsePixels
Definition: MuonAssociatorByHitsHelper.h:114
MuonAssociatorByHitsHelper::getShared
int getShared(MapOfMatchedIds &matchedIds, TrackingParticleCollection::const_iterator trpart) const
Definition: MuonAssociatorByHitsHelper.cc:1370
MuonAssociatorByHitsHelper::Resources::trackerHitAssoc_
const TrackerHitAssociator * trackerHitAssoc_
Definition: MuonAssociatorByHitsHelper.h:40
MuonAssociatorByHitsHelper::EfficiencyCut_muon
double EfficiencyCut_muon
Definition: MuonAssociatorByHitsHelper.h:112
MuonAssociatorByHitsHelper::LayerFromDetid
int LayerFromDetid(const DetId &) const
MuonAssociatorByHitsHelper::getHitPtr
const TrackingRecHit * getHitPtr(edm::OwnVector< TrackingRecHit >::const_iterator iter) const
Definition: MuonAssociatorByHitsHelper.h:121
MuonAssociatorByHitsHelper::UseMuon
bool UseMuon
Definition: MuonAssociatorByHitsHelper.h:105
DetId
Definition: DetId.h:17
MuonAssociatorByHitsHelper::IndexAssociation
std::map< size_t, std::vector< IndexMatch > > IndexAssociation
Definition: MuonAssociatorByHitsHelper.h:54
MuonAssociatorByHitsHelper::IndexMatch::IndexMatch
IndexMatch(size_t index, double global_quality)
Definition: MuonAssociatorByHitsHelper.h:49
TrackingRecHit.h
MuonAssociatorByHitsHelper::Resources::tTopo_
const TrackerTopology * tTopo_
Definition: MuonAssociatorByHitsHelper.h:39
Track.h
TrackFwd.h
DTHitAssociator
Definition: DTHitAssociator.h:22
MuonAssociatorByHitsHelper::Resources::rpcHitAssoc_
const RPCHitAssociator * rpcHitAssoc_
Definition: MuonAssociatorByHitsHelper.h:43
MuonAssociatorByHitsHelper::associateSimToRecoIndices
IndexAssociation associateSimToRecoIndices(const TrackHitsCollection &, const edm::RefVector< TrackingParticleCollection > &, Resources const &) const
Definition: MuonAssociatorByHitsHelper.cc:408
MuonAssociatorByHitsHelper::Resources::diagnostics_
std::function< void(const TrackHitsCollection &, const TrackingParticleCollection &)> diagnostics_
Definition: MuonAssociatorByHitsHelper.h:45
mps_fire.end
end
Definition: mps_fire.py:242
trackingPlots.other
other
Definition: trackingPlots.py:1464
RPCHitAssociator.h
MuonAssociatorByHitsHelper::acceptOneStubMatchings
const bool acceptOneStubMatchings
Definition: MuonAssociatorByHitsHelper.h:102
edm::OwnVector::const_iterator
Definition: OwnVector.h:41
MuonAssociatorByHitsHelper::Resources::cscHitAssoc_
const CSCHitAssociator * cscHitAssoc_
Definition: MuonAssociatorByHitsHelper.h:41
edm::ParameterSet
Definition: ParameterSet.h:47
MuonAssociatorByHitsHelper
Definition: MuonAssociatorByHitsHelper.h:28
MuonAssociatorByHitsHelper::MapOfMatchedIds
std::vector< std::unique_ptr< uint_SimHitIdpr_pair > > MapOfMatchedIds
Definition: MuonAssociatorByHitsHelper.h:33
MuonAssociatorByHitsHelper::UseSplitting
const bool UseSplitting
Definition: MuonAssociatorByHitsHelper.h:116
MuonAssociatorByHitsHelper::PurityCut_track
double PurityCut_track
Definition: MuonAssociatorByHitsHelper.h:109
MuonAssociatorByHitsHelper::AbsoluteNumberOfHits_muon
const bool AbsoluteNumberOfHits_muon
Definition: MuonAssociatorByHitsHelper.h:110
MuonAssociatorByHitsHelper::UseTracker
bool UseTracker
Definition: MuonAssociatorByHitsHelper.h:104
MuonAssociatorByHitsHelper::uint_SimHitIdpr_pair
std::pair< unsigned int, std::vector< SimHitIdpr > > uint_SimHitIdpr_pair
Definition: MuonAssociatorByHitsHelper.h:32
MuonAssociatorByHitsHelper::IndexMatch::operator<
bool operator<(const IndexMatch &other) const
Definition: MuonAssociatorByHitsHelper.h:52
MuonAssociatorByHitsHelper::includeZeroHitMuons
const bool includeZeroHitMuons
Definition: MuonAssociatorByHitsHelper.h:101
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
MuonAssociatorByHitsHelper::Resources
Definition: MuonAssociatorByHitsHelper.h:38
MuonAssociatorByHitsHelper::getHitPtr
const TrackingRecHit * getHitPtr(const trackingRecHit_iterator &iter) const
Definition: MuonAssociatorByHitsHelper.h:122
TrackingRecHit
Definition: TrackingRecHit.h:21
TrackingParticle.h
TrackerHitAssociator
Definition: TrackerHitAssociator.h:55
MuonAssociatorByHitsHelper::write_matched_simtracks
std::string write_matched_simtracks(const std::vector< SimHitIdpr > &) const
Definition: MuonAssociatorByHitsHelper.cc:1406
Ref.h
MuonAssociatorByHitsHelper::Resources::dtHitAssoc_
const DTHitAssociator * dtHitAssoc_
Definition: MuonAssociatorByHitsHelper.h:42
Frameworkfwd.h
RPCHitAssociator
Definition: RPCHitAssociator.h:32
MuonAssociatorByHitsHelper::associateRecoToSimIndices
IndexAssociation associateRecoToSimIndices(const TrackHitsCollection &, const edm::RefVector< TrackingParticleCollection > &, Resources const &) const
Definition: MuonAssociatorByHitsHelper.cc:66
HiBiasedCentrality_cfi.function
function
Definition: HiBiasedCentrality_cfi.py:4
TrackingParticleCollection
std::vector< TrackingParticle > TrackingParticleCollection
Definition: TrackingParticleFwd.h:9
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
funct::void
TEMPL(T2) struct Divides void
Definition: Factorize.h:24
MuonAssociatorByHitsHelper::dumpDT
const bool dumpDT
Definition: MuonAssociatorByHitsHelper.h:118
ConsumesCollector.h
CSCHitAssociator
Definition: CSCHitAssociator.h:24
ParameterSet.h
MuonAssociatorByHitsHelper::AbsoluteNumberOfHits_track
const bool AbsoluteNumberOfHits_track
Definition: MuonAssociatorByHitsHelper.h:106
GEMHitAssociator.h
MuonAssociatorByHitsHelper::Resources::gemHitAssoc_
const GEMHitAssociator * gemHitAssoc_
Definition: MuonAssociatorByHitsHelper.h:44
MuonAssociatorByHitsHelper::IndexMatch
Definition: MuonAssociatorByHitsHelper.h:48
SimTrackContainer.h
MuonAssociatorByHitsHelper::IndexMatch::quality
double quality
Definition: MuonAssociatorByHitsHelper.h:51
SimVertexContainer.h
MuonAssociatorByHitsHelper::NHitCut_muon
unsigned int NHitCut_muon
Definition: MuonAssociatorByHitsHelper.h:111
MuonAssociatorByHitsHelper::EfficiencyCut_track
double EfficiencyCut_track
Definition: MuonAssociatorByHitsHelper.h:108
MuonAssociatorByHitsHelper::ThreeHitTracksAreSpecial
const bool ThreeHitTracksAreSpecial
Definition: MuonAssociatorByHitsHelper.h:117
GEMHitAssociator
Definition: GEMHitAssociator.h:33