CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MuonAssociatorByHitsHelper.h
Go to the documentation of this file.
1 #ifndef MuonAssociatorByHitsHelper_h
2 #define MuonAssociatorByHitsHelper_h
3 
20 
21 #include <boost/ptr_container/ptr_vector.hpp>
22 #include <functional>
23 
24 class TrackerTopology;
25 
27 
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 {
43  std::function<void(const TrackHitsCollection&, const TrackingParticleCollection&)> diagnostics_;
44  };
45 
46 
47  struct IndexMatch {
48  IndexMatch(size_t index, double global_quality) : idx(index), quality(global_quality) {}
49  size_t idx; double quality;
50  bool operator<(const IndexMatch &other) const { return other.quality < quality; }
51  };
52  typedef std::map<size_t, std::vector<IndexMatch> > IndexAssociation;
53 
56  Resources const&) const;
57 
60  Resources const&) const;
61 
62 
63 
64  private:
65  void getMatchedIds
66  (MapOfMatchedIds & tracker_matchedIds_valid, MapOfMatchedIds & muon_matchedIds_valid,
67  MapOfMatchedIds & tracker_matchedIds_INVALID, MapOfMatchedIds & muon_matchedIds_INVALID,
68  int& n_tracker_valid, int& n_dt_valid, int& n_csc_valid, int& n_rpc_valid,
69  int& n_tracker_matched_valid, int& n_dt_matched_valid, int& n_csc_matched_valid, int& n_rpc_matched_valid,
70  int& n_tracker_INVALID, int& n_dt_INVALID, int& n_csc_INVALID, int& n_rpc_INVALID,
71  int& n_tracker_matched_INVALID, int& n_dt_matched_INVALID, int& n_csc_matched_INVALID, int& n_rpc_matched_INVALID,
73  const TrackerHitAssociator* trackertruth, const DTHitAssociator& dttruth, const CSCHitAssociator& csctruth, const RPCHitAssociator& rpctruth,
74  bool printRts, const TrackerTopology *) const;
75 
76  int getShared(MapOfMatchedIds & matchedIds, TrackingParticleCollection::const_iterator trpart) const;
77 
78  const bool includeZeroHitMuons;
80  bool UseTracker;
81  bool UseMuon;
83  unsigned int NHitCut_track;
87  unsigned int NHitCut_muon;
90  const bool UsePixels;
91  const bool UseGrouped;
92  const bool UseSplitting;
94  const bool dumpDT;
95 
96  int LayerFromDetid(const DetId&) const;
98  const TrackingRecHit* getHitPtr(const trackingRecHit_iterator& iter) const {return &**iter;}
99 
100  std::string write_matched_simtracks(const std::vector<SimHitIdpr>&) const;
101 
102 };
103 
104 #endif
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_tracker_matched_valid, int &n_dt_matched_valid, int &n_csc_matched_valid, int &n_rpc_matched_valid, int &n_tracker_INVALID, int &n_dt_INVALID, int &n_csc_INVALID, int &n_rpc_INVALID, int &n_tracker_matched_INVALID, int &n_dt_matched_INVALID, int &n_csc_matched_INVALID, int &n_rpc_matched_INVALID, trackingRecHit_iterator begin, trackingRecHit_iterator end, const TrackerHitAssociator *trackertruth, const DTHitAssociator &dttruth, const CSCHitAssociator &csctruth, const RPCHitAssociator &rpctruth, bool printRts, const TrackerTopology *) const
std::string write_matched_simtracks(const std::vector< SimHitIdpr > &) const
std::map< size_t, std::vector< IndexMatch > > IndexAssociation
int getShared(MapOfMatchedIds &matchedIds, TrackingParticleCollection::const_iterator trpart) const
bool operator<(const IndexMatch &other) const
IndexAssociation associateSimToRecoIndices(const TrackHitsCollection &, const edm::RefVector< TrackingParticleCollection > &, Resources const &) const
int LayerFromDetid(const DetId &) const
IndexMatch(size_t index, double global_quality)
std::vector< std::pair< trackingRecHit_iterator, trackingRecHit_iterator > > TrackHitsCollection
MuonAssociatorByHitsHelper(const edm::ParameterSet &conf)
std::function< void(const TrackHitsCollection &, const TrackingParticleCollection &)> diagnostics_
#define end
Definition: vmac.h:37
const TrackingRecHit * getHitPtr(const trackingRecHit_iterator &iter) const
tuple conf
Definition: dbtoconf.py:185
Definition: DetId.h:18
std::pair< unsigned int, std::vector< SimHitIdpr > > uint_SimHitIdpr_pair
IndexAssociation associateRecoToSimIndices(const TrackHitsCollection &, const edm::RefVector< TrackingParticleCollection > &, Resources const &) const
#define begin
Definition: vmac.h:30
std::pair< uint32_t, EncodedEventId > SimHitIdpr
boost::ptr_vector< uint_SimHitIdpr_pair > MapOfMatchedIds
const TrackingRecHit * getHitPtr(edm::OwnVector< TrackingRecHit >::const_iterator iter) const
TrackingRecHitCollection::base::const_iterator trackingRecHit_iterator
iterator over a vector of reference to TrackingRecHit in the same collection