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 Attributes
ctfseeding::HitExtractorPIX Class Reference

#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)
 
virtual HitExtractor::Hits hits (const SeedingLayer &sl, const edm::Event &, const edm::EventSetup &) const
 
virtual ~HitExtractorPIX ()
 
- Public Member Functions inherited from ctfseeding::HitExtractor
 HitExtractor ()
 
void useSkipClusters (const edm::InputTag &m)
 
virtual ~HitExtractor ()
 

Private Attributes

std::string theHitProducer
 
int theIdLayer
 
SeedingLayer::Side theSide
 

Additional Inherited Members

- Public Types inherited from ctfseeding::HitExtractor
typedef std::vector
< TransientTrackingRecHit::ConstRecHitPointer
Hits
 
- Public Attributes inherited from ctfseeding::HitExtractor
bool skipClusters
 
edm::InputTag theSkipClusters
 

Detailed Description

Definition at line 13 of file HitExtractorPIX.h.

Constructor & Destructor Documentation

HitExtractorPIX::HitExtractorPIX ( SeedingLayer::Side side,
int  idLayer,
const std::string &  hitProducer 
)
virtual ctfseeding::HitExtractorPIX::~HitExtractorPIX ( )
inlinevirtual

Definition at line 16 of file HitExtractorPIX.h.

16 {}

Member Function Documentation

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

Definition at line 18 of file HitExtractorPIX.h.

References HitExtractorPIX().

18 { return new HitExtractorPIX(*this); }
HitExtractorPIX(SeedingLayer::Side &side, int idLayer, const std::string &hitProducer)
HitExtractor::Hits HitExtractorPIX::hits ( const SeedingLayer sl,
const edm::Event ev,
const edm::EventSetup es 
) const
virtual

Implements ctfseeding::HitExtractor.

Definition at line 23 of file HitExtractorPIX.cc.

References ctfseeding::SeedingLayer::Barrel, edm::Event::getByLabel(), edm::HandleBase::id(), keep, LogDebug, TrackerLayerIdAccessor::pixelBarrelLayer(), TrackerLayerIdAccessor::pixelForwardDisk(), ctfseeding::range2SeedingHits(), query::result, ctfseeding::HitExtractor::skipClusters, theHitProducer, theIdLayer, theSide, and ctfseeding::HitExtractor::theSkipClusters.

24 {
26  TrackerLayerIdAccessor accessor;
28  ev.getByLabel( theHitProducer, pixelHits);
30  range2SeedingHits( *pixelHits, result, accessor.pixelBarrelLayer(theIdLayer), sl, es );
31  } else {
32  range2SeedingHits( *pixelHits, result, accessor.pixelForwardDisk(theSide,theIdLayer), sl, es );
33  }
34 
35 
36  if (skipClusters){
37  LogDebug("HitExtractorPIX")<<"getting : "<<result.size()<<" pixel hits.";
38  //std::cout<<" skipping"<<std::endl;
40  ev.getByLabel(theSkipClusters,pixelClusterMask);
41  std::vector<bool> keep(result.size(),true);
42  HitExtractor::Hits newHits;
43  unsigned int skipped=0;
44  if (result.empty()) return result;
45  newHits.reserve(result.size());
46  for (unsigned int iH=0;iH!=result.size();++iH){
47  if (result[iH]->hit()->isValid()){
48  SiPixelRecHit * concrete = (SiPixelRecHit *) result[iH]->hit();
49  assert(pixelClusterMask->refProd().id() == concrete->cluster().id());
50  if(pixelClusterMask->mask(concrete->cluster().key())) {
51  //too much debug LogDebug("HitExtractorPIX")<<"skipping a pixel hit on: "<< result[iH]->hit()->geographicalId().rawId()<<" key: "<<find(f->begin(),f->end(),concrete->cluster())->key();
52  skipped++;
53  continue;
54  }
55  }
56  newHits.push_back(result[iH]);
57  }
58  result.swap(newHits);
59  LogDebug("HitExtractorPIX")<<"skipped :"<<skipped<<" pixel clusters";
60  }
61  LogDebug("HitExtractorPIX")<<"giving :"<<result.size()<<" rechits out";
62  return result;
63 }
#define LogDebug(id)
ProductID id() const
Definition: HandleBase.cc:15
std::pair< DetId, DetIdPXFSameDiskComparator > pixelForwardDisk(int side, int disk)
void range2SeedingHits(DSTV const &dstv, HitExtractor::Hits &v, std::pair< A, B > const &sel, const SeedingLayer &sl, const edm::EventSetup &es)
Definition: HitExtractor.h:45
const int keep
SeedingLayer::Side theSide
tuple result
Definition: query.py:137
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
std::pair< DetId, DetIdPXBSameLayerComparator > pixelBarrelLayer(int layer)
edm::InputTag theSkipClusters
Definition: HitExtractor.h:28
Pixel Reconstructed Hit.
std::vector< TransientTrackingRecHit::ConstRecHitPointer > Hits
Definition: HitExtractor.h:16

Member Data Documentation

std::string ctfseeding::HitExtractorPIX::theHitProducer
private

Definition at line 23 of file HitExtractorPIX.h.

Referenced by hits().

int ctfseeding::HitExtractorPIX::theIdLayer
private

Definition at line 22 of file HitExtractorPIX.h.

Referenced by hits().

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

Definition at line 21 of file HitExtractorPIX.h.

Referenced by hits().