Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 10:06:53

0001 #ifndef Validation_MuonHits_ME0SimHitMatcher_h
0002 #define Validation_MuonHits_ME0SimHitMatcher_h
0003 
0004 /**\class ME0SimHitMatcher
0005 
0006    Description: Matching of ME0 SimHit to SimTrack
0007 
0008    Author: Sven Dildick (TAMU), Tao Huang (TAMU)
0009 */
0010 
0011 #include "FWCore/Utilities/interface/ESGetToken.h"
0012 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0013 #include "Geometry/GEMGeometry/interface/ME0Geometry.h"
0014 #include "Validation/MuonHits/interface/MuonSimHitMatcher.h"
0015 
0016 class ME0SimHitMatcher : public MuonSimHitMatcher {
0017 public:
0018   // constructor
0019   ME0SimHitMatcher(const edm::ParameterSet& iPS, edm::ConsumesCollector&& iC);
0020 
0021   // destructor
0022   ~ME0SimHitMatcher() {}
0023 
0024   // initialize the event
0025   void init(const edm::Event& e, const edm::EventSetup& eventSetup);
0026 
0027   // do the matching
0028   void match(const SimTrack& t, const SimVertex& v);
0029 
0030   // partitions' detIds with SimHits
0031   std::set<unsigned int> detIds() const;
0032 
0033   // chamber detIds with SimHits
0034   std::set<unsigned int> chamberIds() const;
0035 
0036   // ME0 superchamber detIds with SimHits
0037   std::set<unsigned int> superChamberIds() const;
0038 
0039   // simhits from a particular partition, chamber
0040   const edm::PSimHitContainer& hitsInSuperChamber(unsigned int) const;
0041 
0042   // #layers with hits
0043   int nLayersWithHitsInSuperChamber(unsigned int) const;
0044 
0045   // ME0 superchamber detIds with SimHits >=4 layers of coincidence pads
0046   std::set<unsigned int> superChamberIdsCoincidences(int min_n_layers = 4) const;
0047 
0048   // How many ME0 chambers with minimum number of layer with simhits did this
0049   // simtrack get?
0050   int nCoincidenceChambers(int min_n_layers = 4) const;
0051 
0052   // calculate average strip for a provided collection of simhits
0053   float simHitsMeanStrip(const edm::PSimHitContainer& sim_hits) const;
0054 
0055   std::set<int> hitStripsInDetId(unsigned int, int margin_n_strips = 0) const;
0056   std::set<int> hitPadsInDetId(unsigned int) const;
0057 
0058   // what unique partitions numbers were hit by this simtrack?
0059   std::set<int> hitPartitions() const;
0060 
0061   // How many pads with simhits in ME0 did this simtrack get?
0062   int nPadsWithHits() const;
0063 
0064 private:
0065   void matchSimHitsToSimTrack();
0066 
0067   edm::ESGetToken<ME0Geometry, MuonGeometryRecord> geomToken_;
0068 
0069   // detids with hits in pads
0070   std::map<unsigned int, std::set<int> > detids_to_pads_;
0071 
0072   // detids with hits in 2-layer pad coincidences
0073   std::map<unsigned int, std::set<int> > detids_to_copads_;
0074 
0075   std::map<unsigned int, edm::PSimHitContainer> superChamber_to_hits_;
0076 };
0077 
0078 #endif