CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
LowPtClusterShapeSeedComparitor Class Reference

#include <LowPtClusterShapeSeedComparitor.h>

Inheritance diagram for LowPtClusterShapeSeedComparitor:
SeedComparitor

Public Member Functions

bool compatible (const SeedingHitSet &hits) const override
 
bool compatible (const TrajectoryStateOnSurface &, SeedingHitSet::ConstRecHitPointer hit) const override
 
bool compatible (const SeedingHitSet &hits, const GlobalTrajectoryParameters &helixStateAtVertex, const FastHelix &helix) const override
 
void init (const edm::Event &e, const edm::EventSetup &es) override
 
 LowPtClusterShapeSeedComparitor (const edm::ParameterSet &ps, edm::ConsumesCollector &iC)
 
 ~LowPtClusterShapeSeedComparitor () override
 
- Public Member Functions inherited from SeedComparitor
virtual ~SeedComparitor ()
 

Private Attributes

const ClusterShapeHitFilterclusterShapeHitFilter_ = nullptr
 
const edm::ESGetToken
< ClusterShapeHitFilter,
CkfComponentsRecord
clusterShapeHitFilterESToken_
 
edm::Handle
< SiPixelClusterShapeCache
thePixelClusterShapeCache
 
edm::EDGetTokenT
< SiPixelClusterShapeCache
thePixelClusterShapeCacheToken
 
std::string theShapeFilterLabel_
 
const TrackerTopologytrackerTopology_ = nullptr
 
const edm::ESGetToken
< TrackerTopology,
TrackerTopologyRcd
trackerTopologyESToken_
 

Detailed Description

Definition at line 15 of file LowPtClusterShapeSeedComparitor.h.

Constructor & Destructor Documentation

LowPtClusterShapeSeedComparitor::LowPtClusterShapeSeedComparitor ( const edm::ParameterSet ps,
edm::ConsumesCollector iC 
)

Definition at line 79 of file LowPtClusterShapeSeedComparitor.cc.

82  iC.consumes<SiPixelClusterShapeCache>(ps.getParameter<edm::InputTag>("clusterShapeCacheSrc"))),
83  theShapeFilterLabel_(ps.getParameter<std::string>("clusterShapeHitFilter")),
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const edm::ESGetToken< ClusterShapeHitFilter, CkfComponentsRecord > clusterShapeHitFilterESToken_
edm::EDGetTokenT< SiPixelClusterShapeCache > thePixelClusterShapeCacheToken
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopologyESToken_
LowPtClusterShapeSeedComparitor::~LowPtClusterShapeSeedComparitor ( )
inlineoverride

Definition at line 18 of file LowPtClusterShapeSeedComparitor.h.

18 {}

Member Function Documentation

bool LowPtClusterShapeSeedComparitor::compatible ( const SeedingHitSet hits) const
overridevirtual

Implements SeedComparitor.

Definition at line 94 of file LowPtClusterShapeSeedComparitor.cc.

References cms::cuda::assert(), Exception, HitInfo::getInfo(), mps_fire::i, TrackingRecHit::isValid(), LogDebug, LogTrace, convertSQLiteXML::ok, and SeedingHitSet::size().

96 {
97  assert(hits.size() == 3);
98 
99  if (clusterShapeHitFilter_ == nullptr)
100  throw cms::Exception("LogicError") << "LowPtClusterShapeSeedComparitor: init(EventSetup) method was not called";
101 
102  // Get global positions
103  GlobalPoint globalPoss[3];
104  getGlobalPos(hits, globalPoss);
105 
106  // Get global directions
107  GlobalVector globalDirs[3];
108 
109  bool ok = getGlobalDirs(globalPoss, globalDirs);
110 
111  // Check whether shape of pixel cluster is compatible
112  // with local track direction
113 
114  if (!ok) {
115  LogDebug("LowPtClusterShapeSeedComparitor") << "curvarture 0:"
116  << "\nnHits: " << hits.size() << " will say the seed is good anyway.";
117  return true;
118  }
119 
120  for (int i = 0; i < 3; i++) {
121  const SiPixelRecHit* pixelRecHit = dynamic_cast<const SiPixelRecHit*>(hits[i]->hit());
122 
123  if (!pixelRecHit) {
124  edm::LogError("LowPtClusterShapeSeedComparitor") << "this is not a pixel cluster";
125  ok = false;
126  break;
127  }
128 
129  if (!pixelRecHit->isValid()) {
130  ok = false;
131  break;
132  }
133 
134  LogDebug("LowPtClusterShapeSeedComparitor") << "about to compute compatibility."
135  << "hit ptr: " << pixelRecHit << "global direction:" << globalDirs[i];
136 
137  if (!clusterShapeHitFilter_->isCompatible(*pixelRecHit, globalDirs[i], *thePixelClusterShapeCache)) {
138  LogTrace("LowPtClusterShapeSeedComparitor")
139  << " clusShape is not compatible" << HitInfo::getInfo(*hits[i]->hit(), trackerTopology_);
140 
141  ok = false;
142  break;
143  }
144  }
145 
146  return ok;
147 }
Log< level::Error, false > LogError
assert(be >=bs)
#define LogTrace(id)
edm::Handle< SiPixelClusterShapeCache > thePixelClusterShapeCache
bool isValid() const
bool isCompatible(const SiPixelRecHit &recHit, const LocalVector &ldir, const SiPixelClusterShapeCache &clusterShapeCache, PixelData const *pd=nullptr) const
unsigned int size() const
Definition: SeedingHitSet.h:41
const ClusterShapeHitFilter * clusterShapeHitFilter_
static std::string getInfo(const DetId &id, const TrackerTopology *tTopo)
Definition: HitInfo.cc:19
Our base class.
Definition: SiPixelRecHit.h:23
#define LogDebug(id)
bool LowPtClusterShapeSeedComparitor::compatible ( const TrajectoryStateOnSurface ,
SeedingHitSet::ConstRecHitPointer  hit 
) const
inlineoverridevirtual

Implements SeedComparitor.

Definition at line 21 of file LowPtClusterShapeSeedComparitor.h.

21  {
22  return true;
23  }
bool LowPtClusterShapeSeedComparitor::compatible ( const SeedingHitSet hits,
const GlobalTrajectoryParameters helixStateAtVertex,
const FastHelix helix 
) const
inlineoverridevirtual

Implements SeedComparitor.

Definition at line 24 of file LowPtClusterShapeSeedComparitor.h.

26  {
27  return true;
28  }
void LowPtClusterShapeSeedComparitor::init ( const edm::Event e,
const edm::EventSetup es 
)
overridevirtual

Implements SeedComparitor.

Definition at line 88 of file LowPtClusterShapeSeedComparitor.cc.

References clusterShapeHitFilter_, clusterShapeHitFilterESToken_, edm::Event::getByToken(), edm::EventSetup::getData(), thePixelClusterShapeCache, thePixelClusterShapeCacheToken, trackerTopology_, and trackerTopologyESToken_.

88  {
92 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
bool getData(T &iHolder) const
Definition: EventSetup.h:128
const edm::ESGetToken< ClusterShapeHitFilter, CkfComponentsRecord > clusterShapeHitFilterESToken_
edm::Handle< SiPixelClusterShapeCache > thePixelClusterShapeCache
edm::EDGetTokenT< SiPixelClusterShapeCache > thePixelClusterShapeCacheToken
const ClusterShapeHitFilter * clusterShapeHitFilter_
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopologyESToken_

Member Data Documentation

const ClusterShapeHitFilter* LowPtClusterShapeSeedComparitor::clusterShapeHitFilter_ = nullptr
private

Definition at line 36 of file LowPtClusterShapeSeedComparitor.h.

Referenced by init().

const edm::ESGetToken<ClusterShapeHitFilter, CkfComponentsRecord> LowPtClusterShapeSeedComparitor::clusterShapeHitFilterESToken_
private

Definition at line 34 of file LowPtClusterShapeSeedComparitor.h.

Referenced by init().

edm::Handle<SiPixelClusterShapeCache> LowPtClusterShapeSeedComparitor::thePixelClusterShapeCache
private

Definition at line 32 of file LowPtClusterShapeSeedComparitor.h.

Referenced by init().

edm::EDGetTokenT<SiPixelClusterShapeCache> LowPtClusterShapeSeedComparitor::thePixelClusterShapeCacheToken
private

Definition at line 31 of file LowPtClusterShapeSeedComparitor.h.

Referenced by init().

std::string LowPtClusterShapeSeedComparitor::theShapeFilterLabel_
private

Definition at line 33 of file LowPtClusterShapeSeedComparitor.h.

const TrackerTopology* LowPtClusterShapeSeedComparitor::trackerTopology_ = nullptr
private

Definition at line 37 of file LowPtClusterShapeSeedComparitor.h.

Referenced by init().

const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> LowPtClusterShapeSeedComparitor::trackerTopologyESToken_
private

Definition at line 35 of file LowPtClusterShapeSeedComparitor.h.

Referenced by init().