CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiTrackerMultiRecHit.cc
Go to the documentation of this file.
2 
3 using namespace std;
4 using namespace edm;
5 
7  const std::vector< std::pair<const TrackingRecHit*, float> >& aHitMap, double annealing):
8  BaseTrackerRecHit(pos,err, idet,trackerHitRTTI::multi)
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  annealing_ = annealing;
15 }
16 
17 
19  SharedInputType what) const
20 {
21  if(geographicalId() != other->geographicalId()&& what==all ) return false;
22  vector<const TrackingRecHit*> otherhits=other->recHits();
23  if(what==all){
24  if(theHits.size()!=other->recHits().size())return false;
25  for(vector<const TrackingRecHit*>::iterator otherhit=otherhits.begin();otherhit!=otherhits.end();++otherhit){
26  bool found=false;
28  if((hit)->sharesInput(*otherhit,all)){
29  found=true;
30  break;
31  }
32  }
33  if(found==false){
34  return false;
35  }
36  }
37  return true;
38  }
39  else{
41  if(otherhits.size()!=0){
42  for(vector<const TrackingRecHit*>::iterator otherhit=otherhits.begin();otherhit!=otherhits.end();++otherhit){
43  if((hit)->sharesInput(*otherhit,some))return true;
44  }
45  }
46  else{//otherwise it should be a single rechit
47  if((hit)->sharesInput(other,some))return true;
48  }
49  }
50  return false;
51  }
52 }
53 
54 
55 vector<const TrackingRecHit*> SiTrackerMultiRecHit::recHits() const{
56  vector<const TrackingRecHit*> myhits;
58  myhits.push_back(&*ihit);
59  }
60  return myhits;
61 }
62 
63 vector<TrackingRecHit*> SiTrackerMultiRecHit::recHits() {
64  return theHits.data();
65 }
66 
67 
69  //supposing all the hits inside of a MRH have the same id == same type
70  int randomComponent = 0;
71  if(theHits[randomComponent].dimension() == 1 ){ return 1; }
72  else if(theHits[randomComponent].dimension() == 2 ){ return 2; }
73  else { return 0; }
74 }
75 
77  if (dimension() == 1) getKfComponents1D(holder);
78  if (dimension() == 2) getKfComponents2D(holder);
79 }
SharedInputType
definition of equality via shared input
bool sharesInput(const TrackingRecHit *other, SharedInputType what) const
size_type size() const
Definition: OwnVector.h:264
BaseTrackerRecHit const * hit() const final
edm::OwnVector< TrackingRecHit > theHits
iterator begin()
Definition: OwnVector.h:244
virtual int dimension() const
void push_back(D *&d)
Definition: OwnVector.h:290
virtual std::vector< const TrackingRecHit * > recHits() const
Access to component RecHits (if any)
void getKfComponents2D(KfComponentsHolder &holder) const
virtual std::vector< const TrackingRecHit * > recHits() const =0
Access to component RecHits (if any)
std::vector< float > theWeights
virtual void getKfComponents(KfComponentsHolder &holder) const
iterator end()
Definition: OwnVector.h:249
void getKfComponents1D(KfComponentsHolder &holder) const
base const & data() const
Definition: OwnVector.h:440
DetId geographicalId() const