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 
23 
24 #include <vector>
25 #include <map>
26 #include <set>
27 
28 typedef std::vector<GEMRecHit> GEMRecHitContainer;
29 
30 class GEMGeometry;
32 public:
33  // constructor
35 
36  // destructor
38 
39  // initialize the event
40  void init(const edm::Event& e, const edm::EventSetup& eventSetup);
41 
42  // do the matching
43  void match(const SimTrack& t, const SimVertex& v);
44 
45  // partition GEM detIds with rechits
46  std::set<unsigned int> detIds() const;
47 
48  // chamber detIds with rechits
49  std::set<unsigned int> chamberIds() const;
50 
51  // superchamber detIds with rechits
52  std::set<unsigned int> superChamberIds() const;
53 
54  // GEM recHits from a particular partition, chamber or superchamber
55  const GEMRecHitContainer& recHits() const { return recHits_; }
56  const GEMRecHitContainer& recHitsInDetId(unsigned int) const;
57  const GEMRecHitContainer& recHitsInChamber(unsigned int) const;
58  const GEMRecHitContainer& recHitsInSuperChamber(unsigned int) const;
59 
60  // #layers with recHits from this simtrack
61  int nLayersWithRecHitsInSuperChamber(unsigned int) const;
62 
64  int nGEMRecHits() const;
65 
66  std::set<int> stripNumbersInDetId(unsigned int) const;
67 
68  // what unique partitions numbers with recHits from this simtrack?
69  std::set<int> partitionNumbers() const;
70 
71  // verbose value
72  bool verbose() const { return verbose_; }
73 
74  // global position of the rechit (based on the first strip hit)
75  GlobalPoint recHitPosition(const GEMRecHit& rechit) const;
76 
77  // mean position of a rechit collection (all based on the first strip hit)
79 
80  std::shared_ptr<GEMDigiMatcher> gemDigiMatcher() const { return gemDigiMatcher_; }
81 
82  bool recHitInContainer(const GEMRecHit& rh, const GEMRecHitContainer& c) const;
83 
84  bool isGEMRecHitMatched(const GEMRecHit& thisRh) const;
85 
86  bool areGEMRecHitSame(const GEMRecHit& l, const GEMRecHit& r) const;
87 
88 private:
90 
93 
96 
97  int minBX_, maxBX_;
98  bool verbose_;
99 
100  std::map<unsigned int, GEMRecHitContainer> detid_to_recHits_;
101  std::map<unsigned int, GEMRecHitContainer> chamber_to_recHits_;
102  std::map<unsigned int, GEMRecHitContainer> superchamber_to_recHits_;
103 
106 
107  std::shared_ptr<GEMDigiMatcher> gemDigiMatcher_;
108 };
109 
110 #endif
GEMRecHitCollection
GEMRecHitMatcher::recHits_
GEMRecHitContainer recHits_
Definition: GEMRecHitMatcher.h:105
GEMRecHitMatcher::verbose_
bool verbose_
Definition: GEMRecHitMatcher.h:98
SimVertex
Definition: SimVertex.h:5
ESHandle.h
GEMDigiMatcher.h
GEMRecHitMatcher::nGEMRecHits
int nGEMRecHits() const
How many recHits in GEM did this simtrack get in total?
GEMRecHitMatcher::gemDigiMatcher_
std::shared_ptr< GEMDigiMatcher > gemDigiMatcher_
Definition: GEMRecHitMatcher.h:107
edm::EDGetTokenT< GEMRecHitCollection >
GEMRecHitMatcher::recHits
const GEMRecHitContainer & recHits() const
Definition: GEMRecHitMatcher.h:55
GEMRecHitMatcher::chamberIds
std::set< unsigned int > chamberIds() const
Definition: GEMRecHitMatcher.cc:100
findQualityFiles.v
v
Definition: findQualityFiles.py:179
GEMRecHitMatcher::recHitInContainer
bool recHitInContainer(const GEMRecHit &rh, const GEMRecHitContainer &c) const
Definition: GEMRecHitMatcher.cc:190
edm::Handle< GEMRecHitCollection >
GEMRecHitMatcher::gemRecHitToken_
edm::EDGetTokenT< GEMRecHitCollection > gemRecHitToken_
Definition: GEMRecHitMatcher.h:91
GEMRecHitMatcher::recHitPosition
GlobalPoint recHitPosition(const GEMRecHit &rechit) const
Definition: GEMRecHitMatcher.cc:161
GEMRecHitMatcher::~GEMRecHitMatcher
~GEMRecHitMatcher()
Definition: GEMRecHitMatcher.h:37
GEMRecHitMatcher::chamber_to_recHits_
std::map< unsigned int, GEMRecHitContainer > chamber_to_recHits_
Definition: GEMRecHitMatcher.h:101
GEMRecHitMatcher::gemGeometry_
const GEMGeometry * gemGeometry_
Definition: GEMRecHitMatcher.h:95
GEMRecHitMatcher::areGEMRecHitSame
bool areGEMRecHitSame(const GEMRecHit &l, const GEMRecHit &r) const
Definition: GEMRecHitMatcher.cc:202
GEMRecHitMatcher::superchamber_to_recHits_
std::map< unsigned int, GEMRecHitContainer > superchamber_to_recHits_
Definition: GEMRecHitMatcher.h:102
GEMRecHitMatcher::recHitsInChamber
const GEMRecHitContainer & recHitsInChamber(unsigned int) const
Definition: GEMRecHitMatcher.cc:120
edm::ESHandle< GEMGeometry >
GEMRecHitMatcher::gemDigiMatcher
std::shared_ptr< GEMDigiMatcher > gemDigiMatcher() const
Definition: GEMRecHitMatcher.h:80
GEMRecHitMatcher::stripNumbersInDetId
std::set< int > stripNumbersInDetId(unsigned int) const
Definition: GEMRecHitMatcher.cc:140
GEMRecHitContainer
std::vector< GEMRecHit > GEMRecHitContainer
Definition: GEMRecHitMatcher.h:28
Point3DBase< float, GlobalTag >
OrderedSet.t
t
Definition: OrderedSet.py:90
GEMRecHitMatcher::gem_geom_
edm::ESHandle< GEMGeometry > gem_geom_
Definition: GEMRecHitMatcher.h:94
GEMRecHitMatcher
Definition: GEMRecHitMatcher.h:31
GEMRecHitMatcher::recHitsInSuperChamber
const GEMRecHitContainer & recHitsInSuperChamber(unsigned int) const
Definition: GEMRecHitMatcher.cc:126
GEMRecHitMatcher::detIds
std::set< unsigned int > detIds() const
Definition: GEMRecHitMatcher.cc:93
edm::ParameterSet
Definition: ParameterSet.h:36
GEMRecHitMatcher::GEMRecHitMatcher
GEMRecHitMatcher(edm::ParameterSet const &iPS, edm::ConsumesCollector &&iC)
Definition: GEMRecHitMatcher.cc:7
GEMRecHitMatcher::isGEMRecHitMatched
bool isGEMRecHitMatched(const GEMRecHit &thisRh) const
Definition: GEMRecHitMatcher.cc:198
Event.h
GEMRecHitMatcher::nLayersWithRecHitsInSuperChamber
int nLayersWithRecHitsInSuperChamber(unsigned int) const
Definition: GEMRecHitMatcher.cc:132
TrackInfoProducer_cfi.rechits
rechits
Definition: TrackInfoProducer_cfi.py:9
GEMRecHitMatcher::partitionNumbers
std::set< int > partitionNumbers() const
Definition: GEMRecHitMatcher.cc:151
GEMRecHitMatcher::matchRecHitsToSimTrack
void matchRecHitsToSimTrack(const GEMRecHitCollection &recHits)
Definition: GEMRecHitMatcher.cc:44
GEMRecHitMatcher::minBX_
int minBX_
Definition: GEMRecHitMatcher.h:97
GEMRecHitCollection.h
edm::EventSetup
Definition: EventSetup.h:57
GEMRecHitMatcher::no_recHits_
const GEMRecHitContainer no_recHits_
Definition: GEMRecHitMatcher.h:104
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
InputTag.h
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:193
alignCSCRings.r
r
Definition: alignCSCRings.py:93
GEMRecHitMatcher::recHitsInDetId
const GEMRecHitContainer & recHitsInDetId(unsigned int) const
Definition: GEMRecHitMatcher.cc:114
GEMRecHitMatcher::init
void init(const edm::Event &e, const edm::EventSetup &eventSetup)
Definition: GEMRecHitMatcher.cc:19
GEMRecHitMatcher::recHitMeanPosition
GlobalPoint recHitMeanPosition(const GEMRecHitContainer &rechits) const
Definition: GEMRecHitMatcher.cc:167
SimTrack
Definition: SimTrack.h:6
GEMRecHitMatcher::gemRecHitH_
edm::Handle< GEMRecHitCollection > gemRecHitH_
Definition: GEMRecHitMatcher.h:92
GEMRecHitMatcher::detid_to_recHits_
std::map< unsigned int, GEMRecHitContainer > detid_to_recHits_
Definition: GEMRecHitMatcher.h:100
GEMRecHitMatcher::superChamberIds
std::set< unsigned int > superChamberIds() const
Definition: GEMRecHitMatcher.cc:107
EventSetup.h
GEMRecHit
Definition: GEMRecHit.h:14
GEMRecHitMatcher::maxBX_
int maxBX_
Definition: GEMRecHitMatcher.h:97
GEMGeometry
Definition: GEMGeometry.h:24
ConsumesCollector.h
ParameterSet.h
edm::Event
Definition: Event.h:73
GEMRecHitMatcher::match
void match(const SimTrack &t, const SimVertex &v)
do the matching
Definition: GEMRecHitMatcher.cc:33
SimTrackContainer.h
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
SimVertexContainer.h
GEMRecHitMatcher::verbose
bool verbose() const
Definition: GEMRecHitMatcher.h:72
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37