Go to the documentation of this file.00001 #ifndef TrackerHitAssociator_h
00002 #define TrackerHitAssociator_h
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "FWCore/Framework/interface/EDAnalyzer.h"
00020 #include "FWCore/Framework/interface/Event.h"
00021 #include "FWCore/Framework/interface/EventSetup.h"
00022 #include "DataFormats/Common/interface/Handle.h"
00023 #include "FWCore/Framework/interface/ESHandle.h"
00024 #include "FWCore/Framework/interface/MakerMacros.h"
00025
00026
00027 #include "SimDataFormats/TrackingHit/interface/PSimHit.h"
00028 #include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h"
00029
00030 #include "DataFormats/Common/interface/DetSetVector.h"
00031 #include "DataFormats/SiPixelDigi/interface/PixelDigi.h"
00032 #include "SimDataFormats/TrackerDigiSimLink/interface/PixelDigiSimLink.h"
00033 #include "SimDataFormats/TrackerDigiSimLink/interface/StripDigiSimLink.h"
00034
00035
00036 #include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h"
00037 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHit.h"
00038 #include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHit.h"
00039 #include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2D.h"
00040 #include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit1D.h"
00041 #include "DataFormats/TrackerRecHit2D/interface/SiStripMatchedRecHit2D.h"
00042 #include "DataFormats/TrackerRecHit2D/interface/ProjectedSiStripRecHit2D.h"
00043 #include "DataFormats/TrackerRecHit2D/interface/SiTrackerGSRecHit2D.h"
00044 #include "DataFormats/TrackerRecHit2D/interface/SiTrackerMultiRecHit.h"
00045 #include "DataFormats/TrackerRecHit2D/interface/SiTrackerGSMatchedRecHit2D.h"
00046
00047 #include "SimDataFormats/CrossingFrame/interface/MixCollection.h"
00048
00049 #include <string>
00050 #include <vector>
00051
00052 typedef std::pair<uint32_t, EncodedEventId> SimHitIdpr;
00053
00054 class TrackerHitAssociator {
00055
00056 public:
00057
00058
00059 TrackerHitAssociator(const edm::Event& e);
00060
00061 TrackerHitAssociator(const edm::Event& e, const edm::ParameterSet& conf);
00062
00063 virtual ~TrackerHitAssociator(){}
00064
00065 std::vector<PSimHit> associateHit(const TrackingRecHit & thit);
00066
00067
00068
00069
00070
00071
00072 std::vector<SimHitIdpr> associateHitId(const TrackingRecHit & thit);
00073 void associateHitId(const TrackingRecHit & thit,std::vector<SimHitIdpr> &simhitid);
00074
00075 void associateSimpleRecHit(const SiStripRecHit2D * simplerechit,std::vector<SimHitIdpr> & simhitid);
00076 void associateSiStripRecHit1D(const SiStripRecHit1D * simplerechit,std::vector<SimHitIdpr> & simhitid);
00077 void associateSimpleRecHitCluster(const SiStripCluster* clust,
00078 const uint32_t& detID,
00079 std::vector<SimHitIdpr>& theSimtrackid,
00080 std::vector<PSimHit>& simhit);
00081 void associateSimpleRecHitCluster(const SiStripCluster* clust,
00082 const uint32_t& detID,
00083 std::vector<PSimHit>& simhit);
00084 void associateSimpleRecHitCluster(const SiStripCluster* clust,
00085 const uint32_t& detID,
00086 std::vector<SimHitIdpr>& simtrackid);
00087
00088 std::vector<SimHitIdpr> associateMatchedRecHit(const SiStripMatchedRecHit2D * matchedrechit);
00089 std::vector<SimHitIdpr> associateProjectedRecHit(const ProjectedSiStripRecHit2D * projectedrechit);
00090
00091 void associatePixelRecHit(const SiPixelRecHit * pixelrechit, std::vector<SimHitIdpr> & simhitid);
00092 std::vector<SimHitIdpr> associateGSRecHit(const SiTrackerGSRecHit2D * gsrechit);
00093 std::vector<SimHitIdpr> associateMultiRecHitId(const SiTrackerMultiRecHit * multirechit);
00094 std::vector<PSimHit> associateMultiRecHit(const SiTrackerMultiRecHit * multirechit);
00095 std::vector<SimHitIdpr> associateGSMatchedRecHit(const SiTrackerGSMatchedRecHit2D * gsmrechit);
00096
00097 std::vector<PSimHit> theStripHits;
00098 typedef std::map<unsigned int, std::vector<PSimHit> > simhit_map;
00099 typedef simhit_map::iterator simhit_map_iterator;
00100 simhit_map SimHitMap;
00101 std::vector<PSimHit> thePixelHits;
00102
00103 private:
00104 const edm::Event& myEvent_;
00105 typedef std::vector<std::string> vstring;
00106 vstring trackerContainers;
00107
00108
00109 edm::Handle<CrossingFrame<PSimHit> > cf_simhit;
00110 std::vector<const CrossingFrame<PSimHit> *> cf_simhitvec;
00111 MixCollection<PSimHit> TrackerHits;
00112
00113 edm::Handle< edm::DetSetVector<StripDigiSimLink> > stripdigisimlink;
00114 edm::Handle< edm::DetSetVector<PixelDigiSimLink> > pixeldigisimlink;
00115
00116
00117 std::vector<SimHitIdpr> simtrackid;
00118
00119 std::vector<int> simhitCFPos;
00120 std::vector<PSimHit> simhitassoc;
00121 bool StripHits;
00122
00123 bool doPixel_, doStrip_, doTrackAssoc_;
00124
00125 };
00126
00127
00128 #endif
00129