CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
StripSubClusterShapeSeedFilter Class Reference

#include <StripSubClusterShapeTrajectoryFilter.h>

Inheritance diagram for StripSubClusterShapeSeedFilter:
StripSubClusterShapeFilterBase SeedComparitor

Public Member Functions

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

Protected Attributes

bool filterAtHelixStage_
 
- Protected Attributes inherited from StripSubClusterShapeFilterBase
std::string label_
 
std::array< std::array< uint8_t, 10 >, 7 > layerMask_
 
uint32_t maxNSat_
 
float maxTrimmedSizeDiffNeg_
 
float maxTrimmedSizeDiffPos_
 
float seedCutMIPs_
 
float seedCutSN_
 
float subclusterCutMIPs_
 
float subclusterCutSN_
 
float subclusterWindow_
 
edm::ESHandle< ClusterShapeHitFiltertheFilter
 
edm::ESHandle< SiStripNoisestheNoise
 
edm::ESHandle< TrackerTopologytheTopology
 
edm::ESHandle< TrackerGeometrytheTracker
 
uint8_t trimMaxADC_
 
float trimMaxFracNeigh_
 
float trimMaxFracTotal_
 

Additional Inherited Members

- Protected Member Functions inherited from StripSubClusterShapeFilterBase
void setEventBase (const edm::Event &, const edm::EventSetup &)
 
bool testLastHit (const TrackingRecHit *hit, const TrajectoryStateOnSurface &tsos, bool mustProject=false) const
 
bool testLastHit (const TrackingRecHit *hit, const GlobalPoint &gpos, const GlobalVector &gdir, bool mustProject=false) const
 

Detailed Description

Definition at line 93 of file StripSubClusterShapeTrajectoryFilter.h.

Constructor & Destructor Documentation

StripSubClusterShapeSeedFilter::StripSubClusterShapeSeedFilter ( const edm::ParameterSet iConfig,
edm::ConsumesCollector iC 
)

Definition at line 347 of file StripSubClusterShapeTrajectoryFilter.cc.

References compatible().

Referenced by StripSubClusterShapeTrajectoryFilter::qualityFilter().

347  :
348  StripSubClusterShapeFilterBase(iConfig,iC),
349  filterAtHelixStage_(iConfig.getParameter<bool>("FilterAtHelixStage"))
350 
351 {
352  if (filterAtHelixStage_) edm::LogError("Configuration") << "StripSubClusterShapeSeedFilter: FilterAtHelixStage is not yet working correctly.\n";
353 }
T getParameter(std::string const &) const
StripSubClusterShapeFilterBase(const edm::ParameterSet &iConfig, edm::ConsumesCollector &iC)
StripSubClusterShapeSeedFilter::~StripSubClusterShapeSeedFilter ( )
inlineoverride

Definition at line 97 of file StripSubClusterShapeTrajectoryFilter.h.

97 {}

Member Function Documentation

bool StripSubClusterShapeSeedFilter::compatible ( const TrajectoryStateOnSurface tsos,
SeedingHitSet::ConstRecHitPointer  hit 
) const
overridevirtual

Implements SeedComparitor.

Definition at line 358 of file StripSubClusterShapeTrajectoryFilter.cc.

References TrackingRecHit::geographicalId(), TrackingRecHit::hit(), TrackingRecHit::isValid(), DetId::subdetId(), and SiStripDetId::TIB.

Referenced by StripSubClusterShapeSeedFilter().

359 {
360  if (filterAtHelixStage_) return true;
361  const TrackingRecHit* hit = thit->hit();
362  if (hit == nullptr || !hit->isValid()) return true;
363  if (hit->geographicalId().subdetId() < SiStripDetId::TIB) return true; // we look only at strips for now
364  return testLastHit(hit, tsos, false);
365 }
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
bool testLastHit(const TrackingRecHit *hit, const TrajectoryStateOnSurface &tsos, bool mustProject=false) const
bool isValid() const
DetId geographicalId() const
bool StripSubClusterShapeSeedFilter::compatible ( const SeedingHitSet hits) const
inlineoverridevirtual

Implements SeedComparitor.

Definition at line 105 of file StripSubClusterShapeTrajectoryFilter.h.

References hfClusterShapes_cfi::hits.

105 { return true; }
bool StripSubClusterShapeSeedFilter::compatible ( const SeedingHitSet hits,
const GlobalTrajectoryParameters helixStateAtVertex,
const FastHelix helix 
) const
overridevirtual

Implements SeedComparitor.

Definition at line 368 of file StripSubClusterShapeTrajectoryFilter.cc.

References FastHelix::circle(), TrackingRecHit::geographicalId(), TrackingRecHit::globalPosition(), mps_fire::i, FastCircle::isLine(), FastHelix::isValid(), GlobalTrajectoryParameters::momentum(), gen::n, GlobalTrajectoryParameters::position(), SeedingHitSet::size(), mathSSE::sqrt(), DetId::subdetId(), SiStripDetId::TIB, PV3DBase< T, PVType, FrameType >::x(), FastCircle::x0(), globals_cff::x1, PV3DBase< T, PVType, FrameType >::y(), FastCircle::y0(), and PV3DBase< T, PVType, FrameType >::z().

369 {
370  if (!filterAtHelixStage_) return true;
371 
372  if (!helix.isValid() //check still if it's a straight line, which are OK
373  && !helix.circle().isLine())//complain if it's not even a straight line
374  edm::LogWarning("InvalidHelix") << "StripSubClusterShapeSeedFilter helix is not valid, result is bad";
375 
376  float xc = helix.circle().x0(), yc = helix.circle().y0();
377 
378  GlobalPoint vertex = helixStateAtVertex.position();
379  GlobalVector momvtx = helixStateAtVertex.momentum();
380  float x0 = vertex.x(), y0 = vertex.y();
381  for (unsigned int i = 0, n = hits.size(); i < n; ++i) {
382  auto const & hit = *hits[i];
383  if (hit.geographicalId().subdetId() < SiStripDetId::TIB) continue;
384 
385  GlobalPoint pos = hit.globalPosition();
386  float x1 = pos.x(), y1 = pos.y(), dx1 = x1 - xc, dy1 = y1 - yc;
387 
388  // now figure out the proper tangent vector
389  float perpx = -dy1, perpy = dx1;
390  if (perpx * (x1-x0) + perpy * (y1 - y0) < 0) {
391  perpy = -perpy; perpx = -perpx;
392  }
393 
394  // now normalize (perpx, perpy, 1.0) to unity
395  float pnorm = 1.0/std::sqrt(perpx*perpx + perpy*perpy + 1);
396  GlobalVector gdir(perpx*pnorm, perpy*pnorm, (momvtx.z() > 0 ? pnorm : -pnorm));
397 
398  if (!testLastHit(&hit, pos, gdir)) {
399  return false; // not yet
400  }
401  }
402  return true;
403 }
bool isValid() const
Definition: FastHelix.h:63
double x0() const
Definition: FastCircle.h:50
bool isLine() const
Definition: FastCircle.h:58
T y() const
Definition: PV3DBase.h:63
const FastCircle & circle() const
Definition: FastHelix.h:67
T sqrt(T t)
Definition: SSEVec.h:18
T z() const
Definition: PV3DBase.h:64
bool testLastHit(const TrackingRecHit *hit, const TrajectoryStateOnSurface &tsos, bool mustProject=false) const
double y0() const
Definition: FastCircle.h:52
unsigned int size() const
Definition: SeedingHitSet.h:46
T x() const
Definition: PV3DBase.h:62
void StripSubClusterShapeSeedFilter::init ( const edm::Event ev,
const edm::EventSetup es 
)
inlineoverridevirtual

Implements SeedComparitor.

Definition at line 99 of file StripSubClusterShapeTrajectoryFilter.h.

99  {
100  setEventBase(ev,es);
101  }
void setEventBase(const edm::Event &, const edm::EventSetup &)

Member Data Documentation

bool StripSubClusterShapeSeedFilter::filterAtHelixStage_
protected

Definition at line 109 of file StripSubClusterShapeTrajectoryFilter.h.