CMS 3D CMS Logo

TrackingRecHitProduct.h
Go to the documentation of this file.
1 #ifndef FastSimulation_TrackingRecHitProducer_TrackingRecHitProduct_H
2 #define FastSimulation_TrackingRecHitProducer_TrackingRecHitProduct_H
3 
5 
8 
9 #include <memory>
10 #include <vector>
11 #include <unordered_map>
12 
14 public:
15  typedef std::pair<unsigned int, const PSimHit*> SimHitIdPair;
16  typedef std::pair<FastSingleTrackerRecHit, std::vector<SimHitIdPair>> RecHitToSimHitIdPairs;
17 
18 protected:
19  const DetId& _detId;
20 
21  std::vector<SimHitIdPair> _simHitsIdPairList;
22 
23  std::vector<RecHitToSimHitIdPairs> _recHits;
24 
25 public:
26  TrackingRecHitProduct(const DetId& detId, std::vector<SimHitIdPair>& simHitsIdPairList)
27  : _detId(detId), _simHitsIdPairList(simHitsIdPairList) {}
28 
29  inline const DetId& getDetId() const { return _detId; }
30 
31  virtual std::vector<SimHitIdPair>& getSimHitIdPairs() { return _simHitsIdPairList; }
32 
33  virtual void addRecHit(const FastSingleTrackerRecHit& recHit, std::vector<SimHitIdPair> simHitIdPairs = {}) {
34  _recHits.push_back(std::make_pair(recHit, simHitIdPairs));
35  for (unsigned int isimhit = 0; isimhit < simHitIdPairs.size(); ++isimhit) {
36  _recHits.back().first.addSimTrackId(simHitIdPairs[isimhit].second->trackId());
37  }
38  }
39 
40  virtual const std::vector<RecHitToSimHitIdPairs>& getRecHitToSimHitIdPairs() const { return _recHits; }
41 
42  virtual unsigned int numberOfRecHits() const { return _recHits.size(); }
43 
45 };
46 
47 typedef std::shared_ptr<TrackingRecHitProduct> TrackingRecHitProductPtr;
48 
49 #endif
TrackingRecHitProduct::getDetId
const DetId & getDetId() const
Definition: TrackingRecHitProduct.h:29
TrackingRecHitProduct::getSimHitIdPairs
virtual std::vector< SimHitIdPair > & getSimHitIdPairs()
Definition: TrackingRecHitProduct.h:31
TrackingRecHitProduct::TrackingRecHitProduct
TrackingRecHitProduct(const DetId &detId, std::vector< SimHitIdPair > &simHitsIdPairList)
Definition: TrackingRecHitProduct.h:26
TrackingRecHitProduct::addRecHit
virtual void addRecHit(const FastSingleTrackerRecHit &recHit, std::vector< SimHitIdPair > simHitIdPairs={})
Definition: TrackingRecHitProduct.h:33
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:215
TrackingRecHitProduct::numberOfRecHits
virtual unsigned int numberOfRecHits() const
Definition: TrackingRecHitProduct.h:42
rpcPointValidation_cfi.recHit
recHit
Definition: rpcPointValidation_cfi.py:7
DetId
Definition: DetId.h:17
PSimHit.h
TrackingRecHitProductPtr
std::shared_ptr< TrackingRecHitProduct > TrackingRecHitProductPtr
Definition: TrackingRecHitProduct.h:47
TrackingRecHitProduct::~TrackingRecHitProduct
virtual ~TrackingRecHitProduct()
Definition: TrackingRecHitProduct.h:44
TrackingRecHitProduct::RecHitToSimHitIdPairs
std::pair< FastSingleTrackerRecHit, std::vector< SimHitIdPair > > RecHitToSimHitIdPairs
Definition: TrackingRecHitProduct.h:16
FastSingleTrackerRecHit.h
FastSingleTrackerRecHit
Definition: FastSingleTrackerRecHit.h:7
TrackingRecHitProduct::getRecHitToSimHitIdPairs
virtual const std::vector< RecHitToSimHitIdPairs > & getRecHitToSimHitIdPairs() const
Definition: TrackingRecHitProduct.h:40
TrackingRecHitProduct::_recHits
std::vector< RecHitToSimHitIdPairs > _recHits
Definition: TrackingRecHitProduct.h:23
TrackingRecHitProduct::_detId
const DetId & _detId
Definition: TrackingRecHitProduct.h:19
DetId.h
TrackingRecHitProduct
Definition: TrackingRecHitProduct.h:13
TrackingRecHitProduct::SimHitIdPair
std::pair< unsigned int, const PSimHit * > SimHitIdPair
Definition: TrackingRecHitProduct.h:15
TrackingRecHitProduct::_simHitsIdPairList
std::vector< SimHitIdPair > _simHitsIdPairList
Definition: TrackingRecHitProduct.h:21