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
GEMRecHitCollection
GEMRecHitMatcher::recHits_
GEMRecHitContainer recHits_
Definition: GEMRecHitMatcher.h:104
GEMRecHitMatcher::verbose_
bool verbose_
Definition: GEMRecHitMatcher.h:97
SimVertex
Definition: SimVertex.h:5
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:106
edm::EDGetTokenT< GEMRecHitCollection >
GEMRecHitMatcher::recHits
const GEMRecHitContainer & recHits() const
Definition: GEMRecHitMatcher.h:54
GEMRecHitMatcher::chamberIds
std::set< unsigned int > chamberIds() const
Definition: GEMRecHitMatcher.cc:96
findQualityFiles.v
v
Definition: findQualityFiles.py:179
GEMRecHitMatcher::recHitInContainer
bool recHitInContainer(const GEMRecHit &rh, const GEMRecHitContainer &c) const
Definition: GEMRecHitMatcher.cc:186
edm::Handle< GEMRecHitCollection >
GEMRecHitMatcher::gemRecHitToken_
edm::EDGetTokenT< GEMRecHitCollection > gemRecHitToken_
Definition: GEMRecHitMatcher.h:90
GEMRecHitMatcher::recHitPosition
GlobalPoint recHitPosition(const GEMRecHit &rechit) const
Definition: GEMRecHitMatcher.cc:157
GEMRecHitMatcher::~GEMRecHitMatcher
~GEMRecHitMatcher()
Definition: GEMRecHitMatcher.h:36
GEMRecHitMatcher::chamber_to_recHits_
std::map< unsigned int, GEMRecHitContainer > chamber_to_recHits_
Definition: GEMRecHitMatcher.h:100
GEMRecHitMatcher::gemGeometry_
const GEMGeometry * gemGeometry_
Definition: GEMRecHitMatcher.h:94
GEMRecHitMatcher::areGEMRecHitSame
bool areGEMRecHitSame(const GEMRecHit &l, const GEMRecHit &r) const
Definition: GEMRecHitMatcher.cc:198
GEMRecHitMatcher::superchamber_to_recHits_
std::map< unsigned int, GEMRecHitContainer > superchamber_to_recHits_
Definition: GEMRecHitMatcher.h:101
GEMRecHitMatcher::recHitsInChamber
const GEMRecHitContainer & recHitsInChamber(unsigned int) const
Definition: GEMRecHitMatcher.cc:116
GEMRecHitMatcher::gemDigiMatcher
std::shared_ptr< GEMDigiMatcher > gemDigiMatcher() const
Definition: GEMRecHitMatcher.h:79
GEMRecHitMatcher::stripNumbersInDetId
std::set< int > stripNumbersInDetId(unsigned int) const
Definition: GEMRecHitMatcher.cc:136
GEMRecHitContainer
std::vector< GEMRecHit > GEMRecHitContainer
Definition: GEMRecHitMatcher.h:27
HI_PhotonSkim_cff.rechits
rechits
Definition: HI_PhotonSkim_cff.py:76
Point3DBase< float, GlobalTag >
GEMRecHitMatcher
Definition: GEMRecHitMatcher.h:30
GEMRecHitMatcher::recHitsInSuperChamber
const GEMRecHitContainer & recHitsInSuperChamber(unsigned int) const
Definition: GEMRecHitMatcher.cc:122
GEMRecHitMatcher::detIds
std::set< unsigned int > detIds() const
Definition: GEMRecHitMatcher.cc:89
edm::ParameterSet
Definition: ParameterSet.h:47
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:194
Event.h
GEMRecHitMatcher::nLayersWithRecHitsInSuperChamber
int nLayersWithRecHitsInSuperChamber(unsigned int) const
Definition: GEMRecHitMatcher.cc:128
GEMRecHitMatcher::partitionNumbers
std::set< int > partitionNumbers() const
Definition: GEMRecHitMatcher.cc:147
GEMRecHitMatcher::matchRecHitsToSimTrack
void matchRecHitsToSimTrack(const GEMRecHitCollection &recHits)
Definition: GEMRecHitMatcher.cc:40
GEMRecHitMatcher::minBX_
int minBX_
Definition: GEMRecHitMatcher.h:96
GEMRecHitCollection.h
edm::EventSetup
Definition: EventSetup.h:58
GEMRecHitMatcher::no_recHits_
const GEMRecHitContainer no_recHits_
Definition: GEMRecHitMatcher.h:103
GEMRecHitMatcher::geomToken_
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > geomToken_
Definition: GEMRecHitMatcher.h:93
edm::ESGetToken< GEMGeometry, MuonGeometryRecord >
InputTag.h
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:204
alignCSCRings.r
r
Definition: alignCSCRings.py:93
GEMRecHitMatcher::recHitsInDetId
const GEMRecHitContainer & recHitsInDetId(unsigned int) const
Definition: GEMRecHitMatcher.cc:110
GEMRecHitMatcher::init
void init(const edm::Event &e, const edm::EventSetup &eventSetup)
Definition: GEMRecHitMatcher.cc:20
GEMRecHitMatcher::recHitMeanPosition
GlobalPoint recHitMeanPosition(const GEMRecHitContainer &rechits) const
Definition: GEMRecHitMatcher.cc:163
SimTrack
Definition: SimTrack.h:9
GEMRecHitMatcher::gemRecHitH_
edm::Handle< GEMRecHitCollection > gemRecHitH_
Definition: GEMRecHitMatcher.h:91
GEMRecHitMatcher::detid_to_recHits_
std::map< unsigned int, GEMRecHitContainer > detid_to_recHits_
Definition: GEMRecHitMatcher.h:99
GEMRecHitMatcher::superChamberIds
std::set< unsigned int > superChamberIds() const
Definition: GEMRecHitMatcher.cc:103
EventSetup.h
GEMRecHit
Definition: GEMRecHit.h:14
GEMRecHitMatcher::maxBX_
int maxBX_
Definition: GEMRecHitMatcher.h:96
GEMGeometry
Definition: GEMGeometry.h:24
ConsumesCollector.h
ParameterSet.h
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
edm::Event
Definition: Event.h:73
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
GEMRecHitMatcher::match
void match(const SimTrack &t, const SimVertex &v)
do the matching
Definition: GEMRecHitMatcher.cc:29
SimTrackContainer.h
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
SimVertexContainer.h
GEMRecHitMatcher::verbose
bool verbose() const
Definition: GEMRecHitMatcher.h:71
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37