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
SimVertex
Definition: SimVertex.h:5
GEMSimHitMatcher::nLayersWithHitsInSuperChamber
int nLayersWithHitsInSuperChamber(unsigned int) const
Definition: GEMSimHitMatcher.cc:225
GEMSimHitMatcher::superChamberIdsCoincidences
std::set< unsigned int > superChamberIdsCoincidences() const
Definition: GEMSimHitMatcher.cc:205
GEMSimHitMatcher::detIdsCoincidences
std::set< unsigned int > detIdsCoincidences() const
Definition: GEMSimHitMatcher.cc:177
GEMSimHitMatcher::init
void init(const edm::Event &e, const edm::EventSetup &eventSetup)
initialize the event
Definition: GEMSimHitMatcher.cc:17
findQualityFiles.v
v
Definition: findQualityFiles.py:179
GEMSimHitMatcher::nCoincidencePadsWithHits
int nCoincidencePadsWithHits() const
Definition: GEMSimHitMatcher.cc:343
ESGetToken.h
MuonSimHitMatcher.h
GEMSimHitMatcher::hitStripsInDetId
std::set< int > hitStripsInDetId(unsigned int, int margin_n_strips=1) const
Definition: GEMSimHitMatcher.cc:290
GEMSimHitMatcher::hitStation
bool hitStation(int, int) const
Definition: GEMSimHitMatcher.cc:235
GEMSimHitMatcher::superChamberIds
std::set< unsigned int > superChamberIds() const
Definition: GEMSimHitMatcher.cc:198
GEMSimHitMatcher::hitCoPadsInDetId
std::set< int > hitCoPadsInDetId(unsigned int) const
Definition: GEMSimHitMatcher.cc:316
GEMSimHitMatcher::hitPartitions
std::set< int > hitPartitions() const
Definition: GEMSimHitMatcher.cc:323
GEMSimHitMatcher::GEMSimHitMatcher
GEMSimHitMatcher(const edm::ParameterSet &iPS, edm::ConsumesCollector &&iC)
Definition: GEMSimHitMatcher.cc:5
GEMSimHitMatcher::nStations
int nStations(int nl=2) const
Definition: GEMSimHitMatcher.cc:250
GEMSimHitMatcher::detIds
std::set< unsigned int > detIds(int gem_type=MuonHitHelper::GEM_ALL) const
Definition: GEMSimHitMatcher.cc:163
edm::ParameterSet
Definition: ParameterSet.h:47
GEMSimHitMatcher::simHitsMeanStrip
float simHitsMeanStrip(const edm::PSimHitContainer &sim_hits) const
Definition: GEMSimHitMatcher.cc:273
MuonSimHitMatcher
Definition: MuonSimHitMatcher.h:32
GEMSimHitMatcher
Definition: GEMSimHitMatcher.h:16
edm::EventSetup
Definition: EventSetup.h:58
GEMSimHitMatcher::superchamber_to_hits_
std::map< unsigned int, edm::PSimHitContainer > superchamber_to_hits_
Definition: GEMSimHitMatcher.h:84
edm::ESGetToken< GEMGeometry, MuonGeometryRecord >
GEMGeometry.h
SimTrack
Definition: SimTrack.h:9
GEMSimHitMatcher::detids_to_copads_
std::map< unsigned int, std::set< int > > detids_to_copads_
Definition: GEMSimHitMatcher.h:90
GEMSimHitMatcher::matchSimHitsToSimTrack
void matchSimHitsToSimTrack()
Definition: GEMSimHitMatcher.cc:63
GEMSimHitMatcher::simHitsGEMCentralPosition
float simHitsGEMCentralPosition(const edm::PSimHitContainer &sim_hits) const
Definition: GEMSimHitMatcher.cc:252
GEMSimHitMatcher::hitPadsInDetId
std::set< int > hitPadsInDetId(unsigned int) const
Definition: GEMSimHitMatcher.cc:309
MuonHitHelper::GEM_ALL
Definition: MuonHitHelper.h:30
edm::PSimHitContainer
std::vector< PSimHit > PSimHitContainer
Definition: PSimHitContainer.h:11
GEMSimHitMatcher::chamberIds
std::set< unsigned int > chamberIds(int gem_type=MuonHitHelper::GEM_ALL) const
Definition: GEMSimHitMatcher.cc:184
MuonGeometryRecord.h
GEMSimHitMatcher::clear
void clear()
Definition: GEMSimHitMatcher.cc:352
GEMSimHitMatcher::hitsInSuperChamber
const edm::PSimHitContainer & hitsInSuperChamber(unsigned int) const
Definition: GEMSimHitMatcher.cc:214
edm::Event
Definition: Event.h:73
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
GEMSimHitMatcher::nPadsWithHits
int nPadsWithHits() const
Definition: GEMSimHitMatcher.cc:334
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
GEMSimHitMatcher::geomToken_
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > geomToken_
Definition: GEMSimHitMatcher.h:82
GEMSimHitMatcher::detids_to_pads_
std::map< unsigned int, std::set< int > > detids_to_pads_
Definition: GEMSimHitMatcher.h:87
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
GEMSimHitMatcher::match
void match(const SimTrack &t, const SimVertex &v)
do the matching
Definition: GEMSimHitMatcher.cc:23
GEMSimHitMatcher::~GEMSimHitMatcher
~GEMSimHitMatcher()
Definition: GEMSimHitMatcher.h:22