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