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(
33  int gem_type = MuonHitHelper::GEM_ALL) const;
34 
35  // GEM detid's with hits in 2 layers of coincidence pads
36  // those are layer==1 only detid's
37  std::set<unsigned int> detIdsCoincidences() const;
38 
39  // GEM superchamber detIds with SimHits
40  std::set<unsigned int> superChamberIds() const;
41 
42  // GEM superchamber detIds with SimHits 2 layers of coincidence pads
43  std::set<unsigned int> superChamberIdsCoincidences() const;
44 
45  // simhits from a particular superchamber
46  const edm::PSimHitContainer& hitsInSuperChamber(unsigned int) const;
47 
48  // was there a hit in a particular station?
49  bool hitStation(int, int) const;
50 
51  // number of stations with hits in at least X layers
52  int nStations(int nl = 2) const;
53 
54  // #layers with hits
55  int nLayersWithHitsInSuperChamber(unsigned int) const;
56 
57  // How many pads with simhits in GEM did this simtrack get?
58  int nPadsWithHits() const;
59 
60  // How many coincidence pads with simhits in GEM did this simtrack get?
61  int nCoincidencePadsWithHits() const;
62 
63  // transverse position in GEM
64  float simHitsGEMCentralPosition(const edm::PSimHitContainer& sim_hits) const;
65 
66  // calculate average strip number for a provided collection of simhits
67  float simHitsMeanStrip(const edm::PSimHitContainer& sim_hits) const;
68 
69  std::set<int> hitStripsInDetId(unsigned int, int margin_n_strips = 0) const;
70  std::set<int> hitPadsInDetId(unsigned int) const;
71  std::set<int> hitCoPadsInDetId(unsigned int) const;
72 
73  // what unique partitions numbers were hit by this simtrack?
74  std::set<int> hitPartitions() const;
75 
76  private:
78 
80 
81  std::map<unsigned int, edm::PSimHitContainer> superchamber_to_hits_;
82 
83  // detids with hits in pads
84  std::map<unsigned int, std::set<int> > detids_to_pads_;
85 
86  // detids with hits in 2-layer pad coincidences
87  std::map<unsigned int, std::set<int> > detids_to_copads_;
88 };
89 
90 #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_