317 ProductID pixelOldProdID, stripOldProdID;
333 auto_ptr<ClusterRemovalInfo> cri;
344 if ( (oldRemovalInfo->stripNewRefProd().
id() == stripClusters.
id()) &&
345 (oldRemovalInfo->pixelNewRefProd().
id() == pixelClusters.
id()) ) {
347 cri->getOldClustersFrom(*oldRemovalInfo);
349 pixelOldProdID = oldRemovalInfo->pixelRefProd().
id();
350 stripOldProdID = oldRemovalInfo->stripRefProd().
id();
353 throw cms::Exception(
"Inconsistent Data") <<
"TrackClusterRemover: " <<
354 "Input collection product IDs are [pixel: " << pixelClusters.
id() <<
", strip: " << stripClusters.
id() <<
"] \n" <<
355 "\t but the *old* ClusterRemovalInfo " <<
oldRemovalInfo_.
encode() <<
" refers as 'new product ids' to " <<
356 "[pixel: " << oldRemovalInfo->pixelNewRefProd().
id() <<
", strip: " << oldRemovalInfo->stripNewRefProd().
id() <<
"]\n" <<
357 "NOTA BENE: when running TrackClusterRemover with an old ClusterRemovalInfo the hits in the trajectory MUST be already re-keyed.\n";
375 for (;asst!=trajectories_totrack->end();++asst){
380 const vector<TrajectoryMeasurement> &tms = tj.
measurements();
381 vector<TrajectoryMeasurement>::const_iterator itm, endtm;
382 for (itm = tms.begin(), endtm = tms.end(); itm != endtm; ++itm) {
385 process( hit, itm->estimate() );
391 auto_ptr<edmNew::DetSetVector<SiPixelCluster> > newPixelClusters =
cleanup(*pixelClusters,
pixels,
392 cri->pixelIndices(),
mergeOld_ ? &oldRemovalInfo->pixelIndices() : 0);
395 cri->setNewPixelClusters(newPixels);
398 auto_ptr<edmNew::DetSetVector<SiStripCluster> > newStripClusters =
cleanup(*stripClusters,
strips,
399 cri->stripIndices(),
mergeOld_ ? &oldRemovalInfo->stripIndices() : 0);
402 cri->setNewStripClusters(newStrips);
424 LogDebug(
"TrackClusterRemover")<<
"to merge in, "<<oldStrRef->size()<<
" strp and "<<oldPxlRef->size()<<
" pxl";
429 uint32_t
id = itOld->detId();
433 for (
std::map<uint32_t, std::set< SiStripRecHit1D::ClusterRef > >::iterator itskiped=
collectedStrip.begin();
436 for (std::set< SiStripRecHit1D::ClusterRef >::iterator topush = itskiped->second.begin();
437 topush!=itskiped->second.end();++topush){
438 fill.push_back(*topush);
439 LogDebug(
"TrackClusterRemover")<<
"registering strp ref to be skip on: "<<itskiped->first<<
" key: "<<topush->key();
441 if (fill.empty()) fill.abort();
442 itskiped->second.clear();
444 LogDebug(
"TrackClusterRemover")<<
"total strip to skip: "<<removedStripClsuterRefs->size();
445 iEvent.
put( removedStripClsuterRefs );
449 uint32_t
id = itOld->detId();
454 for (
std::map<uint32_t, std::set< SiPixelRecHit::ClusterRef > >::iterator itskiped=
collectedPixel.begin();
457 for (std::set< SiPixelRecHit::ClusterRef >::iterator topush = itskiped->second.begin();
458 topush!=itskiped->second.end();++topush){
459 fill.push_back(*topush);
460 LogDebug(
"TrackClusterRemover")<<
"registering pxk ref to be skip on: "<<itskiped->first<<
" key: "<<topush->key();
462 if (fill.empty()) fill.abort();
463 itskiped->second.clear();
465 LogDebug(
"TrackClusterRemover")<<
"total pxl to skip: "<<removedPixelClsuterRefs->size();
466 iEvent.
put( removedPixelClsuterRefs );
edm::InputTag stripClusters_
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
edm::InputTag pixelClusters_
void process(const TrackingRecHit *hit, float chi2)
std::map< uint32_t, std::set< SiPixelRecHit::ClusterRef > > collectedPixel
reco::TrackBase::TrackQuality trackQuality_
edm::InputTag oldRemovalInfo_
DataContainer const & measurements() const
edm::ProductID stripSourceProdID
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
std::vector< uint8_t > pixels
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
bool clusterWasteSolution_
edm::InputTag trajectories_
std::vector< uint8_t > strips
std::map< uint32_t, std::set< SiStripRecHit1D::ClusterRef > > collectedStrip
bool quality(const TrackQuality) const
Track quality.
edm::ProductID pixelSourceProdID
std::auto_ptr< edmNew::DetSetVector< T > > cleanup(const edmNew::DetSetVector< T > &oldClusters, const std::vector< uint8_t > &isGood, reco::ClusterRemovalInfo::Indices &refs, const reco::ClusterRemovalInfo::Indices *oldRefs)