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
 

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 14 of file HitExtractorPIX.h.

Member Typedef Documentation

◆ SkipClustersCollection

Definition at line 24 of file HitExtractorPIX.h.

Constructor & Destructor Documentation

◆ HitExtractorPIX()

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

Definition at line 16 of file HitExtractorPIX.cc.

20  : theHitProducer(iC.consumes<SiPixelRecHitCollection>(hitProducer)), theSide(side), theIdLayer(idLayer) {}

Referenced by clone().

◆ ~HitExtractorPIX()

ctfseeding::HitExtractorPIX::~HitExtractorPIX ( )
inlineoverride

Definition at line 17 of file HitExtractorPIX.h.

17 {}

Member Function Documentation

◆ clone()

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

Implements ctfseeding::HitExtractor.

Definition at line 21 of file HitExtractorPIX.h.

21 { return new HitExtractorPIX(*this); }

References HitExtractorPIX().

◆ 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.

28  {
30 
32  es.get<TrackerTopologyRcd>().get(httopo);
33  const TrackerTopology& ttopo = *httopo;
34 
36  ev.getByToken(theHitProducer, pixelHits);
39  } else {
40  range2SeedingHits(*pixelHits, result, ttopo.pxfDetIdDiskComparator(static_cast<unsigned int>(theSide), theIdLayer));
41  }
42 
43  if (skipClusters) {
44  LogDebug("HitExtractorPIX") << "getting : " << result.size() << " pixel hits.";
45  //std::cout<<" skipping"<<std::endl;
46  edm::Handle<SkipClustersCollection> pixelClusterMask;
47  ev.getByToken(theSkipClusters, pixelClusterMask);
48  unsigned int skipped = 0;
49  for (unsigned int iH = 0; iH != result.size(); ++iH) {
50  if (result[iH]->isValid()) { // can be NOT valid???
51  auto const& concrete = (SiPixelRecHit const&)(*result[iH]);
52  assert(pixelClusterMask->refProd().id() == concrete.cluster().id());
53  if (pixelClusterMask->mask(concrete.cluster().key())) {
54  //too much debug LogDebug("HitExtractorPIX")<<"skipping a pixel hit on: "<< result[iH]->hit()->geographicalId().rawId()<<" key: "<<find(f->begin(),f->end(),concrete->cluster())->key();
55  skipped++;
56  result[iH].reset();
57  }
58  }
59  }
60  LogDebug("HitExtractorPIX") << "skipped :" << skipped << " pixel clusters";
61  // std::cout << "HitExtractorPIX " <<"skipped :"<<skipped<<" pixel clusters out of " << result.size() << std::endl;
62  if (skipped > 0) {
63  auto last = std::remove_if(result.begin(), result.end(), [](HitPointer const& p) { return p.empty(); });
64  result.resize(last - result.begin());
65  }
66  }
67  LogDebug("HitExtractorPIX") << "giving :" << result.size() << " rechits out";
68  // std::cout << "HitExtractorPIX "<<"giving :"<<result.size()<<" rechits out" << std::endl;
69  return result;
70 }

References cms::cuda::assert(), Barrel, ev, edm::EventSetup::get(), get, 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, and theSkipClusters.

◆ useSkipClusters_()

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

Member Data Documentation

◆ theHitProducer

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

Definition at line 28 of file HitExtractorPIX.h.

Referenced by hits().

◆ theIdLayer

int ctfseeding::HitExtractorPIX::theIdLayer
private

Definition at line 30 of file HitExtractorPIX.h.

Referenced by hits().

◆ theSide

TrackerDetSide ctfseeding::HitExtractorPIX::theSide
private

Definition at line 29 of file HitExtractorPIX.h.

Referenced by hits().

◆ theSkipClusters

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

Definition at line 27 of file HitExtractorPIX.h.

Referenced by hits(), and useSkipClusters_().

edm::RefProd::id
ProductID id() const
Accessor for product ID.
Definition: RefProd.h:124
ctfseeding::HitExtractor::skipClusters
bool skipClusters
Definition: HitExtractor.h:44
TrackerTopology
Definition: TrackerTopology.h:16
cms::cuda::assert
assert(be >=bs)
TrackerTopology::pxfDetIdDiskComparator
std::pair< DetId, SameLayerComparator > pxfDetIdDiskComparator(uint32_t side, uint32_t disk) const
Definition: TrackerTopology.h:536
edm::Handle
Definition: AssociativeIterator.h:50
SiPixelRecHit
Our base class.
Definition: SiPixelRecHit.h:23
ctfseeding::HitExtractorPIX::theHitProducer
edm::EDGetTokenT< SiPixelRecHitCollection > theHitProducer
Definition: HitExtractorPIX.h:28
ctfseeding::HitExtractor::HitPointer
mayown_ptr< BaseTrackerRecHit > HitPointer
Definition: HitExtractor.h:27
dqmdumpme.last
last
Definition: dqmdumpme.py:56
TrackerDetSide::Barrel
ctfseeding::HitExtractorPIX::theIdLayer
int theIdLayer
Definition: HitExtractorPIX.h:30
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:79
edm::ESHandle< TrackerTopology >
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
sistrip::SpyUtilities::isValid
const bool isValid(const Frame &aFrame, const FrameQuality &aQuality, const uint16_t aExpectedPos)
Definition: SiStripSpyUtilities.cc:124
ctfseeding::range2SeedingHits
void range2SeedingHits(DSTV const &dstv, HitExtractor::Hits &v, std::pair< A, B > const &sel)
Definition: HitExtractor.h:54
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
TrackerTopology::pxbDetIdLayerComparator
std::pair< DetId, SameLayerComparator > pxbDetIdLayerComparator(uint32_t layer) const
Definition: TrackerTopology.h:532
edm::ContainerMask::refProd
const edm::RefProd< T > & refProd() const
Definition: ContainerMask.h:55
get
#define get
ctfseeding::HitExtractor::Hits
std::vector< HitPointer > Hits
Definition: HitExtractor.h:28
edmNew::DetSetVector
Definition: DetSetNew.h:13
ev
bool ev
Definition: Hydjet2Hadronizer.cc:97
ctfseeding::HitExtractorPIX::SkipClustersCollection
edm::ContainerMask< edmNew::DetSetVector< SiPixelCluster > > SkipClustersCollection
Definition: HitExtractorPIX.h:24
ctfseeding::HitExtractorPIX::HitExtractorPIX
HitExtractorPIX(TrackerDetSide side, int idLayer, const std::string &hitProducer, edm::ConsumesCollector &iC)
Definition: HitExtractorPIX.cc:16
mps_fire.result
result
Definition: mps_fire.py:311
edm::ContainerMask::mask
bool mask(unsigned int iIndex) const
Definition: ContainerMask.h:43
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
runEdmFileComparison.skipped
skipped
Definition: runEdmFileComparison.py:224
ctfseeding::HitExtractorPIX::theSkipClusters
edm::EDGetTokenT< SkipClustersCollection > theSkipClusters
Definition: HitExtractorPIX.h:27
InitialStepPreSplitting_cff.pixelHits
pixelHits
Definition: InitialStepPreSplitting_cff.py:142
ctfseeding::HitExtractorPIX::theSide
TrackerDetSide theSide
Definition: HitExtractorPIX.h:29
edm::ProductID::id
ProductIndex id() const
Definition: ProductID.h:35