test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ClusterStorer.h
Go to the documentation of this file.
1 #ifndef RecoAlgos_ClusterStorer_h
2 #define RecoAlgos_ClusterStorer_h
3 
23 
24 namespace helper {
25 
26  class ClusterStorer {
27  public:
30  void addCluster(TrackingRecHitCollection &hits, size_t index);
32  void clear();
33  //------------------------------------------------------------------
37  //------------------------------------------------------------------
42 
43  private:
45  template<typename ClusterRefType>
47  public:
50  template<typename RecHitType>
52  : detid_(hit.geographicalId().rawId()), hits_(&hits), index_(idx), ref_(hit.cluster()) {}
54  uint32_t detid() const { return detid_; }
56  const ClusterRefType & clusterRef() const { return ref_; }
58  bool operator<(const ClusterHitRecord<ClusterRefType> &other) const
59  {
60  return (detid_ != other.detid_) ? detid_ < other.detid_ : ref_ < other.ref_;
61  }
64  template <typename RecHitType>
65  void rekey(const ClusterRefType &newRef) const;
66  private:
68  uint32_t detid_;
70  size_t index_;
71  ClusterRefType ref_;
72  };
73 
77 
78  //------------------------------------------------------------------
81  //------------------------------------------------------------------
82  template<typename HitType, typename ClusterType>
83  void
87 
88  //--- Information about the cloned clusters
89  std::vector<PixelClusterHitRecord> pixelClusterRecords_;
90  std::vector<StripClusterHitRecord> stripClusterRecords_;
91  };
92 
93 }
94 
95 #endif
A struct for clusters associated to hits.
Definition: ClusterStorer.h:46
ClusterHitRecord< SiStripRecHit2D::ClusterRef > StripClusterHitRecord
Assuming that the ClusterRef is the same for all SiStripRecHit*:
Definition: ClusterStorer.h:76
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:56
uint32_t detid_
private =&gt; unusable
Definition: ClusterStorer.h:68
ClusterHitRecord< SiPixelRecHit::ClusterRef > PixelClusterHitRecord
Definition: ClusterStorer.h:74
std::vector< PixelClusterHitRecord > pixelClusterRecords_
Definition: ClusterStorer.h:89
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
ClusterHitRecord(const RecHitType &hit, TrackingRecHitCollection &hits, size_t idx)
Definition: ClusterStorer.h:51
uint32_t detid() const
returns the detid
Definition: ClusterStorer.h:54
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:69
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:90