CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrackerHitAssociator.h
Go to the documentation of this file.
1 #ifndef TrackerHitAssociator_h
2 #define TrackerHitAssociator_h
3 
4 /* \class TrackerHitAssociator
5  *
6  ** Associates SimHits and RecHits based on information produced during
7  * digitisation (StripDigiSimLinks).
8  * The association works in both ways: from a SimHit to RecHits and
9  * from a RecHit to SimHits.
10  *
11  * \author Patrizia Azzi (INFN PD), Vincenzo Chiochia (Uni Zuerich)
12  *
13  * \version 1st version: April 2006. Add configurable switch: August 2006
14  *
15  *
16  ************************************************************/
17 
18 //#include <vector>
26 
27 //--- for SimHit
30 
35 
36 //--- for RecHit
47 
49 
50 #include <string>
51 #include <vector>
52 
53 typedef std::pair<uint32_t, EncodedEventId> SimHitIdpr;
54 
56 
57  public:
58 
59  // Constructor for consumes.. it can be better..eg, this should replace the other constructors
60  // but there are too many consts
61  // in all the wrong places
63  // Simple constructor
65  // Constructor with configurables
66  TrackerHitAssociator(const edm::Event& e, const edm::ParameterSet& conf);
67  // Destructor
69 
70  typedef std::pair<unsigned int, unsigned int> simHitCollectionID;
71  typedef std::pair<simHitCollectionID, unsigned int> simhitAddr;
72 
73  std::vector<PSimHit> associateHit(const TrackingRecHit & thit) const;
74  //for PU events
75  std::vector<SimHitIdpr> associateHitId(const TrackingRecHit & thit) const;
76  void associateHitId(const TrackingRecHit & thit,std::vector<SimHitIdpr> &simhitid, std::vector<simhitAddr>* simhitCFPos=0) const;
77  template<typename T>
78  void associateSiStripRecHit(const T *simplerechit, std::vector<SimHitIdpr>& simtrackid, std::vector<simhitAddr>* simhitCFPos=0) const;
79 
80  // Method for obtaining simTracks and simHits from a cluster
81  void associateCluster(const SiStripCluster* clust,
82  const DetId& detid,
83  std::vector<SimHitIdpr>& simtrackid, std::vector<PSimHit>& simhit) const;
84 
85  // Obtain simTracks, and optionally simHit addresses, from a cluster
87  const DetId& detid,
88  std::vector<SimHitIdpr>& simtrackid, std::vector<simhitAddr>* simhitCFPos=0) const;
89 
90  std::vector<SimHitIdpr> associateMatchedRecHit(const SiStripMatchedRecHit2D * matchedrechit, std::vector<simhitAddr>* simhitCFPos=0) const;
91  std::vector<SimHitIdpr> associateProjectedRecHit(const ProjectedSiStripRecHit2D * projectedrechit, std::vector<simhitAddr>* simhitCFPos=0) const;
92  void associatePixelRecHit(const SiPixelRecHit * pixelrechit, std::vector<SimHitIdpr> & simhitid, std::vector<simhitAddr>* simhitCFPos=0) const;
93  std::vector<SimHitIdpr> associateGSRecHit(const SiTrackerGSRecHit2D * gsrechit) const;
94  std::vector<SimHitIdpr> associateMultiRecHitId(const SiTrackerMultiRecHit * multirechit, std::vector<simhitAddr>* simhitCFPos=0) const;
95  std::vector<PSimHit> associateMultiRecHit(const SiTrackerMultiRecHit * multirechit) const;
96  std::vector<SimHitIdpr> associateGSMatchedRecHit(const SiTrackerGSMatchedRecHit2D * gsmrechit) const;
97 
98  typedef std::map<unsigned int, std::vector<PSimHit> > simhit_map;
100  typedef std::map<simHitCollectionID, std::vector<PSimHit> > simhit_collectionMap;
102 
103  private:
104  typedef std::vector<std::string> vstring;
105 
106  void makeMaps(const edm::Event& theEvent, const vstring trackerContainers);
107 
110 
112 
113 };
114 
115 
116 #endif
117 
std::vector< SimHitIdpr > associateMultiRecHitId(const SiTrackerMultiRecHit *multirechit, std::vector< simhitAddr > *simhitCFPos=0) const
edm::Handle< edm::DetSetVector< StripDigiSimLink > > stripdigisimlink
std::vector< PSimHit > associateMultiRecHit(const SiTrackerMultiRecHit *multirechit) const
std::vector< std::string > vstring
std::pair< simHitCollectionID, unsigned int > simhitAddr
void associatePixelRecHit(const SiPixelRecHit *pixelrechit, std::vector< SimHitIdpr > &simhitid, std::vector< simhitAddr > *simhitCFPos=0) const
std::map< unsigned int, std::vector< PSimHit > > simhit_map
edm::Handle< edm::DetSetVector< PixelDigiSimLink > > pixeldigisimlink
void associateSimpleRecHitCluster(const SiStripCluster *clust, const DetId &detid, std::vector< SimHitIdpr > &simtrackid, std::vector< simhitAddr > *simhitCFPos=0) const
std::vector< SimHitIdpr > associateGSMatchedRecHit(const SiTrackerGSMatchedRecHit2D *gsmrechit) const
tuple conf
Definition: dbtoconf.py:185
TrackerHitAssociator(const edm::ParameterSet &conf, edm::ConsumesCollector &&iC)
simhit_collectionMap SimHitCollMap
Definition: DetId.h:18
void makeMaps(const edm::Event &theEvent, const vstring trackerContainers)
void associateCluster(const SiStripCluster *clust, const DetId &detid, std::vector< SimHitIdpr > &simtrackid, std::vector< PSimHit > &simhit) const
std::pair< uint32_t, EncodedEventId > SimHitIdpr
std::map< simHitCollectionID, std::vector< PSimHit > > simhit_collectionMap
std::vector< SimHitIdpr > associateHitId(const TrackingRecHit &thit) const
std::vector< SimHitIdpr > associateProjectedRecHit(const ProjectedSiStripRecHit2D *projectedrechit, std::vector< simhitAddr > *simhitCFPos=0) const
std::vector< PSimHit > associateHit(const TrackingRecHit &thit) const
std::vector< SimHitIdpr > associateGSRecHit(const SiTrackerGSRecHit2D *gsrechit) const
long double T
std::vector< SimHitIdpr > associateMatchedRecHit(const SiStripMatchedRecHit2D *matchedrechit, std::vector< simhitAddr > *simhitCFPos=0) const
void associateSiStripRecHit(const T *simplerechit, std::vector< SimHitIdpr > &simtrackid, std::vector< simhitAddr > *simhitCFPos=0) const
std::pair< unsigned int, unsigned int > simHitCollectionID
Our base class.
Definition: SiPixelRecHit.h:23