#include <HitExtractorPIX.h>
Public Member Functions | |
virtual HitExtractorPIX * | clone () const |
HitExtractorPIX (SeedingLayer::Side &side, int idLayer, const std::string &hitProducer) | |
virtual HitExtractor::Hits | hits (const SeedingLayer &sl, const edm::Event &, const edm::EventSetup &) const |
virtual | ~HitExtractorPIX () |
Private Attributes | |
std::string | theHitProducer |
int | theIdLayer |
SeedingLayer::Side | theSide |
Definition at line 13 of file HitExtractorPIX.h.
HitExtractorPIX::HitExtractorPIX | ( | SeedingLayer::Side & | side, |
int | idLayer, | ||
const std::string & | hitProducer | ||
) |
Definition at line 17 of file HitExtractorPIX.cc.
Referenced by clone().
: theSide(side), theIdLayer(idLayer), theHitProducer(hitProducer) { }
virtual ctfseeding::HitExtractorPIX::~HitExtractorPIX | ( | ) | [inline, virtual] |
Definition at line 16 of file HitExtractorPIX.h.
{}
virtual HitExtractorPIX* ctfseeding::HitExtractorPIX::clone | ( | void | ) | const [inline, virtual] |
Definition at line 18 of file HitExtractorPIX.h.
References HitExtractorPIX().
{ return new HitExtractorPIX(*this); }
HitExtractor::Hits HitExtractorPIX::hits | ( | const SeedingLayer & | sl, |
const edm::Event & | ev, | ||
const edm::EventSetup & | es | ||
) | const [virtual] |
Implements ctfseeding::HitExtractor.
Definition at line 22 of file HitExtractorPIX.cc.
References ctfseeding::SeedingLayer::Barrel, edmNew::DetSetVector< T >::begin(), SiPixelRecHit::cluster(), edmNew::DetSetVector< T >::end(), f, spr::find(), edm::Event::getByLabel(), keep, LogDebug, TrackerLayerIdAccessor::pixelBarrelLayer(), TrackerLayerIdAccessor::pixelForwardDisk(), ctfseeding::range2SeedingHits(), query::result, ctfseeding::HitExtractor::skipClusters, theHitProducer, theIdLayer, theSide, and ctfseeding::HitExtractor::theSkipClusters.
{ HitExtractor::Hits result; TrackerLayerIdAccessor accessor; edm::Handle<SiPixelRecHitCollection> pixelHits; ev.getByLabel( theHitProducer, pixelHits); if (theSide==SeedingLayer::Barrel) { range2SeedingHits( *pixelHits, result, accessor.pixelBarrelLayer(theIdLayer), sl, es ); } else { range2SeedingHits( *pixelHits, result, accessor.pixelForwardDisk(theSide,theIdLayer), sl, es ); } if (skipClusters){ LogDebug("HitExtractorPIX")<<"getting : "<<result.size()<<" pixel hits."; //std::cout<<" skipping"<<std::endl; edm::Handle<edmNew::DetSetVector<SiPixelClusterRefNew> > pixelClusterRefs; ev.getByLabel(theSkipClusters,pixelClusterRefs); std::vector<bool> keep(result.size(),true); HitExtractor::Hits newHits; uint skipped=0; if (result.empty()) return result; DetId lookup=result.front()->hit()->geographicalId(); edmNew::DetSetVector<SiPixelClusterRefNew>::const_iterator f=pixelClusterRefs->find(lookup); newHits.reserve(result.size()); for (unsigned int iH=0;iH!=result.size();++iH){ if (result[iH]->hit()->geographicalId()!=lookup) { lookup=result[iH]->hit()->geographicalId(); f=pixelClusterRefs->find(lookup); } if (result[iH]->hit()->isValid()){ SiPixelRecHit * concrete = (SiPixelRecHit *) result[iH]->hit(); if (f!=pixelClusterRefs->end() && find(f->begin(),f->end(),concrete->cluster())!=f->end()){ //too much debug LogDebug("HitExtractorPIX")<<"skipping a pixel hit on: "<< result[iH]->hit()->geographicalId().rawId()<<" key: "<<find(f->begin(),f->end(),concrete->cluster())->key(); skipped++; continue; } } newHits.push_back(result[iH]); } result.swap(newHits); LogDebug("HitExtractorPIX")<<"skipped :"<<skipped<<" pixel clusters"; } LogDebug("HitExtractorPIX")<<"giving :"<<result.size()<<" rechits out"; return result; }
std::string ctfseeding::HitExtractorPIX::theHitProducer [private] |
Definition at line 23 of file HitExtractorPIX.h.
Referenced by hits().
int ctfseeding::HitExtractorPIX::theIdLayer [private] |
Definition at line 22 of file HitExtractorPIX.h.
Referenced by hits().
Definition at line 21 of file HitExtractorPIX.h.
Referenced by hits().