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 Attributes
SiTrackerMultiRecHit Class Reference

#include <SiTrackerMultiRecHit.h>

Inheritance diagram for SiTrackerMultiRecHit:
BaseSiTrackerRecHit2DLocalPos RecHit2DLocalPos TrackingRecHit

Public Member Functions

virtual SiTrackerMultiRecHitclone () const
 
virtual std::vector< const
TrackingRecHit * > 
recHits () const
 Access to component RecHits (if any) More...
 
virtual std::vector
< TrackingRecHit * > 
recHits ()
 Non-const access to component RecHits (if any) More...
 
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
 
std::vector< float > weights () const
 
virtual ~SiTrackerMultiRecHit ()
 
- Public Member Functions inherited from BaseSiTrackerRecHit2DLocalPos
 BaseSiTrackerRecHit2DLocalPos ()
 
 BaseSiTrackerRecHit2DLocalPos (const LocalPoint &p, const LocalError &e, DetId id)
 
virtual void getKfComponents (KfComponentsHolder &holder) const
 
bool hasPositionAndError () const
 
virtual LocalPoint localPosition () const
 
virtual LocalError localPositionError () const
 
const LocalErrorlocalPositionErrorFast () const
 
const LocalPointlocalPositionFast () const
 
 ~BaseSiTrackerRecHit2DLocalPos ()
 
- Public Member Functions inherited from RecHit2DLocalPos
virtual int dimension () const
 
virtual AlgebraicVector parameters () const
 
virtual AlgebraicSymMatrix parametersError () const
 
virtual AlgebraicMatrix projectionMatrix () const
 
 RecHit2DLocalPos (DetId id)
 
 RecHit2DLocalPos (TrackingRecHit::id_type id=0)
 
virtual ~RecHit2DLocalPos ()
 
- Public Member Functions inherited from TrackingRecHit
DetId geographicalId () const
 
Type getType () const
 
bool isValid () const
 
virtual void recHitsV (std::vector< const TrackingRecHit * > &) const
 
virtual void recHitsV (std::vector< TrackingRecHit * > &)
 
 TrackingRecHit (DetId id, Type type=valid)
 
 TrackingRecHit (id_type id=0, Type type=valid)
 
Type type () const
 
virtual float weight () const
 
virtual ~TrackingRecHit ()
 

Private Attributes

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

Additional Inherited Members

- Public Types inherited from RecHit2DLocalPos
typedef Surface::LocalPoint LocalPoint
 
- Public Types inherited from TrackingRecHit
typedef unsigned int id_type
 
enum  SharedInputType { all, some }
 definition of equality via shared input More...
 
enum  Type { valid = 0, missing = 1, inactive = 2, bad = 3 }
 
- Protected Member Functions inherited from TrackingRecHit
void setId (id_type iid)
 
void setType (Type ttype)
 

Detailed Description

Definition at line 13 of file SiTrackerMultiRecHit.h.

Constructor & Destructor Documentation

SiTrackerMultiRecHit::SiTrackerMultiRecHit ( )
inline

Definition at line 16 of file SiTrackerMultiRecHit.h.

Referenced by clone().

17  theHits(),
18  theWeights(){}
edm::OwnVector< TrackingRecHit > theHits
std::vector< float > theWeights
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.

7  :
9 {
10  for(std::vector<std::pair<const TrackingRecHit*, float> >::const_iterator ihit = aHitMap.begin(); ihit != aHitMap.end(); ihit++){
11  theHits.push_back(ihit->first->clone());
12  theWeights.push_back(ihit->second);
13  }
14 }
edm::OwnVector< TrackingRecHit > theHits
void push_back(D *&d)
Definition: OwnVector.h:290
std::vector< float > theWeights
virtual SiTrackerMultiRecHit::~SiTrackerMultiRecHit ( )
inlinevirtual

Definition at line 23 of file SiTrackerMultiRecHit.h.

23 {};

Member Function Documentation

virtual SiTrackerMultiRecHit* SiTrackerMultiRecHit::clone ( void  ) const
inlinevirtual

Implements RecHit2DLocalPos.

Definition at line 21 of file SiTrackerMultiRecHit.h.

References SiTrackerMultiRecHit().

21 {return new SiTrackerMultiRecHit(*this);};
vector< const TrackingRecHit * > SiTrackerMultiRecHit::recHits ( ) const
virtual

Access to component RecHits (if any)

Reimplemented from RecHit2DLocalPos.

Definition at line 60 of file SiTrackerMultiRecHit.cc.

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

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

60  {
61  vector<const TrackingRecHit*> myhits;
63  myhits.push_back(&*ihit);
64  }
65  return myhits;
66 }
edm::OwnVector< TrackingRecHit > theHits
iterator begin()
Definition: OwnVector.h:236
iterator end()
Definition: OwnVector.h:243
vector< TrackingRecHit * > SiTrackerMultiRecHit::recHits ( )
virtual

Non-const access to component RecHits (if any)

Reimplemented from RecHit2DLocalPos.

Definition at line 68 of file SiTrackerMultiRecHit.cc.

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

68  {
69  // vector<TrackingRecHit*> myhits;
70 // for(edm::OwnVector<TrackingRecHit>::const_iterator ihit = theHits.begin(); ihit != theHits.end(); ihit++) {
71 // const TrackingRecHit* ahit = &(*ihit);
72 // myhits.push_back(const_cast<TrackingRecHit*>(ahit));
73 // }
74  return theHits.data();
75 }
edm::OwnVector< TrackingRecHit > theHits
base const & data() const
Definition: OwnVector.h:393
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 23 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.

25 {
26  if(geographicalId() != other->geographicalId()&& what==all ) return false;
27  vector<const TrackingRecHit*> otherhits=other->recHits();
28  if(what==all){
29  if(theHits.size()!=other->recHits().size())return false;
30  for(vector<const TrackingRecHit*>::iterator otherhit=otherhits.begin();otherhit!=otherhits.end();++otherhit){
31  bool found=false;
33  if((hit)->sharesInput(*otherhit,all)){
34  found=true;
35  break;
36  }
37  }
38  if(found==false){
39  return false;
40  }
41  }
42  return true;
43  }
44  else{
46  if(otherhits.size()!=0){
47  for(vector<const TrackingRecHit*>::iterator otherhit=otherhits.begin();otherhit!=otherhits.end();++otherhit){
48  if((hit)->sharesInput(*otherhit,some))return true;
49  }
50  }
51  else{//otherwise it should be a simple rechit
52  if((hit)->sharesInput(other,some))return true;
53  }
54  }
55  return false;
56  }
57 }
size_type size() const
Definition: OwnVector.h:262
edm::OwnVector< TrackingRecHit > theHits
iterator begin()
Definition: OwnVector.h:236
virtual std::vector< const TrackingRecHit * > recHits() const =0
Access to component RecHits (if any)
iterator end()
Definition: OwnVector.h:243
DetId geographicalId() const
float SiTrackerMultiRecHit::weight ( unsigned int  i) const

Definition at line 16 of file SiTrackerMultiRecHit.cc.

References theWeights.

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

16  {
17  if (i < theWeights.size()) return theWeights[i];
18  edm::LogError("SiTrackerMultiRecHit") << "You are requesting a the weight for a hit out of range, returning 0";
19  return 0;
20 }
int i
Definition: DBlmapReader.cc:9
std::vector< float > theWeights
std::vector<float> SiTrackerMultiRecHit::weights ( ) const
inline

Member Data Documentation

edm::OwnVector<TrackingRecHit> SiTrackerMultiRecHit::theHits
private

Definition at line 40 of file SiTrackerMultiRecHit.h.

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

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

Definition at line 41 of file SiTrackerMultiRecHit.h.

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