CMS 3D CMS Logo

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, CkfComponentsRecordclusterShapeHitFilterESToken_
 
edm::Handle< SiPixelClusterShapeCachethePixelClusterShapeCache
 
edm::EDGetTokenT< SiPixelClusterShapeCachethePixelClusterShapeCacheToken
 
std::string theShapeFilterLabel_
 
const TrackerTopologytrackerTopology_ = nullptr
 
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtrackerTopologyESToken_
 

Detailed Description

Definition at line 15 of file LowPtClusterShapeSeedComparitor.h.

Constructor & Destructor Documentation

◆ LowPtClusterShapeSeedComparitor()

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)
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
const edm::ESGetToken< ClusterShapeHitFilter, CkfComponentsRecord > clusterShapeHitFilterESToken_
edm::EDGetTokenT< SiPixelClusterShapeCache > thePixelClusterShapeCacheToken
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopologyESToken_

◆ ~LowPtClusterShapeSeedComparitor()

LowPtClusterShapeSeedComparitor::~LowPtClusterShapeSeedComparitor ( )
inlineoverride

Definition at line 18 of file LowPtClusterShapeSeedComparitor.h.

18 {}

Member Function Documentation

◆ compatible() [1/3]

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(), hfClusterShapes_cfi::hits, mps_fire::i, TrackingRecHit::isValid(), LogDebug, LogTrace, and convertSQLiteXML::ok.

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)
bool isCompatible(const SiPixelRecHit &recHit, const LocalVector &ldir, const SiPixelClusterShapeCache &clusterShapeCache, PixelData const *pd=nullptr) const
#define LogTrace(id)
bool isValid() const
edm::Handle< SiPixelClusterShapeCache > thePixelClusterShapeCache
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)

◆ compatible() [2/3]

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  }

◆ compatible() [3/3]

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  }

◆ init()

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_, MillePedeFileConverter_cfg::e, edm::EventSetup::getData(), thePixelClusterShapeCache, thePixelClusterShapeCacheToken, trackerTopology_, and trackerTopologyESToken_.

88  {
92 }
const edm::ESGetToken< ClusterShapeHitFilter, CkfComponentsRecord > clusterShapeHitFilterESToken_
bool getData(T &iHolder) const
Definition: EventSetup.h:122
edm::Handle< SiPixelClusterShapeCache > thePixelClusterShapeCache
edm::EDGetTokenT< SiPixelClusterShapeCache > thePixelClusterShapeCacheToken
const ClusterShapeHitFilter * clusterShapeHitFilter_
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopologyESToken_

Member Data Documentation

◆ clusterShapeHitFilter_

const ClusterShapeHitFilter* LowPtClusterShapeSeedComparitor::clusterShapeHitFilter_ = nullptr
private

Definition at line 36 of file LowPtClusterShapeSeedComparitor.h.

Referenced by init().

◆ clusterShapeHitFilterESToken_

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

Definition at line 34 of file LowPtClusterShapeSeedComparitor.h.

Referenced by init().

◆ thePixelClusterShapeCache

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

Definition at line 32 of file LowPtClusterShapeSeedComparitor.h.

Referenced by init().

◆ thePixelClusterShapeCacheToken

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

Definition at line 31 of file LowPtClusterShapeSeedComparitor.h.

Referenced by init().

◆ theShapeFilterLabel_

std::string LowPtClusterShapeSeedComparitor::theShapeFilterLabel_
private

Definition at line 33 of file LowPtClusterShapeSeedComparitor.h.

◆ trackerTopology_

const TrackerTopology* LowPtClusterShapeSeedComparitor::trackerTopology_ = nullptr
private

Definition at line 37 of file LowPtClusterShapeSeedComparitor.h.

Referenced by init().

◆ trackerTopologyESToken_

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

Definition at line 35 of file LowPtClusterShapeSeedComparitor.h.

Referenced by init().