CMS 3D CMS Logo

ClusterStorer.h
Go to the documentation of this file.
1 #ifndef RecoAlgos_ClusterStorer_h
2 #define RecoAlgos_ClusterStorer_h
3 
25 
26 namespace helper {
27 
28  class ClusterStorer {
29  public:
34  void clear();
35  //------------------------------------------------------------------
39  //------------------------------------------------------------------
46 
47  private:
49  template <typename ClusterRefType>
51  public:
54  template <typename RecHitType>
56  : detid_(hit.geographicalId().rawId()), hits_(&hits), index_(idx), ref_(hit.cluster()) {}
58  uint32_t detid() const { return detid_; }
60  const ClusterRefType &clusterRef() const { return ref_; }
62  bool operator<(const ClusterHitRecord<ClusterRefType> &other) const {
63  return (detid_ != other.detid_) ? detid_ < other.detid_ : ref_ < other.ref_;
64  }
67  template <typename RecHitType>
68  void rekey(const ClusterRefType &newRef);
69 
70  private:
72  uint32_t detid_;
74  size_t index_;
75  ClusterRefType ref_;
76  };
77 
81  //FIXME:: this is just temporary solution for phase2,
82  //probably is good to add a Phase2ClusterStorer?
84 
85  //------------------------------------------------------------------
88  //------------------------------------------------------------------
89  template <typename HitType, typename ClusterType>
93 
94  //--- Information about the cloned clusters
95  std::vector<PixelClusterHitRecord> pixelClusterRecords_;
96  std::vector<StripClusterHitRecord> stripClusterRecords_;
97  std::vector<Phase2OTClusterHitRecord> phase2OTClusterRecords_;
98  };
99 
100 } // namespace helper
101 
102 #endif
A struct for clusters associated to hits.
Definition: ClusterStorer.h:50
ClusterHitRecord< SiStripRecHit2D::ClusterRef > StripClusterHitRecord
Assuming that the ClusterRef is the same for all SiStripRecHit*:
Definition: ClusterStorer.h:80
Definition: helper.py:1
const ClusterRefType & clusterRef() const
this method is to be able to compare and see if two refs are the same
Definition: ClusterStorer.h:60
void addCluster(TrackingRecHitCollection &hits, size_t index)
add cluster of newHit to list (throws if hit is of unknown type)
uint32_t detid_
private => unusable
Definition: ClusterStorer.h:72
std::vector< Phase2OTClusterHitRecord > phase2OTClusterRecords_
Definition: ClusterStorer.h:97
ClusterHitRecord< SiPixelRecHit::ClusterRef > PixelClusterHitRecord
Definition: ClusterStorer.h:78
void processAllClusters(edmNew::DetSetVector< SiPixelCluster > &pixelDsvToFill, edm::RefProd< edmNew::DetSetVector< SiPixelCluster > > refPixelClusters, edmNew::DetSetVector< SiStripCluster > &stripDsvToFill, edm::RefProd< edmNew::DetSetVector< SiStripCluster > > refStripClusters, edmNew::DetSetVector< Phase2TrackerCluster1D > &phase2OTDsvToFill, edm::RefProd< edmNew::DetSetVector< Phase2TrackerCluster1D > > refPhase2OTClusters)
std::vector< PixelClusterHitRecord > pixelClusterRecords_
Definition: ClusterStorer.h:95
uint32_t detid() const
returns the detid
Definition: ClusterStorer.h:58
ClusterHitRecord< Phase2TrackerRecHit1D::ClusterRef > Phase2OTClusterHitRecord
Definition: ClusterStorer.h:83
ClusterHitRecord(const RecHitType &hit, TrackingRecHitCollection &hits, size_t idx)
Definition: ClusterStorer.h:55
void clear()
clear records
void processClusters(std::vector< ClusterHitRecord< typename HitType::ClusterRef > > &clusterRecords, edmNew::DetSetVector< ClusterType > &dsvToFill, edm::RefProd< edmNew::DetSetVector< ClusterType > > &refprod)
void rekey(const ClusterRefType &newRef)
TrackingRecHitCollection * hits_
Definition: ClusterStorer.h:73
std::vector< StripClusterHitRecord > stripClusterRecords_
Definition: ClusterStorer.h:96