#include <HitExtractorSTRP.h>
Definition at line 19 of file HitExtractorSTRP.h.
typedef SiStripRecHit2D::ClusterRef ctfseeding::HitExtractorSTRP::SiStripClusterRef |
Definition at line 22 of file HitExtractorSTRP.h.
HitExtractorSTRP::HitExtractorSTRP | ( | const DetLayer * | detLayer, |
SeedingLayer::Side & | side, | ||
int | idLayer | ||
) |
Definition at line 27 of file HitExtractorSTRP.cc.
Referenced by clone().
: theLayer(detLayer), theSide(side), theIdLayer(idLayer), hasMatchedHits(false), hasRPhiHits(false), hasStereoHits(false), hasRingSelector(false), theMinRing(1), theMaxRing(0), hasSimpleRphiHitsCleaner(true) { }
virtual ctfseeding::HitExtractorSTRP::~HitExtractorSTRP | ( | ) | [inline, virtual] |
Definition at line 25 of file HitExtractorSTRP.h.
{}
void HitExtractorSTRP::cleanedOfClusters | ( | const edm::Event & | ev, |
HitExtractor::Hits & | hits, | ||
bool | matched, | ||
unsigned int | cleanFrom = 0 |
||
) | const |
Definition at line 96 of file HitExtractorSTRP.cc.
References edm::Event::getByLabel(), LogDebug, skipThis(), and ctfseeding::HitExtractor::theSkipClusters.
Referenced by hits().
{ LogDebug("HitExtractorPIX")<<"getting: "<<hits.size()<<" in input."; edm::Handle<edm::ContainerMask<edmNew::DetSetVector<SiStripCluster> > > stripClusterMask; ev.getByLabel(theSkipClusters,stripClusterMask); HitExtractor::Hits newHits; unsigned int skipped=0; unsigned int projected=0; newHits.reserve(hits.size()); TransientTrackingRecHit::ConstRecHitPointer replaceMe; for (unsigned int iH=cleanFrom;iH<hits.size();++iH){ if (!hits[iH]->isValid()) continue; replaceMe=hits[iH]; if (matched && skipThis(hits[iH],stripClusterMask,replaceMe)){ LogDebug("HitExtractorSTRP")<<"skipping a matched hit on :"<<hits[iH]->hit()->geographicalId().rawId(); skipped++; continue; } if (!matched && skipThis( ((TrackerSingleRecHit const *)(hits[iH]->hit()))->omniClusterRef(),stripClusterMask)){ LogDebug("HitExtractorSTRP")<<"skipping a hit on :"<<hits[iH]->hit()->geographicalId().rawId()<<" key: "; skipped++; continue; } if (replaceMe!=hits[iH]) projected++; newHits.push_back(replaceMe); } LogDebug("HitExtractorPIX")<<"skipped :"<<skipped<<" strip rechits because of clusters and projected: "<<projected; hits.swap(newHits); }
virtual HitExtractorSTRP* ctfseeding::HitExtractorSTRP::clone | ( | void | ) | const [inline, virtual] |
Definition at line 28 of file HitExtractorSTRP.h.
References HitExtractorSTRP().
Referenced by SeedingLayerSetsBuilder::layers().
{ return new HitExtractorSTRP(*this); }
HitExtractor::Hits HitExtractorSTRP::hits | ( | const SeedingLayer & | sl, |
const edm::Event & | ev, | ||
const edm::EventSetup & | es | ||
) | const [virtual] |
Implements ctfseeding::HitExtractor.
Definition at line 127 of file HitExtractorSTRP.cc.
References TransientTrackingRecHitBuilder::build(), cleanedOfClusters(), end, edm::Event::getByLabel(), hasMatchedHits, hasRPhiHits, hasSimpleRphiHitsCleaner, hasStereoHits, ctfseeding::SeedingLayer::hitBuilder(), LogDebug, ctfseeding::range2SeedingHits(), query::result, relativeConstraints::ring, ringRange(), ctfseeding::HitExtractor::skipClusters, TrackerLayerIdAccessor::stripTECDisk(), TrackerLayerIdAccessor::stripTIBLayer(), TrackerLayerIdAccessor::stripTIDDisk(), TrackerLayerIdAccessor::stripTOBLayer(), DetLayer::subDetector(), sistripsummary::TEC, theIdLayer, theLayer, theMatchedHits, theRPhiHits, theSide, theSLayer, theStereoHits, sistripsummary::TIB, sistripsummary::TID, and sistripsummary::TOB.
{ HitExtractor::Hits result; TrackerLayerIdAccessor accessor; theSLayer=&sl; unsigned int cleanFrom=0; // // TIB // if (theLayer->subDetector() == GeomDetEnumerators::TIB) { if (hasMatchedHits) { edm::Handle<SiStripMatchedRecHit2DCollection> matchedHits; ev.getByLabel( theMatchedHits, matchedHits); if (skipClusters) cleanFrom=result.size(); range2SeedingHits( *matchedHits, result, accessor.stripTIBLayer(theIdLayer), sl, es); if (skipClusters) cleanedOfClusters(ev,result,true,cleanFrom); } if (hasRPhiHits) { edm::Handle<SiStripRecHit2DCollection> rphiHits; ev.getByLabel( theRPhiHits, rphiHits); if (hasMatchedHits){ if (!hasSimpleRphiHitsCleaner){ // this is a brutal "cleaning". Add something smarter in the future if (skipClusters) cleanFrom=result.size(); range2SeedingHits( *rphiHits, result, accessor.stripTIBLayer(theIdLayer), sl, es); if (skipClusters) cleanedOfClusters(ev,result,false,cleanFrom); } } else { if (skipClusters) cleanFrom=result.size(); range2SeedingHits( *rphiHits, result, accessor.stripTIBLayer(theIdLayer), sl, es); if (skipClusters) cleanedOfClusters(ev,result,false,cleanFrom); } } if (hasStereoHits) { edm::Handle<SiStripRecHit2DCollection> stereoHits; ev.getByLabel( theStereoHits, stereoHits); if (skipClusters) cleanFrom=result.size(); range2SeedingHits( *stereoHits, result, accessor.stripTIBLayer(theIdLayer), sl, es); if (skipClusters) cleanedOfClusters(ev,result,false,cleanFrom); } } // // TID // else if (theLayer->subDetector() == GeomDetEnumerators::TID) { if (hasMatchedHits) { edm::Handle<SiStripMatchedRecHit2DCollection> matchedHits; ev.getByLabel( theMatchedHits, matchedHits); if (skipClusters) cleanFrom=result.size(); std::pair<DetId,DetIdTIDSameDiskComparator> getter = accessor.stripTIDDisk(theSide,theIdLayer); SiStripMatchedRecHit2DCollection::Range range = matchedHits->equal_range(getter.first, getter.second); for (SiStripMatchedRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) { int ring = TIDDetId( it->detId() ).ring(); if (!ringRange(ring)) continue; for (SiStripMatchedRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) { result.push_back( sl.hitBuilder()->build(hit) ); } } if (skipClusters) cleanedOfClusters(ev,result,true,cleanFrom); } if (hasRPhiHits) { edm::Handle<SiStripRecHit2DCollection> rphiHits; ev.getByLabel( theRPhiHits, rphiHits); if (skipClusters) cleanFrom=result.size(); std::pair<DetId,DetIdTIDSameDiskComparator> getter = accessor.stripTIDDisk(theSide,theIdLayer); SiStripRecHit2DCollection::Range range = rphiHits->equal_range(getter.first, getter.second); for (SiStripRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) { int ring = TIDDetId( it->detId() ).ring(); if (!ringRange(ring)) continue; if ((SiStripDetId(it->detId()).partnerDetId() != 0) && hasSimpleRphiHitsCleaner) continue; // this is a brutal "cleaning". Add something smarter in the future for (SiStripRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) { result.push_back( sl.hitBuilder()->build(hit) ); } } if (skipClusters) cleanedOfClusters(ev,result,false,cleanFrom); } if (hasStereoHits) { edm::Handle<SiStripRecHit2DCollection> stereoHits; ev.getByLabel( theStereoHits, stereoHits); if (skipClusters) cleanFrom=result.size(); std::pair<DetId,DetIdTIDSameDiskComparator> getter = accessor.stripTIDDisk(theSide,theIdLayer); SiStripRecHit2DCollection::Range range = stereoHits->equal_range(getter.first, getter.second); for (SiStripRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) { int ring = TIDDetId( it->detId() ).ring(); if (!ringRange(ring)) continue; for (SiStripRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) { result.push_back( sl.hitBuilder()->build(hit) ); } } if (skipClusters) cleanedOfClusters(ev,result,false,cleanFrom); } } // // TOB // else if (theLayer->subDetector() == GeomDetEnumerators::TOB) { if (hasMatchedHits) { edm::Handle<SiStripMatchedRecHit2DCollection> matchedHits; ev.getByLabel( theMatchedHits, matchedHits); if (skipClusters) cleanFrom=result.size(); range2SeedingHits( *matchedHits, result, accessor.stripTOBLayer(theIdLayer), sl, es); if (skipClusters) cleanedOfClusters(ev,result,true,cleanFrom); } if (hasRPhiHits) { edm::Handle<SiStripRecHit2DCollection> rphiHits; ev.getByLabel( theRPhiHits, rphiHits); if (hasMatchedHits){ if (!hasSimpleRphiHitsCleaner){ // this is a brutal "cleaning". Add something smarter in the future if (skipClusters) cleanFrom=result.size(); range2SeedingHits( *rphiHits, result, accessor.stripTOBLayer(theIdLayer), sl, es); if (skipClusters) cleanedOfClusters(ev,result,false,cleanFrom); } } else { if (skipClusters) cleanFrom=result.size(); range2SeedingHits( *rphiHits, result, accessor.stripTOBLayer(theIdLayer), sl, es); if (skipClusters) cleanedOfClusters(ev,result,false,cleanFrom); } } if (hasStereoHits) { edm::Handle<SiStripRecHit2DCollection> stereoHits; ev.getByLabel( theStereoHits, stereoHits); if (skipClusters) cleanFrom=result.size(); range2SeedingHits( *stereoHits, result, accessor.stripTOBLayer(theIdLayer), sl, es); if (skipClusters) cleanedOfClusters(ev,result,false,cleanFrom); } } // // TEC // else if (theLayer->subDetector() == GeomDetEnumerators::TEC) { if (hasMatchedHits) { edm::Handle<SiStripMatchedRecHit2DCollection> matchedHits; ev.getByLabel( theMatchedHits, matchedHits); if (skipClusters) cleanFrom=result.size(); std::pair<DetId,DetIdTECSameDiskComparator> getter = accessor.stripTECDisk(theSide,theIdLayer); SiStripMatchedRecHit2DCollection::Range range = matchedHits->equal_range(getter.first, getter.second); for (SiStripMatchedRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) { int ring = TECDetId( it->detId() ).ring(); if (!ringRange(ring)) continue; for (SiStripMatchedRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) { result.push_back( sl.hitBuilder()->build(hit) ); } } if (skipClusters) cleanedOfClusters(ev,result,true,cleanFrom); } if (hasRPhiHits) { edm::Handle<SiStripRecHit2DCollection> rphiHits; ev.getByLabel( theRPhiHits, rphiHits); if (skipClusters) cleanFrom=result.size(); std::pair<DetId,DetIdTECSameDiskComparator> getter = accessor.stripTECDisk(theSide,theIdLayer); SiStripRecHit2DCollection::Range range = rphiHits->equal_range(getter.first, getter.second); for (SiStripRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) { int ring = TECDetId( it->detId() ).ring(); if (!ringRange(ring)) continue; if ((SiStripDetId(it->detId()).partnerDetId() != 0) && hasSimpleRphiHitsCleaner) continue; // this is a brutal "cleaning". Add something smarter in the future for (SiStripRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) { result.push_back( sl.hitBuilder()->build(hit) ); } } if (skipClusters) cleanedOfClusters(ev,result,false,cleanFrom); } if (hasStereoHits) { edm::Handle<SiStripRecHit2DCollection> stereoHits; ev.getByLabel( theStereoHits, stereoHits); if (skipClusters) cleanFrom=result.size(); std::pair<DetId,DetIdTECSameDiskComparator> getter = accessor.stripTECDisk(theSide,theIdLayer); SiStripRecHit2DCollection::Range range = stereoHits->equal_range(getter.first, getter.second); for (SiStripRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) { int ring = TECDetId( it->detId() ).ring(); if (!ringRange(ring)) continue; for (SiStripRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) { result.push_back( sl.hitBuilder()->build(hit) ); } } if (skipClusters) cleanedOfClusters(ev,result,false,cleanFrom); } } LogDebug("HitExtractorSTRP")<<" giving: "<<result.size()<<" out"; return result; }
void HitExtractorSTRP::project | ( | TransientTrackingRecHit::ConstRecHitPointer & | ptr, |
const SiStripRecHit2D * | hit, | ||
TransientTrackingRecHit::ConstRecHitPointer & | replaceMe | ||
) | const |
Definition at line 56 of file HitExtractorSTRP.cc.
References TransientTrackingRecHitBuilder::build(), failProjection, ctfseeding::SeedingLayer::hitBuilder(), LogDebug, trackerHitRTTI::proj, TrackingRecHitProjector< ResultingHit >::project(), and theSLayer.
Referenced by skipThis().
{ if (failProjection) {replaceMe=0; return;} TrackingRecHitProjector<ProjectedRecHit2D> proj; TransientTrackingRecHit::RecHitPointer sHit=theSLayer->hitBuilder()->build(hit); replaceMe=proj.project( *sHit, *ptr->det()); if (!replaceMe) LogDebug("HitExtractorSTRP")<<"projection failed."; }
bool HitExtractorSTRP::ringRange | ( | int | ring | ) | const [private] |
Definition at line 41 of file HitExtractorSTRP.cc.
References hasRingSelector, theMaxRing, and theMinRing.
Referenced by hits().
{ if (!hasRingSelector) return true; else if ( ring >= theMinRing && ring <= theMaxRing) return true; else return false; }
void ctfseeding::HitExtractorSTRP::setNoProjection | ( | ) | const [inline] |
Definition at line 46 of file HitExtractorSTRP.h.
References failProjection.
Referenced by SeedingLayerSetsBuilder::layers().
{failProjection=true;};
bool HitExtractorSTRP::skipThis | ( | TransientTrackingRecHit::ConstRecHitPointer & | ptr, |
edm::Handle< edm::ContainerMask< edmNew::DetSetVector< SiStripCluster > > > & | stripClusterMask, | ||
TransientTrackingRecHit::ConstRecHitPointer & | replaceMe | ||
) | const |
Definition at line 67 of file HitExtractorSTRP.cc.
References LogDebug, m, project(), and alignCSCRings::s.
Referenced by cleanedOfClusters().
{ const SiStripMatchedRecHit2D * hit = (SiStripMatchedRecHit2D *) ptr->hit(); bool rejectSt = skipThis(hit->stereoClusterRef(), stripClusterMask); bool rejectMono = skipThis(hit->monoClusterRef(), stripClusterMask); if (rejectSt&&rejectMono){ //only skip if both hits are done return true; } else{ //FIX use clusters directly auto const & s= hit->stereoHit(); auto const & m= hit->monoHit(); if (rejectSt) project(ptr,&s,replaceMe); else if (rejectMono) project(ptr,&m,replaceMe); if (!replaceMe) return true; //means that the projection failed, and needs to be skipped if (rejectSt) LogDebug("HitExtractorSTRP")<<"a matched hit is partially masked, and the mono hit got projected onto: "<<replaceMe->hit()->geographicalId().rawId()<<" key: "<<hit->monoClusterRef().key(); else if (rejectMono) LogDebug("HitExtractorSTRP")<<"a matched hit is partially masked, and the stereo hit got projected onto: "<<replaceMe->hit()->geographicalId().rawId()<<" key: "<<hit->stereoClusterRef().key(); return false; //means the projection succeeded or nothing to be masked, no need to skip and replaceMe is going to be used anyways. } return false; }
bool HitExtractorSTRP::skipThis | ( | OmniClusterRef const & | clus, |
edm::Handle< edm::ContainerMask< edmNew::DetSetVector< SiStripCluster > > > & | stripClusterMask | ||
) | const |
Definition at line 48 of file HitExtractorSTRP.cc.
References OmniClusterRef::key().
{ // if (!hit->isValid()) return false; return stripClusterMask->mask(clus.key()); }
void ctfseeding::HitExtractorSTRP::useMatchedHits | ( | const edm::InputTag & | m | ) | [inline] |
Definition at line 30 of file HitExtractorSTRP.h.
References hasMatchedHits, m, and theMatchedHits.
Referenced by SeedingLayerSetsBuilder::layers().
{ hasMatchedHits = true; theMatchedHits = m; }
void HitExtractorSTRP::useRingSelector | ( | int | minRing, |
int | maxRing | ||
) |
Definition at line 34 of file HitExtractorSTRP.cc.
References hasRingSelector, theMaxRing, and theMinRing.
Referenced by SeedingLayerSetsBuilder::layers().
{ hasRingSelector=true; theMinRing=minRing; theMaxRing=maxRing; }
void ctfseeding::HitExtractorSTRP::useRPhiHits | ( | const edm::InputTag & | m | ) | [inline] |
Definition at line 31 of file HitExtractorSTRP.h.
References hasRPhiHits, m, and theRPhiHits.
Referenced by SeedingLayerSetsBuilder::layers().
{ hasRPhiHits = true; theRPhiHits = m; }
void ctfseeding::HitExtractorSTRP::useSimpleRphiHitsCleaner | ( | bool | use | ) | [inline] |
Definition at line 34 of file HitExtractorSTRP.h.
References hasSimpleRphiHitsCleaner.
Referenced by SeedingLayerSetsBuilder::layers().
{hasSimpleRphiHitsCleaner = use;}
void ctfseeding::HitExtractorSTRP::useStereoHits | ( | const edm::InputTag & | m | ) | [inline] |
Definition at line 32 of file HitExtractorSTRP.h.
References hasStereoHits, m, and theStereoHits.
Referenced by SeedingLayerSetsBuilder::layers().
{ hasStereoHits = true; theStereoHits = m; }
bool ctfseeding::HitExtractorSTRP::failProjection [mutable, private] |
Definition at line 59 of file HitExtractorSTRP.h.
Referenced by project(), and setNoProjection().
bool ctfseeding::HitExtractorSTRP::hasMatchedHits [private] |
Definition at line 54 of file HitExtractorSTRP.h.
Referenced by hits(), and useMatchedHits().
bool ctfseeding::HitExtractorSTRP::hasRingSelector [private] |
Definition at line 57 of file HitExtractorSTRP.h.
Referenced by ringRange(), and useRingSelector().
bool ctfseeding::HitExtractorSTRP::hasRPhiHits [private] |
Definition at line 55 of file HitExtractorSTRP.h.
Referenced by hits(), and useRPhiHits().
bool ctfseeding::HitExtractorSTRP::hasSimpleRphiHitsCleaner [private] |
Definition at line 58 of file HitExtractorSTRP.h.
Referenced by hits(), and useSimpleRphiHitsCleaner().
bool ctfseeding::HitExtractorSTRP::hasStereoHits [private] |
Definition at line 56 of file HitExtractorSTRP.h.
Referenced by hits(), and useStereoHits().
int ctfseeding::HitExtractorSTRP::theIdLayer [private] |
Definition at line 53 of file HitExtractorSTRP.h.
Referenced by hits().
const DetLayer* ctfseeding::HitExtractorSTRP::theLayer [private] |
Definition at line 50 of file HitExtractorSTRP.h.
Referenced by hits().
Definition at line 54 of file HitExtractorSTRP.h.
Referenced by hits(), and useMatchedHits().
int ctfseeding::HitExtractorSTRP::theMaxRing [private] |
Definition at line 57 of file HitExtractorSTRP.h.
Referenced by ringRange(), and useRingSelector().
int ctfseeding::HitExtractorSTRP::theMinRing [private] |
Definition at line 57 of file HitExtractorSTRP.h.
Referenced by ringRange(), and useRingSelector().
Definition at line 55 of file HitExtractorSTRP.h.
Referenced by hits(), and useRPhiHits().
Definition at line 51 of file HitExtractorSTRP.h.
Referenced by hits().
const SeedingLayer* ctfseeding::HitExtractorSTRP::theSLayer [mutable, private] |
Definition at line 52 of file HitExtractorSTRP.h.
Definition at line 56 of file HitExtractorSTRP.h.
Referenced by hits(), and useStereoHits().