#include <PixelTripletLowPtGenerator.h>
Definition at line 25 of file PixelTripletLowPtGenerator.h.
typedef CombinedHitTripletGenerator::LayerCacheType PixelTripletLowPtGenerator::LayerCacheType [private] |
Reimplemented from HitTripletGeneratorFromPairAndLayers.
Definition at line 28 of file PixelTripletLowPtGenerator.h.
PixelTripletLowPtGenerator::PixelTripletLowPtGenerator | ( | const edm::ParameterSet & | cfg | ) | [inline] |
Definition at line 31 of file PixelTripletLowPtGenerator.h.
References theFilter, and theTracker.
: ps(cfg), thePairGenerator(0), theLayerCache(0) { theTracker = 0; theFilter = 0; }
virtual PixelTripletLowPtGenerator::~PixelTripletLowPtGenerator | ( | ) | [inline, virtual] |
Definition at line 35 of file PixelTripletLowPtGenerator.h.
References theFilter, and thePairGenerator.
{ delete thePairGenerator; delete theFilter; }
GlobalPoint PixelTripletLowPtGenerator::getGlobalPosition | ( | const TrackingRecHit * | recHit | ) | [private] |
Definition at line 58 of file PixelTripletLowPtGenerator.cc.
References TrackingRecHit::geographicalId(), and TrackingRecHit::localPosition().
{ DetId detId = recHit->geographicalId(); return theTracker->idToDet(detId)->toGlobal(recHit->localPosition()); }
void PixelTripletLowPtGenerator::getTracker | ( | const edm::EventSetup & | es | ) | [private] |
Definition at line 39 of file PixelTripletLowPtGenerator.cc.
References edm::EventSetup::get(), edm::ESHandle< T >::product(), and patCandidatesForDimuonsSequences_cff::tracker.
{ if(theTracker == 0) { // Get tracker geometry edm::ESHandle<TrackerGeometry> tracker; es.get<TrackerDigiGeometryRecord>().get(tracker); theTracker = tracker.product(); } if(theFilter == 0) { theFilter = new TripletFilter(es); } }
void PixelTripletLowPtGenerator::hitTriplets | ( | const TrackingRegion & | region, |
OrderedHitTriplets & | trs, | ||
const edm::Event & | ev, | ||
const edm::EventSetup & | es | ||
) | [virtual] |
Implements HitTripletGenerator.
Definition at line 67 of file PixelTripletLowPtGenerator.cc.
References benchmark_cfg::cerr, ctfseeding::SeedingLayer::detLayer(), HitInfo::getInfo(), ThirdHitPrediction::getRanges(), RecHitsSortedInPhi::hits(), i, ThirdHitPrediction::isCompatibleWithMultipleScattering(), DetLayer::location(), PixelRecoRange< T >::max(), PixelRecoRange< T >::min(), phi, findQualityFiles::size, OrderedHitPairs::size(), and DetLayer::subDetector().
{ // Generate pairs OrderedHitPairs pairs; pairs.reserve(30000); thePairGenerator->hitPairs(region,pairs,ev,es); if (pairs.size() == 0) return; int size = theLayers.size(); // Set aliases const RecHitsSortedInPhi **thirdHitMap = new const RecHitsSortedInPhi*[size]; for(int il=0; il<size; il++) thirdHitMap[il] = &(*theLayerCache)(&theLayers[il], region, ev, es); // Get tracker getTracker(es); // Look at all generated pairs for(OrderedHitPairs::const_iterator ip = pairs.begin(); ip!= pairs.end(); ip++) { // Fill rechits and points vector<const TrackingRecHit*> recHits(3); vector<GlobalPoint> points(3); recHits[0] = (*ip).inner()->hit(); recHits[1] = (*ip).outer()->hit(); #ifdef Debug cerr << " RecHits " + HitInfo::getInfo(*recHits[0]) + HitInfo::getInfo(*recHits[1]) << endl; #endif for(int i=0; i<2; i++) points[i] = getGlobalPosition(recHits[i]); // Initialize helix prediction ThirdHitPrediction thePrediction(region, points[0],points[1], es, nSigMultipleScattering,maxAngleRatio,builderName); // Look at all layers for(int il=0; il<size; il++) { const SeedingLayer & layerwithhits = theLayers[il]; const DetLayer * layer = layerwithhits.detLayer(); #ifdef Debug cerr << " check layer " << layer->subDetector() << " " << layer->location() << endl; #endif // Get ranges for the third hit float phi[2],rz[2]; thePrediction.getRanges(layer, phi,rz); PixelRecoRange<float> phiRange(phi[0] , phi[1] ); PixelRecoRange<float> rzRange( rz[0] - rzTolerance, rz[1] + rzTolerance); // Get third hit candidates from cache typedef RecHitsSortedInPhi::Hit Hit; vector<Hit> thirdHits = thirdHitMap[il]->hits(phiRange.min(),phiRange.max()); typedef vector<Hit>::const_iterator IH; for (IH th=thirdHits.begin(), eh=thirdHits.end(); th < eh; ++th) { // Fill rechit and point recHits[2] = (*th)->hit(); points[2] = getGlobalPosition(recHits[2]); #ifdef Debug cerr << " third hit " + HitInfo::getInfo(*recHits[2]) << endl; #endif // Check if third hit is compatible with multiple scattering vector<GlobalVector> globalDirs; if(thePrediction.isCompatibleWithMultipleScattering (points[2], recHits, globalDirs, es) == false) { #ifdef Debug cerr << " not compatible: multiple scattering" << endl; #endif if(checkMultipleScattering) continue; } // Convert to localDirs /* vector<LocalVector> localDirs; vector<GlobalVector>::const_iterator globalDir = globalDirs.begin(); for(vector<const TrackingRecHit *>::const_iterator recHit = recHits.begin(); recHit != recHits.end(); recHit++) { localDirs.push_back(theTracker->idToDet( (*recHit)->geographicalId())->toLocal(*globalDir)); globalDir++; } */ // Check if the cluster shapes are compatible with thrusts if(checkClusterShape) { if(! theFilter->checkTrack(recHits,globalDirs)) { #ifdef Debug cerr << " not compatible: cluster shape" << endl; #endif continue; } } // All checks passed, put triplet back result.push_back(OrderedHitTriplet((*ip).inner(),(*ip).outer(),*th)); } } } delete [] thirdHitMap; return; }
virtual void PixelTripletLowPtGenerator::init | ( | const HitPairGenerator & | pairs, |
const std::vector< ctfseeding::SeedingLayer > & | layers, | ||
LayerCacheType * | layerCache | ||
) | [virtual] |
Implements HitTripletGeneratorFromPairAndLayers.
const HitPairGenerator& PixelTripletLowPtGenerator::pairGenerator | ( | ) | const [inline] |
Definition at line 42 of file PixelTripletLowPtGenerator.h.
References thePairGenerator.
{ return *thePairGenerator; }
const std::vector<ctfseeding::SeedingLayer>& PixelTripletLowPtGenerator::thirdLayers | ( | ) | const [inline] |
Definition at line 43 of file PixelTripletLowPtGenerator.h.
References theLayers.
{ return theLayers; }
std::string PixelTripletLowPtGenerator::builderName [private] |
Definition at line 63 of file PixelTripletLowPtGenerator.h.
bool PixelTripletLowPtGenerator::checkClusterShape [private] |
Definition at line 59 of file PixelTripletLowPtGenerator.h.
bool PixelTripletLowPtGenerator::checkMultipleScattering [private] |
Definition at line 57 of file PixelTripletLowPtGenerator.h.
double PixelTripletLowPtGenerator::maxAngleRatio [private] |
Definition at line 61 of file PixelTripletLowPtGenerator.h.
double PixelTripletLowPtGenerator::nSigMultipleScattering [private] |
Definition at line 58 of file PixelTripletLowPtGenerator.h.
Definition at line 52 of file PixelTripletLowPtGenerator.h.
double PixelTripletLowPtGenerator::rzTolerance [private] |
Definition at line 60 of file PixelTripletLowPtGenerator.h.
Definition at line 50 of file PixelTripletLowPtGenerator.h.
Referenced by PixelTripletLowPtGenerator(), and ~PixelTripletLowPtGenerator().
Definition at line 55 of file PixelTripletLowPtGenerator.h.
std::vector<ctfseeding::SeedingLayer> PixelTripletLowPtGenerator::theLayers [private] |
Definition at line 54 of file PixelTripletLowPtGenerator.h.
Referenced by thirdLayers().
Definition at line 53 of file PixelTripletLowPtGenerator.h.
Referenced by pairGenerator(), and ~PixelTripletLowPtGenerator().
const TrackerGeometry* PixelTripletLowPtGenerator::theTracker [private] |
Definition at line 49 of file PixelTripletLowPtGenerator.h.
Referenced by PixelTripletLowPtGenerator().