CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 areGEMRecHitSame(const GEMRecHit &l, const GEMRecHit &r) const
const GEMRecHitContainer & recHitsInDetId(unsigned int) const
std::shared_ptr< GEMDigiMatcher > gemDigiMatcher() const
std::set< int > stripNumbersInDetId(unsigned int) const
std::set< unsigned int > chamberIds() const
const edm::EventSetup & c
GEMRecHitContainer recHits_
GlobalPoint recHitMeanPosition(const GEMRecHitContainer &rechits) const
std::shared_ptr< GEMDigiMatcher > gemDigiMatcher_
std::map< unsigned int, GEMRecHitContainer > chamber_to_recHits_
edm::EDGetTokenT< GEMRecHitCollection > gemRecHitToken_
std::vector< GEMRecHit > GEMRecHitContainer
std::set< unsigned int > detIds() const
std::set< unsigned int > superChamberIds() const
std::map< unsigned int, GEMRecHitContainer > superchamber_to_recHits_
GlobalPoint recHitPosition(const GEMRecHit &rechit) const
const GEMGeometry * gemGeometry_
void matchRecHitsToSimTrack(const GEMRecHitCollection &recHits)
edm::Handle< GEMRecHitCollection > gemRecHitH_
int nLayersWithRecHitsInSuperChamber(unsigned int) const
GEMRecHitMatcher(edm::ParameterSet const &iPS, edm::ConsumesCollector &&iC)
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > geomToken_
bool isGEMRecHitMatched(const GEMRecHit &thisRh) const
const GEMRecHitContainer & recHitsInSuperChamber(unsigned int) const
const GEMRecHitContainer & recHitsInChamber(unsigned int) const
void init(const edm::Event &e, const edm::EventSetup &eventSetup)
const GEMRecHitContainer & recHits() const
int nGEMRecHits() const
How many recHits in GEM did this simtrack get in total?
bool verbose() const
const GEMRecHitContainer no_recHits_
bool recHitInContainer(const GEMRecHit &rh, const GEMRecHitContainer &c) const
void match(const SimTrack &t, const SimVertex &v)
do the matching
std::map< unsigned int, GEMRecHitContainer > detid_to_recHits_
std::set< int > partitionNumbers() const