CMS 3D CMS Logo

GEMSimHitMatcher.h
Go to the documentation of this file.
1 #ifndef Validation_MuonHits_GEMSimHitMatcher_h
2 #define Validation_MuonHits_GEMSimHitMatcher_h
3 
15 
17 public:
18  // constructor
20 
21  // destructor
23 
24  // initialize the event
25  void init(const edm::Event& e, const edm::EventSetup& eventSetup);
26 
27  // do the matching
28  void match(const SimTrack& t, const SimVertex& v);
29 
30  // partitions' detIds with SimHits
31  std::set<unsigned int> detIds(int gem_type = MuonHitHelper::GEM_ALL) const;
32 
33  // chamber detIds with SimHits
34  std::set<unsigned int> chamberIds(int gem_type = MuonHitHelper::GEM_ALL) const;
35 
36  // GEM detid's with hits in 2 layers of coincidence pads
37  // those are layer==1 only detid's
38  std::set<unsigned int> detIdsCoincidences() const;
39 
40  // GEM superchamber detIds with SimHits
41  std::set<unsigned int> superChamberIds() const;
42 
43  // GEM superchamber detIds with SimHits 2 layers of coincidence pads
44  std::set<unsigned int> superChamberIdsCoincidences() const;
45 
46  // simhits from a particular superchamber
47  const edm::PSimHitContainer& hitsInSuperChamber(unsigned int) const;
48 
49  // was there a hit in a particular station?
50  bool hitStation(int, int) const;
51 
52  // number of stations with hits in at least X layers
53  int nStations(int nl = 2) const;
54 
55  // #layers with hits
56  int nLayersWithHitsInSuperChamber(unsigned int) const;
57 
58  // How many pads with simhits in GEM did this simtrack get?
59  int nPadsWithHits() const;
60 
61  // How many coincidence pads with simhits in GEM did this simtrack get?
62  int nCoincidencePadsWithHits() const;
63 
64  // transverse position in GEM
65  float simHitsGEMCentralPosition(const edm::PSimHitContainer& sim_hits) const;
66 
67  // calculate average strip number for a provided collection of simhits
68  float simHitsMeanStrip(const edm::PSimHitContainer& sim_hits) const;
69 
70  std::set<int> hitStripsInDetId(unsigned int, int margin_n_strips = 1) const;
71  std::set<int> hitPadsInDetId(unsigned int) const;
72  std::set<int> hitCoPadsInDetId(unsigned int) const;
73 
74  // what unique partitions numbers were hit by this simtrack?
75  std::set<int> hitPartitions() const;
76 
77 private:
79 
80  void clear();
81 
83 
84  std::map<unsigned int, edm::PSimHitContainer> superchamber_to_hits_;
85 
86  // detids with hits in pads
87  std::map<unsigned int, std::set<int> > detids_to_pads_;
88 
89  // detids with hits in 2-layer pad coincidences
90  std::map<unsigned int, std::set<int> > detids_to_copads_;
91 };
92 
93 #endif
int nLayersWithHitsInSuperChamber(unsigned int) const
std::map< unsigned int, std::set< int > > detids_to_pads_
void init(const edm::Event &e, const edm::EventSetup &eventSetup)
initialize the event
const edm::PSimHitContainer & hitsInSuperChamber(unsigned int) const
std::set< unsigned int > detIdsCoincidences() const
std::set< int > hitStripsInDetId(unsigned int, int margin_n_strips=1) const
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > geomToken_
bool hitStation(int, int) const
GEMSimHitMatcher(const edm::ParameterSet &iPS, edm::ConsumesCollector &&iC)
int nCoincidencePadsWithHits() const
int nStations(int nl=2) const
std::set< unsigned int > superChamberIds() const
std::set< int > hitPartitions() const
std::map< unsigned int, edm::PSimHitContainer > superchamber_to_hits_
std::set< int > hitCoPadsInDetId(unsigned int) const
std::set< unsigned int > detIds(int gem_type=MuonHitHelper::GEM_ALL) const
std::set< int > hitPadsInDetId(unsigned int) const
float simHitsMeanStrip(const edm::PSimHitContainer &sim_hits) const
std::map< unsigned int, std::set< int > > detids_to_copads_
std::set< unsigned int > chamberIds(int gem_type=MuonHitHelper::GEM_ALL) const
float simHitsGEMCentralPosition(const edm::PSimHitContainer &sim_hits) const
int nPadsWithHits() const
void match(const SimTrack &t, const SimVertex &v)
do the matching
std::vector< PSimHit > PSimHitContainer
std::set< unsigned int > superChamberIdsCoincidences() const