CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ClusterStorer.h
Go to the documentation of this file.
1 #ifndef RecoAlgos_ClusterStorer_h
2 #define RecoAlgos_ClusterStorer_h
3 
24 
25 namespace helper {
26 
27  class ClusterStorer {
28  public:
31  void addCluster(TrackingRecHitCollection &hits, size_t index);
33  void clear();
34  //------------------------------------------------------------------
38  //------------------------------------------------------------------
43 
44  private:
46  template <typename ClusterRefType>
48  public:
51  template <typename RecHitType>
53  : detid_(hit.geographicalId().rawId()), hits_(&hits), index_(idx), ref_(hit.cluster()) {}
55  uint32_t detid() const { return detid_; }
57  const ClusterRefType &clusterRef() const { return ref_; }
59  bool operator<(const ClusterHitRecord<ClusterRefType> &other) const {
60  return (detid_ != other.detid_) ? detid_ < other.detid_ : ref_ < other.ref_;
61  }
64  template <typename RecHitType>
65  void rekey(const ClusterRefType &newRef) const;
66 
67  private:
69  uint32_t detid_;
71  size_t index_;
72  ClusterRefType ref_;
73  };
74 
78  //FIXME:: this is just temporary solution for phase2,
79  //probably is good to add a Phase2ClusterStorer?
81 
82  //------------------------------------------------------------------
85  //------------------------------------------------------------------
86  template <typename HitType, typename ClusterType>
90 
91  //--- Information about the cloned clusters
92  std::vector<PixelClusterHitRecord> pixelClusterRecords_;
93  std::vector<StripClusterHitRecord> stripClusterRecords_;
94  std::vector<Phase2OTClusterHitRecord> phase2OTClusterRecords_;
95  };
96 
97 } // namespace helper
98 
99 #endif
A struct for clusters associated to hits.
Definition: ClusterStorer.h:47
ClusterHitRecord< SiStripRecHit2D::ClusterRef > StripClusterHitRecord
Assuming that the ClusterRef is the same for all SiStripRecHit*:
Definition: ClusterStorer.h:77
void rekey(const ClusterRefType &newRef) const
void addCluster(TrackingRecHitCollection &hits, size_t index)
add cluster of newHit to list (throws if hit is of unknown type)
const ClusterRefType & clusterRef() const
this method is to be able to compare and see if two refs are the same
Definition: ClusterStorer.h:57
ClusterHitRecord< Phase2TrackerRecHit1D::CluRef > Phase2OTClusterHitRecord
Definition: ClusterStorer.h:80
uint32_t detid_
private =&gt; unusable
Definition: ClusterStorer.h:69
std::vector< Phase2OTClusterHitRecord > phase2OTClusterRecords_
Definition: ClusterStorer.h:94
ClusterHitRecord< SiPixelRecHit::ClusterRef > PixelClusterHitRecord
Definition: ClusterStorer.h:75
std::vector< PixelClusterHitRecord > pixelClusterRecords_
Definition: ClusterStorer.h:92
ClusterHitRecord(const RecHitType &hit, TrackingRecHitCollection &hits, size_t idx)
Definition: ClusterStorer.h:52
uint32_t detid() const
returns the detid
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)
TrackingRecHitCollection * hits_
Definition: ClusterStorer.h:70
void processAllClusters(edmNew::DetSetVector< SiPixelCluster > &pixelDsvToFill, edm::RefProd< edmNew::DetSetVector< SiPixelCluster > > refPixelClusters, edmNew::DetSetVector< SiStripCluster > &stripDsvToFill, edm::RefProd< edmNew::DetSetVector< SiStripCluster > > refStripClusters)
std::vector< StripClusterHitRecord > stripClusterRecords_
Definition: ClusterStorer.h:93