CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
helper::ClusterStorer::ClusterHitRecord< ClusterRefType > Class Template Reference

A struct for clusters associated to hits. More...

Public Member Functions

template<typename RecHitType >
 ClusterHitRecord (const RecHitType &hit, TrackingRecHitCollection &hits, size_t idx)
 
const ClusterRefType & clusterRef () const
 this method is to be able to compare and see if two refs are the same More...
 
uint32_t detid () const
 returns the detid More...
 
bool operator< (const ClusterHitRecord< ClusterRefType > &other) const
 this one is to sort by detid and then by index of the rechit More...
 
template<typename RecHitType >
void rekey (const ClusterRefType &newRef) const
 

Private Member Functions

 ClusterHitRecord ()
 

Private Attributes

uint32_t detid_
 private => unusable More...
 
TrackingRecHitCollectionhits_
 
size_t index_
 
ClusterRefType ref_
 

Detailed Description

template<typename ClusterRefType>
class helper::ClusterStorer::ClusterHitRecord< ClusterRefType >

A struct for clusters associated to hits.

Definition at line 46 of file ClusterStorer.h.

Constructor & Destructor Documentation

template<typename ClusterRefType >
template<typename RecHitType >
helper::ClusterStorer::ClusterHitRecord< ClusterRefType >::ClusterHitRecord ( const RecHitType &  hit,
TrackingRecHitCollection hits,
size_t  idx 
)
inline

Create a record for a hit with a given index in the TrackingRecHitCollection. 'RecHitType' must have a method 'cluster()' that returns a 'ClusterRefType'.

Definition at line 51 of file ClusterStorer.h.

52  : detid_(hit.geographicalId().rawId()), hits_(&hits), index_(idx), ref_(hit.cluster()) {}
uint32_t detid_
private =&gt; unusable
Definition: ClusterStorer.h:68
TrackingRecHitCollection * hits_
Definition: ClusterStorer.h:69
template<typename ClusterRefType >
helper::ClusterStorer::ClusterHitRecord< ClusterRefType >::ClusterHitRecord ( )
inlineprivate

Definition at line 67 of file ClusterStorer.h.

67 {}

Member Function Documentation

template<typename ClusterRefType >
const ClusterRefType& helper::ClusterStorer::ClusterHitRecord< ClusterRefType >::clusterRef ( ) const
inline

this method is to be able to compare and see if two refs are the same

Definition at line 56 of file ClusterStorer.h.

References helper::ClusterStorer::ClusterHitRecord< ClusterRefType >::ref_.

56 { return ref_; }
template<typename ClusterRefType >
uint32_t helper::ClusterStorer::ClusterHitRecord< ClusterRefType >::detid ( ) const
inline

returns the detid

Definition at line 54 of file ClusterStorer.h.

References helper::ClusterStorer::ClusterHitRecord< ClusterRefType >::detid_.

54 { return detid_; }
uint32_t detid_
private =&gt; unusable
Definition: ClusterStorer.h:68
template<typename ClusterRefType >
bool helper::ClusterStorer::ClusterHitRecord< ClusterRefType >::operator< ( const ClusterHitRecord< ClusterRefType > &  other) const
inline

this one is to sort by detid and then by index of the rechit

Definition at line 58 of file ClusterStorer.h.

References helper::ClusterStorer::ClusterHitRecord< ClusterRefType >::detid_, and helper::ClusterStorer::ClusterHitRecord< ClusterRefType >::ref_.

59  {
60  return (detid_ != other.detid_) ? detid_ < other.detid_ : ref_ < other.ref_;
61  }
uint32_t detid_
private =&gt; unusable
Definition: ClusterStorer.h:68
template<typename ClusterRefType >
template<typename RecHitType >
void helper::ClusterStorer::ClusterHitRecord< ClusterRefType >::rekey ( const ClusterRefType &  newRef) const

Set the reference of the hit of this record to 'newRef', will not modify the ref stored in this object.

Definition at line 141 of file ClusterStorer.cc.

References TrackingRecHit::geographicalId(), and DetId::rawId().

142  {
143  TrackingRecHit & genericHit = (*hits_)[index_];
144  RecHitType *hit = 0;
145  if (genericHit.geographicalId().rawId() == detid_) { // a hit on this det, so it's simple
146  hit = dynamic_cast<RecHitType *>(&genericHit); //static_cast<RecHitType *>(&genericHit);
147  }
148  assert (hit != 0);
149  assert (hit->cluster() == ref_); // otherwise something went wrong
150  hit->setClusterRef(newRef);
151  }
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
uint32_t detid_
private =&gt; unusable
Definition: ClusterStorer.h:68
DetId geographicalId() const

Member Data Documentation

template<typename ClusterRefType >
uint32_t helper::ClusterStorer::ClusterHitRecord< ClusterRefType >::detid_
private
template<typename ClusterRefType >
TrackingRecHitCollection* helper::ClusterStorer::ClusterHitRecord< ClusterRefType >::hits_
private

Definition at line 69 of file ClusterStorer.h.

template<typename ClusterRefType >
size_t helper::ClusterStorer::ClusterHitRecord< ClusterRefType >::index_
private

Definition at line 70 of file ClusterStorer.h.

template<typename ClusterRefType >
ClusterRefType helper::ClusterStorer::ClusterHitRecord< ClusterRefType >::ref_
private