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.
3 
4 using namespace std;
5 using namespace edm;
6 
8  const std::vector< std::pair<const TrackingRecHit*, float> >& aHitMap, double annealing):
9  BaseTrackerRecHit(pos,err, idet,trackerHitRTTI::multi)
10 {
11  for(std::vector<std::pair<const TrackingRecHit*, float> >::const_iterator ihit = aHitMap.begin(); ihit != aHitMap.end(); ihit++){
12  theHits.push_back(ihit->first->clone());
13  theWeights.push_back(ihit->second);
14  }
15  annealing_ = annealing;
16 }
17 
18 
20  SharedInputType what) const
21 {
22  if(geographicalId() != other->geographicalId()&& what==all ) return false;
23  vector<const TrackingRecHit*> otherhits=other->recHits();
24  if(what==all){
25  if(theHits.size()!=other->recHits().size())return false;
26  for(vector<const TrackingRecHit*>::iterator otherhit=otherhits.begin();otherhit!=otherhits.end();++otherhit){
27  bool found=false;
29  if((hit)->sharesInput(*otherhit,all)){
30  found=true;
31  break;
32  }
33  }
34  if(found==false){
35  return false;
36  }
37  }
38  return true;
39  }
40  else{
42  if(otherhits.size()!=0){
43  for(vector<const TrackingRecHit*>::iterator otherhit=otherhits.begin();otherhit!=otherhits.end();++otherhit){
44  if((hit)->sharesInput(*otherhit,some))return true;
45  }
46  }
47  else{//otherwise it should be a single rechit
48  if((hit)->sharesInput(other,some))return true;
49  }
50  }
51  return false;
52  }
53 }
54 
55 
56 vector<const TrackingRecHit*> SiTrackerMultiRecHit::recHits() const{
57  vector<const TrackingRecHit*> myhits;
59  myhits.push_back(&*ihit);
60  }
61  return myhits;
62 }
63 
64 vector<TrackingRecHit*> SiTrackerMultiRecHit::recHits() {
65  return theHits.data();
66 }
67 
68 
70  //supposing all the hits inside of a MRH have the same id == same type
71  int randomComponent = 0;
72  if(theHits[randomComponent].dimension() == 1 ){ return 1; }
73  else if(theHits[randomComponent].dimension() == 2 ){ return 2; }
74  else { return 0; }
75 }
76 
78  if (dimension() == 1) getKfComponents1D(holder);
79  if (dimension() == 2) getKfComponents2D(holder);
80 }
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:446
DetId geographicalId() const