Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-09-05 22:26:25

0001 #ifndef MCTruth_CSCHitAssociator_h
0002 #define MCTruth_CSCHitAssociator_h
0003 
0004 #include "CondFormats/CSCObjects/interface/CSCBadChambers.h"
0005 #include "CondFormats/DataRecord/interface/CSCBadChambersRcd.h"
0006 #include "DataFormats/CSCDigi/interface/CSCStripDigi.h"
0007 #include "DataFormats/CSCDigi/interface/CSCWireDigi.h"
0008 #include "DataFormats/CSCRecHit/interface/CSCRecHit2D.h"
0009 #include "DataFormats/Common/interface/DetSetVector.h"
0010 #include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h"
0011 #include "FWCore/Framework/interface/ConsumesCollector.h"
0012 #include "FWCore/Framework/interface/Event.h"
0013 #include "FWCore/Framework/interface/EventSetup.h"
0014 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0015 #include "FWCore/Utilities/interface/InputTag.h"
0016 #include "Geometry/CSCGeometry/interface/CSCGeometry.h"
0017 #include "Geometry/CSCGeometry/interface/CSCLayerGeometry.h"
0018 #include "SimDataFormats/CrossingFrame/interface/CrossingFrame.h"
0019 #include "SimDataFormats/CrossingFrame/interface/MixCollection.h"
0020 #include "SimDataFormats/Track/interface/SimTrackContainer.h"
0021 #include "SimDataFormats/TrackerDigiSimLink/interface/StripDigiSimLink.h"
0022 #include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h"
0023 
0024 class MuonGeometryRecord;
0025 
0026 class CSCHitAssociator {
0027 public:
0028   typedef edm::DetSetVector<StripDigiSimLink> DigiSimLinks;
0029   typedef edm::DetSetVector<StripDigiSimLink> WireDigiSimLinks;
0030   typedef edm::DetSet<StripDigiSimLink> LayerLinks;
0031   typedef std::pair<uint32_t, EncodedEventId> SimHitIdpr;
0032 
0033   class Config {
0034   public:
0035     Config(const edm::ParameterSet &, edm::ConsumesCollector iC);
0036 
0037   private:
0038     friend class CSCHitAssociator;
0039     const edm::InputTag linksTag_;
0040     const edm::EDGetTokenT<DigiSimLinks> linksToken_;
0041     const edm::ESGetToken<CSCGeometry, MuonGeometryRecord> geomToken_;
0042   };
0043 
0044   CSCHitAssociator(const edm::Event &, const edm::EventSetup &, const Config &);
0045 
0046   std::vector<SimHitIdpr> associateHitId(const TrackingRecHit &) const;
0047   std::vector<SimHitIdpr> associateCSCHitId(const CSCRecHit2D *) const;
0048 
0049 private:
0050   void initEvent(const edm::Event &, const edm::EventSetup &);
0051 
0052   const Config &theConfig;
0053   const DigiSimLinks *theDigiSimLinks;
0054 
0055   const CSCGeometry *cscgeom;
0056 };
0057 
0058 #endif