CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

virtual HitExtractorPIXclone () const
 
 HitExtractorPIX (SeedingLayer::Side &side, int idLayer, const std::string &hitProducer, edm::ConsumesCollector &iC)
 
virtual HitExtractor::Hits hits (const TkTransientTrackingRecHitBuilder &ttrhBuilder, const edm::Event &, const edm::EventSetup &) const override
 
virtual ~HitExtractorPIX ()
 
- 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
< SiPixelRecHitCollection
theHitProducer
 
int theIdLayer
 
SeedingLayer::Side theSide
 
edm::EDGetTokenT
< SkipClustersCollection
theSkipClusters
 

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

Definition at line 22 of file HitExtractorPIX.h.

Constructor & Destructor Documentation

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

Definition at line 16 of file HitExtractorPIX.cc.

Referenced by clone().

19 { }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< SiPixelRecHitCollection > theHitProducer
SeedingLayer::Side theSide
virtual ctfseeding::HitExtractorPIX::~HitExtractorPIX ( )
inlinevirtual

Definition at line 17 of file HitExtractorPIX.h.

17 {}

Member Function Documentation

virtual HitExtractorPIX* ctfseeding::HitExtractorPIX::clone ( void  ) const
inlinevirtual

Implements ctfseeding::HitExtractor.

Definition at line 19 of file HitExtractorPIX.h.

References HitExtractorPIX().

19 { return new HitExtractorPIX(*this); }
HitExtractorPIX(SeedingLayer::Side &side, int idLayer, const std::string &hitProducer, edm::ConsumesCollector &iC)
HitExtractor::Hits HitExtractorPIX::hits ( const TkTransientTrackingRecHitBuilder ttrhBuilder,
const edm::Event ev,
const edm::EventSetup es 
) const
overridevirtual

Implements ctfseeding::HitExtractor.

Definition at line 25 of file HitExtractorPIX.cc.

References assert(), ctfseeding::SeedingLayer::Barrel, edm::EventSetup::get(), edm::Event::getByToken(), edm::HandleBase::id(), prof2calltree::last, LogDebug, AlCaHLTBitMon_ParallelJobs::p, TrackerTopology::pxbDetIdLayerComparator(), TrackerTopology::pxfDetIdDiskComparator(), ctfseeding::range2SeedingHits(), query::result, ctfseeding::HitExtractor::skipClusters, theHitProducer, theIdLayer, theSide, and theSkipClusters.

26 {
28 
30  es.get<TrackerTopologyRcd>().get(httopo);
31  const TrackerTopology& ttopo = *httopo;
32 
34  ev.getByToken( theHitProducer, pixelHits);
36  range2SeedingHits( *pixelHits, result, ttopo.pxbDetIdLayerComparator(theIdLayer));
37  } else {
38  range2SeedingHits( *pixelHits, result, ttopo.pxfDetIdDiskComparator(theSide,theIdLayer));
39  }
40 
41 
42  if (skipClusters){
43  LogDebug("HitExtractorPIX")<<"getting : "<<result.size()<<" pixel hits.";
44  //std::cout<<" skipping"<<std::endl;
45  edm::Handle<SkipClustersCollection> pixelClusterMask;
46  ev.getByToken(theSkipClusters,pixelClusterMask);
47  unsigned int skipped=0;
48  for (unsigned int iH=0;iH!=result.size();++iH){
49  if (result[iH]->isValid()){ // can be NOT valid???
50  auto const & concrete = (SiPixelRecHit const&)(*result[iH]);
51  assert(pixelClusterMask->refProd().id() == concrete.cluster().id());
52  if(pixelClusterMask->mask(concrete.cluster().key())) {
53  //too much debug LogDebug("HitExtractorPIX")<<"skipping a pixel hit on: "<< result[iH]->hit()->geographicalId().rawId()<<" key: "<<find(f->begin(),f->end(),concrete->cluster())->key();
54  skipped++;
55  result[iH].reset();
56  }
57  }
58  }
59  LogDebug("HitExtractorPIX")<<"skipped :"<<skipped<<" pixel clusters";
60  // std::cout << "HitExtractorPIX " <<"skipped :"<<skipped<<" pixel clusters out of " << result.size() << std::endl;
61  if (skipped>0) {
62  auto last = std::remove_if(result.begin(),result.end(),[]( HitPointer const & p) {return p.empty();});
63  result.resize(last-result.begin());
64  }
65  }
66  LogDebug("HitExtractorPIX")<<"giving :"<<result.size()<<" rechits out";
67  // std::cout << "HitExtractorPIX "<<"giving :"<<result.size()<<" rechits out" << std::endl;
68  return result;
69 }
#define LogDebug(id)
void range2SeedingHits(DSTV const &dstv, HitExtractor::Hits &v, std::pair< A, B > const &sel)
Definition: HitExtractor.h:49
std::vector< HitPointer > Hits
Definition: HitExtractor.h:25
std::pair< DetId, SameLayerComparator > pxfDetIdDiskComparator(uint32_t side, uint32_t disk) const
ProductID id() const
Definition: HandleBase.cc:15
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
assert(m_qm.get())
edm::EDGetTokenT< SiPixelRecHitCollection > theHitProducer
mayown_ptr< BaseTrackerRecHit > HitPointer
Definition: HitExtractor.h:24
SeedingLayer::Side theSide
tuple result
Definition: query.py:137
const T & get() const
Definition: EventSetup.h:56
edm::EDGetTokenT< SkipClustersCollection > theSkipClusters
std::pair< DetId, SameLayerComparator > pxbDetIdLayerComparator(uint32_t layer) const
Our base class.
Definition: SiPixelRecHit.h:23
void HitExtractorPIX::useSkipClusters_ ( const edm::InputTag m,
edm::ConsumesCollector iC 
)
overrideprivatevirtual

Implements ctfseeding::HitExtractor.

Definition at line 21 of file HitExtractorPIX.cc.

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

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

Member Data Documentation

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

Definition at line 26 of file HitExtractorPIX.h.

Referenced by hits().

int ctfseeding::HitExtractorPIX::theIdLayer
private

Definition at line 28 of file HitExtractorPIX.h.

Referenced by hits().

SeedingLayer::Side ctfseeding::HitExtractorPIX::theSide
private

Definition at line 27 of file HitExtractorPIX.h.

Referenced by hits().

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

Definition at line 25 of file HitExtractorPIX.h.

Referenced by hits(), and useSkipClusters_().