39 std::vector<const TrackingRecHit *> hits;
43 hits.push_back(&**it);
45 DetId id(hits.back()->geographicalId());
46 std::cout <<
" subdet " <<
id.subdetId() <<
" layer " <<
theTrkTopo->layer(
id) <<
" valid " << hits.back()->
isValid() <<
" detid: " << id() << std::endl;
52 DetId lastId(hits.back()->geographicalId());
54 unsigned int lastLayer =
theTrkTopo->layer(lastId);
59 if (thisSubdet > lastSubdet || (thisSubdet == lastSubdet &&
theTrkTopo->layer(
id) > lastLayer)) {
61 if (
debug_)
std::cout <<
" adding subdet " <<
id.subdetId() <<
" layer " <<
theTrkTopo->layer(
id) <<
" valid " << hit->
isValid() <<
" detid: " << id() << std::endl;
63 if (
debug_)
std::cout <<
" skipping subdet " << thisSubdet <<
" layer " <<
theTrkTopo->layer(
id) <<
" valid " << hit->
isValid() <<
" detid: " << id() << std::endl;
67 size_t nHitsFirstTrack = hits.size();
74 if (
debug_)
std::cout <<
" subdet " <<
id.subdetId() <<
" layer " <<
theTrkTopo->layer(
id) <<
" valid " << valid <<
" detid: " << id() << std::endl;
77 ++iHit;
if (iHit > nHitsFirstTrack)
break;
79 if (
id.subdetId() != id2.
subdetId())
continue;
82 if (
debug_)
std::cout <<
" discared as duplicate of other hit" << id() << std::endl;
86 if (
debug_)
std::cout <<
" replacing old invalid hit on detid " << id2() << std::endl;
87 hit2 = hit; shared =
true;
break;
89 if (
debug_)
std::cout <<
" discared as additional hit on layer that already contains hit with detid " << id() << std::endl;
102 unsigned int nhits = hits.
size();
119 std::vector<TransientTrackingRecHit::RecHitPointer> ttrh(nhits);
120 for (
unsigned int i = 0;
i < nhits; ++
i) ttrh[
i] =
theBuilder->build(hits[
i]);
121 std::sort(ttrh.begin(), ttrh.end(), GlobalMomentumSort(
v));
edm::ESHandle< TrackerTopology > theTrkTopo
const Vector & momentum() const
track momentum vector
size_t recHitsSize() const
Get number of RecHits. (Warning, this includes invalid hits, which are not physical hits)...
virtual bool sharesInput(const TrackingRecHit *other, SharedInputType what) const
const math::XYZPoint & outerPosition() const
position of the outermost hit
const math::XYZPoint & innerPosition() const
position of the innermost hit
unsigned int outerDetId() const
DetId of the detector on which surface the outermost state is located.
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
std::shared_ptr< TrackingRecHit const > RecHitPointer
const math::XYZVector & outerMomentum() const
momentum vector at the outermost hit position
XYZVectorD XYZVector
spatial vector with cartesian internal representation
edm::ESHandle< TransientTrackingRecHitBuilder > theBuilder
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
DetId geographicalId() const
unsigned int innerDetId() const
DetId of the detector on which surface the innermost state is located.
edm::ESHandle< MagneticField > theMagField
edm::ESHandle< TrackerGeometry > theGeometry
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.