00001 #ifndef MCTruth_MuonTruth_h 00002 #define MCTruth_MuonTruth_h 00003 00004 #include "DataFormats/CSCRecHit/interface/CSCRecHit2D.h" 00005 #include "DataFormats/CSCDigi/interface/CSCStripDigi.h" 00006 #include "DataFormats/CSCDigi/interface/CSCWireDigi.h" 00007 #include "SimDataFormats/Track/interface/SimTrackContainer.h" 00008 #include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h" 00009 #include "FWCore/Framework/interface/Event.h" 00010 #include "FWCore/Framework/interface/EventSetup.h" 00011 #include "DataFormats/Common/interface/DetSetVector.h" 00012 #include "SimDataFormats/TrackerDigiSimLink/interface/StripDigiSimLink.h" 00013 #include "SimMuon/MCTruth/interface/PSimHitMap.h" 00014 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00015 #include "FWCore/ParameterSet/interface/InputTag.h" 00016 #include "SimDataFormats/CrossingFrame/interface/CrossingFrame.h" 00017 #include "SimDataFormats/CrossingFrame/interface/MixCollection.h" 00018 #include "Geometry/CSCGeometry/interface/CSCGeometry.h" 00019 #include "Geometry/CSCGeometry/interface/CSCLayerGeometry.h" 00020 00021 class MuonTruth 00022 { 00023 public: 00024 typedef edm::DetSetVector<StripDigiSimLink> DigiSimLinks; 00025 typedef edm::DetSetVector<StripDigiSimLink> WireDigiSimLinks; 00026 typedef edm::DetSet<StripDigiSimLink> LayerLinks; 00027 typedef std::pair <uint32_t, EncodedEventId> SimHitIdpr; 00028 00029 MuonTruth(const edm::ParameterSet&); 00030 00031 void eventSetup(const edm::Event & event, const edm::EventSetup & setup); 00032 00033 void analyze(const CSCRecHit2D & recHit); 00034 void analyze(const CSCStripDigi & stripDigi, int rawDetIdCorrespondingToCSCLayer); 00035 void analyze(const CSCWireDigi & wireDigi , int rawDetIdCorrespondingToCSCLayer); 00036 00038 float muonFraction(); 00039 00040 std::vector<PSimHit> muonHits(); 00041 00042 std::vector<PSimHit> simHits(); 00043 00044 std::vector<SimHitIdpr> associateHitId(const TrackingRecHit &); 00045 00046 private: 00047 00048 std::vector<PSimHit> hitsFromSimTrack(int simTrack); 00049 // goes to SimHits for information 00050 int particleType(int simTrack); 00051 00052 void addChannel(const LayerLinks &layerLinks, int channel, float weight=1.); 00053 00054 std::map<int, float> theChargeMap; 00055 float theTotalCharge; 00056 int theDetId; 00057 00058 const MixCollection<SimTrack> * theSimTracks; 00059 00060 const DigiSimLinks * theDigiSimLinks; 00061 const DigiSimLinks * theWireDigiSimLinks; 00062 00063 PSimHitMap theSimHitMap; 00064 00065 edm::InputTag simTracksXFTag; 00066 edm::InputTag linksTag; 00067 edm::InputTag wireLinksTag; 00068 00069 const CSCGeometry* cscgeom; 00070 }; 00071 00072 #endif 00073