CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
ctfseeding::HitExtractorPIX Class Referencefinal

#include <HitExtractorPIX.h>

Inheritance diagram for ctfseeding::HitExtractorPIX:
ctfseeding::HitExtractor

Public Member Functions

HitExtractorPIXclone () const override
 
 HitExtractorPIX (TrackerDetSide side, int idLayer, const std::string &hitProducer, edm::ConsumesCollector &iC)
 
HitExtractor::Hits hits (const TkTransientTrackingRecHitBuilder &ttrhBuilder, const edm::Event &, const edm::EventSetup &) const override
 
 ~HitExtractorPIX () override
 
- Public Member Functions inherited from ctfseeding::HitExtractor
 HitExtractor ()
 
void useSkipClusters (const edm::InputTag &m, edm::ConsumesCollector &iC)
 
virtual ~HitExtractor ()
 

Private Types

typedef edm::ContainerMask< edmNew::DetSetVector< SiPixelCluster > > SkipClustersCollection
 

Private Member Functions

void useSkipClusters_ (const edm::InputTag &m, edm::ConsumesCollector &iC) override
 

Private Attributes

edm::EDGetTokenT< SiPixelRecHitCollectiontheHitProducer
 
int theIdLayer
 
TrackerDetSide theSide
 
edm::EDGetTokenT< SkipClustersCollectiontheSkipClusters
 
edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtheTtopo
 

Additional Inherited Members

- Public Types inherited from ctfseeding::HitExtractor
using HitPointer = mayown_ptr< BaseTrackerRecHit >
 
using Hits = std::vector< HitPointer >
 
using TkHit = BaseTrackerRecHit
 
using TkHitRef = BaseTrackerRecHit const &
 
- Public Attributes inherited from ctfseeding::HitExtractor
bool filterCluster = false
 
bool maskCluster = false
 
float minGoodCharge = 0
 
bool skipClusters = false
 

Detailed Description

Definition at line 16 of file HitExtractorPIX.h.

Member Typedef Documentation

◆ SkipClustersCollection

Definition at line 26 of file HitExtractorPIX.h.

Constructor & Destructor Documentation

◆ HitExtractorPIX()

HitExtractorPIX::HitExtractorPIX ( TrackerDetSide  side,
int  idLayer,
const std::string &  hitProducer,
edm::ConsumesCollector iC 
)

Definition at line 13 of file HitExtractorPIX.cc.

Referenced by clone().

18  theTtopo(iC.esConsumes()),
19  theSide(side),
20  theIdLayer(idLayer) {}
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< SiPixelRecHitCollection > theHitProducer
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > theTtopo

◆ ~HitExtractorPIX()

ctfseeding::HitExtractorPIX::~HitExtractorPIX ( )
inlineoverride

Definition at line 19 of file HitExtractorPIX.h.

19 {}

Member Function Documentation

◆ clone()

HitExtractorPIX* ctfseeding::HitExtractorPIX::clone ( void  ) const
inlineoverridevirtual

Implements ctfseeding::HitExtractor.

Definition at line 23 of file HitExtractorPIX.h.

References HitExtractorPIX().

23 { return new HitExtractorPIX(*this); }
HitExtractorPIX(TrackerDetSide side, int idLayer, const std::string &hitProducer, edm::ConsumesCollector &iC)

◆ hits()

HitExtractor::Hits HitExtractorPIX::hits ( const TkTransientTrackingRecHitBuilder ttrhBuilder,
const edm::Event ev,
const edm::EventSetup es 
) const
overridevirtual

Implements ctfseeding::HitExtractor.

Definition at line 26 of file HitExtractorPIX.cc.

References cms::cuda::assert(), Barrel, makeMEIFBenchmarkPlots::ev, edm::EventSetup::getData(), edm::ProductID::id(), edm::RefProd< C >::id(), sistrip::SpyUtilities::isValid(), dqmdumpme::last, LogDebug, edm::ContainerMask< T >::mask(), AlCaHLTBitMon_ParallelJobs::p, InitialStepPreSplitting_cff::pixelHits, TrackerTopology::pxbDetIdLayerComparator(), TrackerTopology::pxfDetIdDiskComparator(), ctfseeding::range2SeedingHits(), edm::ContainerMask< T >::refProd(), mps_fire::result, ctfseeding::HitExtractor::skipClusters, runEdmFileComparison::skipped, theHitProducer, theIdLayer, theSide, theSkipClusters, and theTtopo.

28  {
30 
31  const TrackerTopology& ttopo = es.getData(theTtopo);
32 
34  ev.getByToken(theHitProducer, pixelHits);
37  } else {
38  range2SeedingHits(*pixelHits, result, ttopo.pxfDetIdDiskComparator(static_cast<unsigned int>(theSide), theIdLayer));
39  }
40 
41  if (skipClusters) {
42  LogDebug("HitExtractorPIX") << "getting : " << result.size() << " pixel hits.";
43  //std::cout<<" skipping"<<std::endl;
44  edm::Handle<SkipClustersCollection> pixelClusterMask;
45  ev.getByToken(theSkipClusters, pixelClusterMask);
46  unsigned int skipped = 0;
47  for (unsigned int iH = 0; iH != result.size(); ++iH) {
48  if (result[iH]->isValid()) { // can be NOT valid???
49  auto const& concrete = (SiPixelRecHit const&)(*result[iH]);
50  assert(pixelClusterMask->refProd().id() == concrete.cluster().id());
51  if (pixelClusterMask->mask(concrete.cluster().key())) {
52  //too much debug LogDebug("HitExtractorPIX")<<"skipping a pixel hit on: "<< result[iH]->hit()->geographicalId().rawId()<<" key: "<<find(f->begin(),f->end(),concrete->cluster())->key();
53  skipped++;
54  result[iH].reset();
55  }
56  }
57  }
58  LogDebug("HitExtractorPIX") << "skipped :" << skipped << " pixel clusters";
59  // std::cout << "HitExtractorPIX " <<"skipped :"<<skipped<<" pixel clusters out of " << result.size() << std::endl;
60  if (skipped > 0) {
61  auto last = std::remove_if(result.begin(), result.end(), [](HitPointer const& p) { return p.empty(); });
62  result.resize(last - result.begin());
63  }
64  }
65  LogDebug("HitExtractorPIX") << "giving :" << result.size() << " rechits out";
66  // std::cout << "HitExtractorPIX "<<"giving :"<<result.size()<<" rechits out" << std::endl;
67  return result;
68 }
void range2SeedingHits(DSTV const &dstv, HitExtractor::Hits &v, std::pair< A, B > const &sel)
Definition: HitExtractor.h:54
std::pair< DetId, SameLayerComparator > pxbDetIdLayerComparator(uint32_t layer) const
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
const bool isValid(const Frame &aFrame, const FrameQuality &aQuality, const uint16_t aExpectedPos)
std::vector< HitPointer > Hits
Definition: HitExtractor.h:28
assert(be >=bs)
edm::EDGetTokenT< SiPixelRecHitCollection > theHitProducer
mayown_ptr< BaseTrackerRecHit > HitPointer
Definition: HitExtractor.h:27
std::pair< DetId, SameLayerComparator > pxfDetIdDiskComparator(uint32_t side, uint32_t disk) const
ProductID id() const
Accessor for product ID.
Definition: RefProd.h:124
ProductIndex id() const
Definition: ProductID.h:35
const edm::RefProd< T > & refProd() const
Definition: ContainerMask.h:55
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > theTtopo
edm::EDGetTokenT< SkipClustersCollection > theSkipClusters
bool mask(unsigned int iIndex) const
Definition: ContainerMask.h:43
Our base class.
Definition: SiPixelRecHit.h:23
#define LogDebug(id)

◆ useSkipClusters_()

void HitExtractorPIX::useSkipClusters_ ( const edm::InputTag m,
edm::ConsumesCollector iC 
)
overrideprivatevirtual

Implements ctfseeding::HitExtractor.

Definition at line 22 of file HitExtractorPIX.cc.

References edm::ConsumesCollector::consumes(), visualization-live-secondInstance_cfg::m, and theSkipClusters.

22  {
24 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::ContainerMask< edmNew::DetSetVector< SiPixelCluster > > SkipClustersCollection
edm::EDGetTokenT< SkipClustersCollection > theSkipClusters

Member Data Documentation

◆ theHitProducer

edm::EDGetTokenT<SiPixelRecHitCollection> ctfseeding::HitExtractorPIX::theHitProducer
private

Definition at line 30 of file HitExtractorPIX.h.

Referenced by hits().

◆ theIdLayer

int ctfseeding::HitExtractorPIX::theIdLayer
private

Definition at line 33 of file HitExtractorPIX.h.

Referenced by hits().

◆ theSide

TrackerDetSide ctfseeding::HitExtractorPIX::theSide
private

Definition at line 32 of file HitExtractorPIX.h.

Referenced by hits().

◆ theSkipClusters

edm::EDGetTokenT<SkipClustersCollection> ctfseeding::HitExtractorPIX::theSkipClusters
private

Definition at line 29 of file HitExtractorPIX.h.

Referenced by hits(), and useSkipClusters_().

◆ theTtopo

edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> ctfseeding::HitExtractorPIX::theTtopo
private

Definition at line 31 of file HitExtractorPIX.h.

Referenced by hits().