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