CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

TrackerSingleRecHit Class Reference

#include <TrackerSingleRecHit.h>

Inheritance diagram for TrackerSingleRecHit:
BaseTrackerRecHit TrackingRecHit SiPixelRecHit SiStripRecHit1D SiStripRecHit2D

List of all members.

Public Types

typedef BaseTrackerRecHit Base
typedef
OmniClusterRef::ClusterPixelRef 
ClusterPixelRef
typedef
OmniClusterRef::ClusterRegionalRef 
ClusterRegionalRef
typedef
OmniClusterRef::ClusterStripRef 
ClusterStripRef

Public Member Functions

ClusterPixelRef cluster_pixel () const
ClusterRegionalRef cluster_regional () const
ClusterStripRef cluster_strip () const
virtual OmniClusterRef const & firstClusterRef () const
OmniClusterRef const & omniCluster () const
OmniClusterRefomniCluster ()
OmniClusterRef const & omniClusterRef () const
OmniClusterRefomniClusterRef ()
virtual std::vector< const
TrackingRecHit * > 
recHits () const
 Access to component RecHits (if any)
virtual std::vector
< TrackingRecHit * > 
recHits ()
 Non-const access to component RecHits (if any)
bool sameCluster (OmniClusterRef const &oh) const
void setClusterPixelRef (ClusterPixelRef const &ref)
void setClusterRegionalRef (ClusterRegionalRef const &ref)
void setClusterStripRef (ClusterStripRef const &ref)
virtual bool sharesInput (const TrackingRecHit *other, SharedInputType what) const
bool sharesInput (TrackerSingleRecHit const &other) const
SiStripCluster const & stripCluster () const
 TrackerSingleRecHit (const LocalPoint &p, const LocalError &e, DetId id, OmniClusterRef const &clus)
 TrackerSingleRecHit (const LocalPoint &p, const LocalError &e, DetId id, ClusterPixelRef const &clus)
 TrackerSingleRecHit (const LocalPoint &p, const LocalError &e, DetId id, ClusterStripRef const &clus)
 TrackerSingleRecHit (const LocalPoint &p, const LocalError &e, DetId id, ClusterRegionalRef const &clus)
 TrackerSingleRecHit ()
 TrackerSingleRecHit (DetId id, OmniClusterRef const &clus)

Private Attributes

OmniClusterRef cluster_

Detailed Description

Definition at line 12 of file TrackerSingleRecHit.h.


Member Typedef Documentation

Definition at line 15 of file TrackerSingleRecHit.h.

Definition at line 20 of file TrackerSingleRecHit.h.

Reimplemented in SiStripRecHit1D, and SiStripRecHit2D.

Definition at line 22 of file TrackerSingleRecHit.h.

Definition at line 21 of file TrackerSingleRecHit.h.


Constructor & Destructor Documentation

TrackerSingleRecHit::TrackerSingleRecHit ( ) [inline]

Definition at line 17 of file TrackerSingleRecHit.h.

{}
TrackerSingleRecHit::TrackerSingleRecHit ( DetId  id,
OmniClusterRef const &  clus 
) [inline]

Definition at line 26 of file TrackerSingleRecHit.h.

TrackerSingleRecHit::TrackerSingleRecHit ( const LocalPoint p,
const LocalError e,
DetId  id,
OmniClusterRef const &  clus 
) [inline]

Definition at line 30 of file TrackerSingleRecHit.h.

                                                   : Base(p,e,id, trackerHitRTTI::single), cluster_(clus){}
TrackerSingleRecHit::TrackerSingleRecHit ( const LocalPoint p,
const LocalError e,
DetId  id,
ClusterPixelRef const &  clus 
) [inline]

Definition at line 34 of file TrackerSingleRecHit.h.

                                                    : Base(p,e,id, trackerHitRTTI::single), cluster_(clus){}
TrackerSingleRecHit::TrackerSingleRecHit ( const LocalPoint p,
const LocalError e,
DetId  id,
ClusterStripRef const &  clus 
) [inline]

Definition at line 38 of file TrackerSingleRecHit.h.

                                                    : Base(p,e,id, trackerHitRTTI::single), cluster_(clus){}
TrackerSingleRecHit::TrackerSingleRecHit ( const LocalPoint p,
const LocalError e,
DetId  id,
ClusterRegionalRef const &  clus 
) [inline]

Definition at line 42 of file TrackerSingleRecHit.h.

                                                      :  Base(p,e,id, trackerHitRTTI::single), cluster_(clus){}

Member Function Documentation

ClusterPixelRef TrackerSingleRecHit::cluster_pixel ( ) const [inline]

Definition at line 55 of file TrackerSingleRecHit.h.

References cluster_, and OmniClusterRef::cluster_pixel().

Referenced by SiPixelRecHit::cluster().

                                         { 
    return cluster_.cluster_pixel();
  }
ClusterRegionalRef TrackerSingleRecHit::cluster_regional ( ) const [inline]
ClusterStripRef TrackerSingleRecHit::cluster_strip ( ) const [inline]
virtual OmniClusterRef const& TrackerSingleRecHit::firstClusterRef ( ) const [inline, virtual]

Implements BaseTrackerRecHit.

Definition at line 47 of file TrackerSingleRecHit.h.

References cluster_.

Referenced by ProjectedSiStripRecHit2D::firstClusterRef().

{ return cluster_;}
OmniClusterRef& TrackerSingleRecHit::omniCluster ( ) [inline]

Definition at line 53 of file TrackerSingleRecHit.h.

References cluster_.

{ return cluster_;}
OmniClusterRef const& TrackerSingleRecHit::omniCluster ( ) const [inline]
OmniClusterRef& TrackerSingleRecHit::omniClusterRef ( ) [inline]

Definition at line 52 of file TrackerSingleRecHit.h.

References cluster_.

{ return cluster_;}
OmniClusterRef const& TrackerSingleRecHit::omniClusterRef ( ) const [inline]
std::vector< TrackingRecHit * > TrackerSingleRecHit::recHits ( ) [virtual]

Non-const access to component RecHits (if any)

Implements TrackingRecHit.

Definition at line 146 of file TrackerSingleRecHit.cc.

                                                        {
  std::vector<TrackingRecHit*> nullvector;
  return nullvector; 
}
std::vector< const TrackingRecHit * > TrackerSingleRecHit::recHits ( ) const [virtual]

Access to component RecHits (if any)

Implements TrackingRecHit.

Definition at line 142 of file TrackerSingleRecHit.cc.

Referenced by TSiStripRecHit2DLocalPos::recHits(), TSiPixelRecHit::recHits(), and TSiStripRecHit1D::recHits().

                                                                    {
  std::vector<const TrackingRecHit*> nullvector;
  return nullvector; 
}
bool TrackerSingleRecHit::sameCluster ( OmniClusterRef const &  oh) const [inline]

Definition at line 85 of file TrackerSingleRecHit.h.

References cluster_.

Referenced by SiStripMatchedRecHit2D::sharesInput().

                                                     {
    return oh == cluster_;
  }
void TrackerSingleRecHit::setClusterPixelRef ( ClusterPixelRef const &  ref) [inline]

Definition at line 72 of file TrackerSingleRecHit.h.

References cluster_.

Referenced by SiPixelRecHit::setClusterRef().

void TrackerSingleRecHit::setClusterRegionalRef ( ClusterRegionalRef const &  ref) [inline]

Definition at line 74 of file TrackerSingleRecHit.h.

References cluster_.

void TrackerSingleRecHit::setClusterStripRef ( ClusterStripRef const &  ref) [inline]

Definition at line 73 of file TrackerSingleRecHit.h.

References cluster_.

Referenced by SiStripRecHit2D::setClusterRef(), and SiStripRecHit1D::setClusterRef().

bool TrackerSingleRecHit::sharesInput ( const TrackingRecHit other,
SharedInputType  what 
) const [virtual]

Returns true if the two TrackingRecHits are using the same input information (like Digis, Clusters, etc), false otherwise. The second argument specifies how much sharing is needed in order to return true: the value "all" means that all inputs of the two hits must be identical; the value "some" means that at least one of the inputs is in common.

Reimplemented from TrackingRecHit.

Definition at line 104 of file TrackerSingleRecHit.cc.

References TrackingRecHit::all, i, trackerHitRTTI::isMatched(), trackerHitRTTI::isProjected(), trackerHitRTTI::isSingle(), TrackingRecHit::recHits(), BaseTrackerRecHit::sameDetModule(), TrackingRecHit::sharesInput(), and SiStripMatchedRecHit2D::sharesInput().

Referenced by ProjectedSiStripRecHit2D::sharesInput().

{
  //  verify(this); verify(other);
  // if (!doingCheck && (other!=this)) checkSelf(this,other);


  if (!sameDetModule(*other)) return false;

  // move to switch?
  if (trackerHitRTTI::isSingle(*other)) {
    const TrackerSingleRecHit & otherCast = static_cast<const TrackerSingleRecHit&>(*other);
    return sharesInput(otherCast);
  } 

  if (trackerHitRTTI::isProjected(*other)) 
    return other->sharesInput(this,what);

  if (trackerHitRTTI::isMatched(*other) ) {
    if (what == all) return false;
    return static_cast<SiStripMatchedRecHit2D const &>(*other).sharesInput(*this);
  }

  // last resort, recur to 'recHits()', even if it returns a vector by value
  std::vector<const TrackingRecHit*> otherHits = other->recHits();
  int ncomponents=otherHits.size();
  if(ncomponents==0)return false; //bho
  if(ncomponents==1) return sharesInput(otherHits.front(),what);
  // ncomponents>1
  if(what == all )return false;

  for(int i=0;i<ncomponents;i++){
    if(sharesInput(otherHits[i],what))return true;
  }
  return false; 
}
bool TrackerSingleRecHit::sharesInput ( TrackerSingleRecHit const &  other) const [inline]

Definition at line 81 of file TrackerSingleRecHit.h.

References cluster_.

                                                            {
    return cluster_== other.cluster_;
  }
SiStripCluster const& TrackerSingleRecHit::stripCluster ( ) const [inline]

Member Data Documentation