CMS 3D CMS Logo

SimHitMatcher.h
Go to the documentation of this file.
1 #ifndef GEMValidation_SimHitMatcher_h
2 #define GEMValidation_SimHitMatcher_h
3 
20 
26 #include <vector>
27 #include <map>
28 #include <set>
29 
30 class GEMGeometry;
31 
33 public:
35  const edm::Event&,
36  const GEMGeometry& geom,
37  const edm::ParameterSet& cfg,
38  edm::EDGetToken& simhitToken,
39  edm::EDGetToken& simtrackToken,
40  edm::EDGetToken& simvertexToken);
41 
43 
45  const edm::PSimHitContainer& simHitsGEM() const { return gem_hits_; }
47  std::set<unsigned int> detIdsGEM() const;
48 
51  std::set<unsigned int> detIdsGEMCoincidences() const;
52 
54  std::set<unsigned int> chamberIdsGEM() const;
55 
57  std::set<unsigned int> superChamberIdsGEM() const;
59  std::set<unsigned int> superChamberIdsGEMCoincidences() const;
60 
62  const edm::PSimHitContainer& hitsInDetId(unsigned int) const;
63  const edm::PSimHitContainer& hitsInChamber(unsigned int) const;
64  const edm::PSimHitContainer& hitsInSuperChamber(unsigned int) const;
65 
68  int nLayersWithHitsInSuperChamber(unsigned int) const;
69 
71  int nPadsWithHits() const;
73  int nCoincidencePadsWithHits() const;
74 
77 
79  float simHitsMeanStrip(const edm::PSimHitContainer& sim_hits) const;
80 
81  std::set<int> hitStripsInDetId(unsigned int, int margin_n_strips = 0) const; // GEM or CSC
82  std::set<int> hitPadsInDetId(unsigned int) const; // GEM
83  std::set<int> hitCoPadsInDetId(unsigned int) const; // GEM coincidence pads with hits
84 
85  // what unique partitions numbers were hit by this simtrack?
86  std::set<int> hitPartitions() const; // GEM
87 
88 private:
89  void init(const edm::Event&);
90  const SimTrack& track_;
91  std::vector<unsigned int> getIdsOfSimTrackShower(unsigned trk_id,
94 
95  void matchSimHitsToSimTrack(std::vector<unsigned int> track_ids, const edm::PSimHitContainer& gem_hits);
96 
99  bool verbose_;
101 
105 
107  std::map<unsigned int, unsigned int> trkid_to_index_;
108 
111  std::map<unsigned int, edm::PSimHitContainer> gem_detid_to_hits_;
112  std::map<unsigned int, edm::PSimHitContainer> gem_chamber_to_hits_;
113  std::map<unsigned int, edm::PSimHitContainer> gem_superchamber_to_hits_;
114 
115  // detids with hits in pads
116  std::map<unsigned int, std::set<int> > gem_detids_to_pads_;
117  // detids with hits in 2-layer pad coincidences
118  std::map<unsigned int, std::set<int> > gem_detids_to_copads_;
119 };
120 
121 #endif
std::set< unsigned int > detIdsGEM() const
GEM partitions&#39; detIds with SimHits.
SimHitMatcher(const SimTrack &track, const edm::Event &, const GEMGeometry &geom, const edm::ParameterSet &cfg, edm::EDGetToken &simhitToken, edm::EDGetToken &simtrackToken, edm::EDGetToken &simvertexToken)
const edm::PSimHitContainer & hitsInDetId(unsigned int) const
simhits from a particular partition (GEM)/layer (CSC), chamber or superchamber
float simHitsMeanStrip(const edm::PSimHitContainer &sim_hits) const
calculate average strip (strip for GEM, half-strip for CSC) number for a provided collection of simhi...
int nPadsWithHits() const
How many pads with simhits in GEM did this simtrack get?
edm::Handle< edm::SimTrackContainer > sim_tracks
const edm::PSimHitContainer & hitsInChamber(unsigned int) const
std::set< unsigned int > chamberIdsGEM() const
GEM chamber detIds with SimHits.
std::vector< unsigned int > getIdsOfSimTrackShower(unsigned trk_id, const edm::SimTrackContainer &simTracks, const edm::SimVertexContainer &simVertices)
std::set< int > hitPartitions() const
std::set< int > hitStripsInDetId(unsigned int, int margin_n_strips=0) const
const edm::PSimHitContainer & simHitsGEM() const
access to all the GEM SimHits
Definition: SimHitMatcher.h:45
const SimTrack & track_
Definition: SimHitMatcher.h:90
edm::PSimHitContainer gem_hits_
const GEMGeometry & gem_geo_
bool discardEleHitsGEM_
Definition: SimHitMatcher.h:98
std::map< unsigned int, edm::PSimHitContainer > gem_superchamber_to_hits_
GlobalPoint simHitsMeanPosition(const edm::PSimHitContainer &sim_hits) const
calculate Global average position for a provided collection of simhits
int nCoincidencePadsWithHits() const
How many coincidence pads with simhits in GEM did this simtrack get?
std::set< int > hitPadsInDetId(unsigned int) const
std::set< unsigned int > superChamberIdsGEMCoincidences() const
GEM superchamber detIds with SimHits 2 layers of coincidence pads.
edm::PSimHitContainer no_hits_
std::set< unsigned int > detIdsGEMCoincidences() const
edm::Handle< edm::SimVertexContainer > sim_vertices
std::map< unsigned int, edm::PSimHitContainer > gem_chamber_to_hits_
std::string simInputLabel_
void matchSimHitsToSimTrack(std::vector< unsigned int > track_ids, const edm::PSimHitContainer &gem_hits)
edm::Handle< edm::PSimHitContainer > gem_hits
std::vector< SimVertex > SimVertexContainer
void init(const edm::Event &)
const edm::PSimHitContainer & hitsInSuperChamber(unsigned int) const
std::set< unsigned int > superChamberIdsGEM() const
GEM superchamber detIds with SimHits.
std::map< unsigned int, edm::PSimHitContainer > gem_detid_to_hits_
std::vector< PSimHit > PSimHitContainer
std::map< unsigned int, unsigned int > trkid_to_index_
std::vector< SimTrack > SimTrackContainer
std::set< int > hitCoPadsInDetId(unsigned int) const
std::map< unsigned int, std::set< int > > gem_detids_to_copads_
std::map< unsigned int, std::set< int > > gem_detids_to_pads_
int nLayersWithHitsInSuperChamber(unsigned int) const