CMS 3D CMS Logo

SiTrackerMultiRecHit.cc
Go to the documentation of this file.
2 
3 using namespace std;
4 using namespace edm;
5 
7  const LocalError& err,
8  GeomDet const& idet,
9  const std::vector<std::pair<const TrackingRecHit*, float> >& aHitMap,
10  double annealing)
12  for (std::vector<std::pair<const TrackingRecHit*, float> >::const_iterator ihit = aHitMap.begin();
13  ihit != aHitMap.end();
14  ihit++) {
15  theHits.push_back(ihit->first->clone());
16  theWeights.push_back(ihit->second);
17  }
18  annealing_ = annealing;
19 }
20 
22  if (geographicalId() != other->geographicalId() && what == all)
23  return false;
24  vector<const TrackingRecHit*> otherhits = other->recHits();
25  if (what == all) {
26  if (theHits.size() != other->recHits().size())
27  return false;
28  for (vector<const TrackingRecHit*>::iterator otherhit = otherhits.begin(); otherhit != otherhits.end();
29  ++otherhit) {
30  bool found = false;
32  if ((hit)->sharesInput(*otherhit, all)) {
33  found = true;
34  break;
35  }
36  }
37  if (found == false) {
38  return false;
39  }
40  }
41  return true;
42  } else {
44  if (!otherhits.empty()) {
45  for (vector<const TrackingRecHit*>::iterator otherhit = otherhits.begin(); otherhit != otherhits.end();
46  ++otherhit) {
47  if ((hit)->sharesInput(*otherhit, some))
48  return true;
49  }
50  } else { //otherwise it should be a single rechit
51  if ((hit)->sharesInput(other, some))
52  return true;
53  }
54  }
55  return false;
56  }
57 }
58 
59 vector<const TrackingRecHit*> SiTrackerMultiRecHit::recHits() const {
60  vector<const TrackingRecHit*> myhits;
61  for (edm::OwnVector<TrackingRecHit>::const_iterator ihit = theHits.begin(); ihit != theHits.end(); ihit++) {
62  myhits.push_back(&*ihit);
63  }
64  return myhits;
65 }
66 
67 vector<TrackingRecHit*> SiTrackerMultiRecHit::recHits() { return theHits.data(); }
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) {
73  return 1;
74  } else if (theHits[randomComponent].dimension() == 2) {
75  return 2;
76  } else {
77  return 0;
78  }
79 }
80 
82  if (dimension() == 1)
83  getKfComponents1D(holder);
84  if (dimension() == 2)
85  getKfComponents2D(holder);
86 }
SiTrackerMultiRecHit::annealing_
double annealing_
Definition: SiTrackerMultiRecHit.h:63
GeomDet
Definition: GeomDet.h:27
edm::OwnVector::end
iterator end()
Definition: OwnVector.h:285
edm
HLT enums.
Definition: AlignableModifier.h:19
BaseTrackerRecHit::hit
BaseTrackerRecHit const * hit() const final
Definition: BaseTrackerRecHit.h:20
pos
Definition: PixelAliasList.h:18
SiTrackerMultiRecHit::recHits
std::vector< const TrackingRecHit * > recHits() const override
Access to component RecHits (if any)
Definition: SiTrackerMultiRecHit.cc:59
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
TrackingRecHit::geographicalId
DetId geographicalId() const
Definition: TrackingRecHit.h:120
TrackingRecHit::SharedInputType
SharedInputType
definition of equality via shared input
Definition: TrackingRecHit.h:59
SiTrackerMultiRecHit::sharesInput
bool sharesInput(const TrackingRecHit *other, SharedInputType what) const override
Definition: SiTrackerMultiRecHit.cc:21
BaseTrackerRecHit
Definition: BaseTrackerRecHit.h:15
SiTrackerMultiRecHit.h
trackingPlots.other
other
Definition: trackingPlots.py:1460
Point3DBase< float, LocalTag >
TrackingRecHit::some
Definition: TrackingRecHit.h:59
edm::OwnVector::const_iterator
Definition: OwnVector.h:41
TrackingRecHit::all
Definition: TrackingRecHit.h:59
LocalError
Definition: LocalError.h:12
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
trackerHitRTTI::multi
Definition: trackerHitRTTI.h:14
submitPVResolutionJobs.err
err
Definition: submitPVResolutionJobs.py:85
KfComponentsHolder
Definition: KfComponentsHolder.h:13
SiTrackerMultiRecHit::getKfComponents
void getKfComponents(KfComponentsHolder &holder) const override
Definition: SiTrackerMultiRecHit.cc:81
TrackingRecHit
Definition: TrackingRecHit.h:21
SiTrackerMultiRecHit::theHits
edm::OwnVector< TrackingRecHit > theHits
Definition: SiTrackerMultiRecHit.h:61
std
Definition: JetResolutionObject.h:76
edm::OwnVector::data
base const & data() const
Definition: OwnVector.h:476
SiTrackerMultiRecHit::SiTrackerMultiRecHit
SiTrackerMultiRecHit()
Definition: SiTrackerMultiRecHit.h:16
edm::OwnVector::push_back
void push_back(D *&d)
Definition: OwnVector.h:326
SiTrackerMultiRecHit::theWeights
std::vector< float > theWeights
Definition: SiTrackerMultiRecHit.h:62
BaseTrackerRecHit::getKfComponents2D
void getKfComponents2D(KfComponentsHolder &holder) const
Definition: BaseTrackerRecHit.cc:53
SiTrackerMultiRecHit::dimension
int dimension() const override
Definition: SiTrackerMultiRecHit.cc:69
edm::OwnVector::begin
iterator begin()
Definition: OwnVector.h:280
trackerHitRTTI
Definition: trackerHitRTTI.h:6
edm::OwnVector::size
size_type size() const
Definition: OwnVector.h:300
hit
Definition: SiStripHitEffFromCalibTree.cc:88
BaseTrackerRecHit::getKfComponents1D
void getKfComponents1D(KfComponentsHolder &holder) const
Definition: BaseTrackerRecHit.cc:35
edm::OwnVector
Definition: OwnVector.h:24