CMS 3D CMS Logo

GEMRecHitMatcher.h
Go to the documentation of this file.
1 #ifndef Validation_MuonGEMRecHits_GEMRecHitMatcher_h
2 #define Validation_MuonGEMRecHits_GEMRecHitMatcher_h
3 
22 
23 #include <vector>
24 #include <map>
25 #include <set>
26 
27 typedef std::vector<GEMRecHit> GEMRecHitContainer;
28 
29 class GEMGeometry;
31 public:
32  // constructor
34 
35  // destructor
37 
38  // initialize the event
39  void init(const edm::Event& e, const edm::EventSetup& eventSetup);
40 
41  // do the matching
42  void match(const SimTrack& t, const SimVertex& v);
43 
44  // partition GEM detIds with rechits
45  std::set<unsigned int> detIds() const;
46 
47  // chamber detIds with rechits
48  std::set<unsigned int> chamberIds() const;
49 
50  // superchamber detIds with rechits
51  std::set<unsigned int> superChamberIds() const;
52 
53  // GEM recHits from a particular partition, chamber or superchamber
54  const GEMRecHitContainer& recHits() const { return recHits_; }
55  const GEMRecHitContainer& recHitsInDetId(unsigned int) const;
56  const GEMRecHitContainer& recHitsInChamber(unsigned int) const;
57  const GEMRecHitContainer& recHitsInSuperChamber(unsigned int) const;
58 
59  // #layers with recHits from this simtrack
60  int nLayersWithRecHitsInSuperChamber(unsigned int) const;
61 
63  int nGEMRecHits() const;
64 
65  std::set<int> stripNumbersInDetId(unsigned int) const;
66 
67  // what unique partitions numbers with recHits from this simtrack?
68  std::set<int> partitionNumbers() const;
69 
70  // verbose value
71  bool verbose() const { return verbose_; }
72 
73  // global position of the rechit (based on the first strip hit)
74  GlobalPoint recHitPosition(const GEMRecHit& rechit) const;
75 
76  // mean position of a rechit collection (all based on the first strip hit)
78 
79  std::shared_ptr<GEMDigiMatcher> gemDigiMatcher() const { return gemDigiMatcher_; }
80 
81  bool recHitInContainer(const GEMRecHit& rh, const GEMRecHitContainer& c) const;
82 
83  bool isGEMRecHitMatched(const GEMRecHit& thisRh) const;
84 
85  bool areGEMRecHitSame(const GEMRecHit& l, const GEMRecHit& r) const;
86 
87 private:
89 
92 
95 
96  int minBX_, maxBX_;
97  bool verbose_;
98 
99  std::map<unsigned int, GEMRecHitContainer> detid_to_recHits_;
100  std::map<unsigned int, GEMRecHitContainer> chamber_to_recHits_;
101  std::map<unsigned int, GEMRecHitContainer> superchamber_to_recHits_;
102 
105 
106  std::shared_ptr<GEMDigiMatcher> gemDigiMatcher_;
107 };
108 
109 #endif
bool verbose() const
GEMRecHitContainer recHits_
GlobalPoint recHitPosition(const GEMRecHit &rechit) const
std::shared_ptr< GEMDigiMatcher > gemDigiMatcher_
bool recHitInContainer(const GEMRecHit &rh, const GEMRecHitContainer &c) const
std::map< unsigned int, GEMRecHitContainer > chamber_to_recHits_
edm::EDGetTokenT< GEMRecHitCollection > gemRecHitToken_
std::vector< GEMRecHit > GEMRecHitContainer
bool areGEMRecHitSame(const GEMRecHit &l, const GEMRecHit &r) const
const GEMRecHitContainer & recHits() const
std::set< unsigned int > chamberIds() const
std::shared_ptr< GEMDigiMatcher > gemDigiMatcher() const
int nGEMRecHits() const
How many recHits in GEM did this simtrack get in total?
std::set< int > partitionNumbers() const
bool isGEMRecHitMatched(const GEMRecHit &thisRh) const
std::map< unsigned int, GEMRecHitContainer > superchamber_to_recHits_
const GEMGeometry * gemGeometry_
void matchRecHitsToSimTrack(const GEMRecHitCollection &recHits)
std::set< int > stripNumbersInDetId(unsigned int) const
const GEMRecHitContainer & recHitsInChamber(unsigned int) const
std::set< unsigned int > detIds() const
edm::Handle< GEMRecHitCollection > gemRecHitH_
const GEMRecHitContainer & recHitsInDetId(unsigned int) const
GlobalPoint recHitMeanPosition(const GEMRecHitContainer &rechits) const
const GEMRecHitContainer & recHitsInSuperChamber(unsigned int) const
GEMRecHitMatcher(edm::ParameterSet const &iPS, edm::ConsumesCollector &&iC)
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > geomToken_
int nLayersWithRecHitsInSuperChamber(unsigned int) const
void init(const edm::Event &e, const edm::EventSetup &eventSetup)
const GEMRecHitContainer no_recHits_
void match(const SimTrack &t, const SimVertex &v)
do the matching
std::set< unsigned int > superChamberIds() const
std::map< unsigned int, GEMRecHitContainer > detid_to_recHits_