CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

SiTrackerMultiRecHit Class Reference

#include <SiTrackerMultiRecHit.h>

Inheritance diagram for SiTrackerMultiRecHit:
BaseTrackerRecHit TrackingRecHit

List of all members.

Public Types

typedef BaseTrackerRecHit Base

Public Member Functions

virtual SiTrackerMultiRecHitclone () const
virtual int dimension () const
virtual OmniClusterRef const & firstClusterRef () const
virtual void getKfComponents (KfComponentsHolder &holder) const
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 sharesInput (const TrackingRecHit *other, SharedInputType what) const
 SiTrackerMultiRecHit ()
 SiTrackerMultiRecHit (const LocalPoint &, const LocalError &, const DetId &, const std::vector< std::pair< const TrackingRecHit *, float > > &)
float weight (unsigned int i) const
float & weight (unsigned int i)
std::vector< float > const & weights () const
std::vector< float > & weights ()
virtual ~SiTrackerMultiRecHit ()

Private Attributes

edm::OwnVector< TrackingRecHittheHits
std::vector< float > theWeights

Detailed Description

Definition at line 13 of file SiTrackerMultiRecHit.h.


Member Typedef Documentation

Definition at line 16 of file SiTrackerMultiRecHit.h.


Constructor & Destructor Documentation

SiTrackerMultiRecHit::SiTrackerMultiRecHit ( ) [inline]

Definition at line 17 of file SiTrackerMultiRecHit.h.

Referenced by clone().

                        :
    theHits(),
    theWeights(){}
virtual SiTrackerMultiRecHit::~SiTrackerMultiRecHit ( ) [inline, virtual]

Definition at line 20 of file SiTrackerMultiRecHit.h.

{}      
SiTrackerMultiRecHit::SiTrackerMultiRecHit ( const LocalPoint pos,
const LocalError err,
const DetId id,
const std::vector< std::pair< const TrackingRecHit *, float > > &  aHitMap 
)

Definition at line 7 of file SiTrackerMultiRecHit.cc.

References edm::OwnVector< T, P >::push_back(), theHits, and theWeights.

                                                                                                             :
  BaseTrackerRecHit(pos,err,id,trackerHitRTTI::multi)   
{
  for(std::vector<std::pair<const TrackingRecHit*, float> >::const_iterator ihit = aHitMap.begin(); ihit != aHitMap.end(); ihit++){
    theHits.push_back(ihit->first->clone());
    theWeights.push_back(ihit->second);
  }
}

Member Function Documentation

virtual SiTrackerMultiRecHit* SiTrackerMultiRecHit::clone ( void  ) const [inline, virtual]

Implements TrackingRecHit.

Definition at line 26 of file SiTrackerMultiRecHit.h.

References SiTrackerMultiRecHit().

{return new SiTrackerMultiRecHit(*this);}
virtual int SiTrackerMultiRecHit::dimension ( ) const [inline, virtual]

Implements BaseTrackerRecHit.

Definition at line 28 of file SiTrackerMultiRecHit.h.

{return 2;}
virtual OmniClusterRef const& SiTrackerMultiRecHit::firstClusterRef ( ) const [inline, virtual]

Implements BaseTrackerRecHit.

Definition at line 33 of file SiTrackerMultiRecHit.h.

References firstClusterRef(), edm::OwnVector< T, P >::front(), and theHits.

Referenced by firstClusterRef().

{ return static_cast<BaseTrackerRecHit const *>(&theHits.front())->firstClusterRef();}
virtual void SiTrackerMultiRecHit::getKfComponents ( KfComponentsHolder holder) const [inline, virtual]

Implements BaseTrackerRecHit.

Definition at line 29 of file SiTrackerMultiRecHit.h.

References BaseTrackerRecHit::getKfComponents2D().

{ getKfComponents2D(holder); }
vector< const TrackingRecHit * > SiTrackerMultiRecHit::recHits ( ) const [virtual]

Access to component RecHits (if any)

Implements TrackingRecHit.

Definition at line 55 of file SiTrackerMultiRecHit.cc.

References edm::OwnVector< T, P >::begin(), edm::OwnVector< T, P >::end(), and theHits.

Referenced by TrackerHitAssociator::associateMultiRecHit(), TrackerHitAssociator::associateMultiRecHitId(), and TrackerDpgAnalysis::insertMeasurement().

                                                                 {
  vector<const TrackingRecHit*> myhits;
  for(edm::OwnVector<TrackingRecHit>::const_iterator ihit = theHits.begin(); ihit != theHits.end(); ihit++) {
    myhits.push_back(&*ihit);
  }
  return myhits;
}
vector< TrackingRecHit * > SiTrackerMultiRecHit::recHits ( ) [virtual]

Non-const access to component RecHits (if any)

Implements TrackingRecHit.

Definition at line 63 of file SiTrackerMultiRecHit.cc.

References edm::OwnVector< T, P >::data(), and theHits.

                                                      {
  //        vector<TrackingRecHit*> myhits;
  //         for(edm::OwnVector<TrackingRecHit>::const_iterator ihit = theHits.begin(); ihit != theHits.end(); ihit++) {
  //                 const TrackingRecHit* ahit = &(*ihit);
  //                 myhits.push_back(const_cast<TrackingRecHit*>(ahit));
  //         }
  return theHits.data();
}
bool SiTrackerMultiRecHit::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 18 of file SiTrackerMultiRecHit.cc.

References TrackingRecHit::all, edm::OwnVector< T, P >::begin(), edm::OwnVector< T, P >::end(), newFWLiteAna::found, TrackingRecHit::geographicalId(), TrackingRecHit::recHits(), edm::OwnVector< T, P >::size(), TrackingRecHit::some, and theHits.

{
  if(geographicalId() != other->geographicalId()&& what==all ) return false;
  vector<const TrackingRecHit*> otherhits=other->recHits();
  if(what==all){
    if(theHits.size()!=other->recHits().size())return false;
    for(vector<const TrackingRecHit*>::iterator otherhit=otherhits.begin();otherhit!=otherhits.end();++otherhit){
      bool found=false;
      for(OwnVector<TrackingRecHit>::const_iterator hit=theHits.begin();hit!=theHits.end();++hit){
        if((hit)->sharesInput(*otherhit,all)){
          found=true;
          break;
        }
      }
      if(found==false){
        return false;
      }
    }
    return true;
  }
  else{
    for(OwnVector<TrackingRecHit>::const_iterator hit=theHits.begin();hit!=theHits.end();++hit){
      if(otherhits.size()!=0){ 
        for(vector<const TrackingRecHit*>::iterator otherhit=otherhits.begin();otherhit!=otherhits.end();++otherhit){
          if((hit)->sharesInput(*otherhit,some))return true;
        }
      }
      else{//otherwise it should be a single rechit
        if((hit)->sharesInput(other,some))return true;
      } 
    }
    return false;
  }
}
float& SiTrackerMultiRecHit::weight ( unsigned int  i) [inline]

Definition at line 47 of file SiTrackerMultiRecHit.h.

References i, and theWeights.

{return theWeights[i];}
float SiTrackerMultiRecHit::weight ( unsigned int  i) const [inline]
std::vector<float>& SiTrackerMultiRecHit::weights ( ) [inline]

Definition at line 43 of file SiTrackerMultiRecHit.h.

References theWeights.

{return theWeights;}
std::vector<float> const& SiTrackerMultiRecHit::weights ( ) const [inline]

Member Data Documentation

Definition at line 53 of file SiTrackerMultiRecHit.h.

Referenced by firstClusterRef(), recHits(), sharesInput(), and SiTrackerMultiRecHit().

std::vector<float> SiTrackerMultiRecHit::theWeights [private]

Definition at line 54 of file SiTrackerMultiRecHit.h.

Referenced by SiTrackerMultiRecHit(), weight(), and weights().