Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:32:51

0001 #ifndef Validation_MuonHits_CSCSimHitMatcher_h
0002 #define Validation_MuonHits_CSCSimHitMatcher_h
0003 
0004 /**\class CSCSimHitMatcher
0005 
0006    Description: Matching of CSC 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/CSCGeometry/interface/CSCGeometry.h"
0014 #include "Validation/MuonHits/interface/MuonSimHitMatcher.h"
0015 
0016 class CSCSimHitMatcher : public MuonSimHitMatcher {
0017 public:
0018   // constructor
0019   CSCSimHitMatcher(const edm::ParameterSet& iPS, edm::ConsumesCollector&& iC);
0020 
0021   // destructor
0022   ~CSCSimHitMatcher() {}
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(int type = MuonHitHelper::CSC_ALL) const;
0032 
0033   // chamber detIds with SimHits
0034   std::set<unsigned int> chamberIds(int type = MuonHitHelper::CSC_ALL) const;
0035 
0036   // CSC station detIds with SimHits
0037   std::set<unsigned int> chamberIdsStation(int station) const;
0038 
0039   // was there a hit in a particular CSC station?
0040   bool hitStation(int, int) const;
0041 
0042   // number of stations with hits in at least X layers
0043   int nStations(int nl = 4) const;
0044 
0045   // #layers with hits
0046   int nLayersWithHitsInChamber(unsigned int) const;
0047 
0048   // How many CSC chambers with minimum number of layer with simhits did this
0049   // simtrack get?
0050   int nCoincidenceChambers(int min_n_layers = 4) const;
0051 
0052   // calculated the fitted position in a given layer for CSC simhits in a
0053   // chamber
0054   GlobalPoint simHitPositionKeyLayer(unsigned int chamberid) const;
0055 
0056   // local bending in a CSC chamber
0057   float LocalBendingInChamber(unsigned int detid) const;
0058   void fitHitsInChamber(unsigned int detid, float& mean, float& slope) const;
0059 
0060   // calculate average strip number for a provided collection of simhits
0061   float simHitsMeanStrip(const edm::PSimHitContainer& sim_hits) const;
0062 
0063   // calculate average wg number for a provided collection of simhits (for CSC)
0064   float simHitsMeanWG(const edm::PSimHitContainer& sim_hits) const;
0065 
0066   void chamberIdsToString(const std::set<unsigned int>& set) const;
0067 
0068   // calculate the average position at the second station
0069   GlobalPoint simHitsMeanPositionStation(int n) const;
0070 
0071   std::set<int> hitStripsInDetId(unsigned int, int margin_n_strips = 0) const;
0072   std::set<int> hitWiregroupsInDetId(unsigned int, int margin_n_wg = 0) const;
0073 
0074   void camberIdsToString(const std::set<unsigned int>&) const;
0075 
0076 private:
0077   void matchSimHitsToSimTrack();
0078 
0079   void clear();
0080 
0081   edm::ESGetToken<CSCGeometry, MuonGeometryRecord> geomToken_;
0082 };
0083 
0084 #endif