CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_9/src/SimMuon/MCTruth/interface/DTHitAssociator.h

Go to the documentation of this file.
00001 #ifndef MCTruth_DTHitAssociator_h
00002 #define MCTruth_DTHitAssociator_h
00003 
00004 #include "FWCore/Framework/interface/Event.h"
00005 #include "FWCore/Framework/interface/ESHandle.h"
00006 #include "FWCore/Utilities/interface/InputTag.h"
00007 #include "DataFormats/Common/interface/Handle.h"
00008 #include "SimDataFormats/EncodedEventId/interface/EncodedEventId.h"
00009 #include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h"
00010 #include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h"
00011 #include "DataFormats/DTRecHit/interface/DTRecHitCollection.h"
00012 #include "DataFormats/DTRecHit/interface/DTRecHit1D.h"
00013 #include "DataFormats/MuonDetId/interface/DTWireId.h"
00014 #include "DataFormats/DTDigi/interface/DTDigiCollection.h"
00015 #include "SimDataFormats/DigiSimLinks/interface/DTDigiSimLinkCollection.h"
00016 #include "Geometry/DTGeometry/interface/DTGeometry.h"
00017 
00018 #include <vector>
00019 #include <map>
00020 
00021 class DTHitAssociator {
00022 
00023  public:
00024   typedef std::pair <uint32_t, EncodedEventId> SimHitIdpr;
00025   typedef std::pair<PSimHit,bool> PSimHit_withFlag;
00026   typedef std::map<DTWireId, std::vector<PSimHit_withFlag> > SimHitMap;
00027   typedef std::map<DTWireId, std::vector<DTRecHit1DPair> > RecHitMap;
00028   typedef std::map<DTWireId, std::vector<DTDigi> > DigiMap;
00029   typedef std::map<DTWireId, std::vector<DTDigiSimLink> > LinksMap;
00030 
00031   DTHitAssociator(const edm::Event&, const edm::EventSetup&, const edm::ParameterSet&, bool printRtS); 
00032   virtual ~DTHitAssociator(){}
00033 
00034   std::vector<SimHitIdpr> associateHitId(const TrackingRecHit & hit);
00035   std::vector<SimHitIdpr> associateDTHitId(const DTRecHit1D * dtrechit);
00036   
00037   std::vector<PSimHit> associateHit(const TrackingRecHit & hit);
00038 
00039   SimHitMap mapOfSimHit;
00040   RecHitMap mapOfRecHit;
00041   DigiMap mapOfDigi;
00042   LinksMap mapOfLinks;
00043 
00044  private:
00045   edm::InputTag DTsimhitsTag;
00046   edm::InputTag DTsimhitsXFTag;
00047   edm::InputTag DTdigiTag;
00048   edm::InputTag DTdigisimlinkTag;
00049   edm::InputTag DTrechitTag;
00050   
00051   bool dumpDT;
00052   bool crossingframe;
00053   bool links_exist;
00054   bool associatorByWire;
00055   
00056   bool SimHitOK(const edm::ESHandle<DTGeometry> &, const PSimHit &);
00057   bool printRtS;
00058 
00059 };
00060 
00061 #endif
00062 
00063 
00064