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

edm::Handle< SiPixelClusterShapeCachethePixelClusterShapeCache
 
edm::EDGetTokenT< SiPixelClusterShapeCachethePixelClusterShapeCacheToken
 
edm::ESHandle< ClusterShapeHitFiltertheShapeFilter
 something More...
 
std::string theShapeFilterLabel_
 
edm::ESHandle< TrackerTopologytheTTopo
 

Detailed Description

Definition at line 18 of file LowPtClusterShapeSeedComparitor.h.

Constructor & Destructor Documentation

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

Definition at line 83 of file LowPtClusterShapeSeedComparitor.cc.

86  iC.consumes<SiPixelClusterShapeCache>(ps.getParameter<edm::InputTag>("clusterShapeCacheSrc"))),
87  theShapeFilterLabel_(ps.getParameter<std::string>("clusterShapeHitFilter")) {}
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
edm::EDGetTokenT< SiPixelClusterShapeCache > thePixelClusterShapeCacheToken
LowPtClusterShapeSeedComparitor::~LowPtClusterShapeSeedComparitor ( )
inlineoverride

Member Function Documentation

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

Implements SeedComparitor.

Definition at line 97 of file LowPtClusterShapeSeedComparitor.cc.

References Exception, ALCARECOTkAlBeamHalo_cff::filter, HitInfo::getInfo(), mps_fire::i, TrackingRecHit::isValid(), LogDebug, LogTrace, convertSQLiteXML::ok, edm::ESHandle< T >::product(), SeedingHitSet::size(), thePixelClusterShapeCache, theShapeFilter, and theTTopo.

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

Implements SeedComparitor.

Definition at line 24 of file LowPtClusterShapeSeedComparitor.h.

24  {
25  return true;
26  }
bool LowPtClusterShapeSeedComparitor::compatible ( const SeedingHitSet hits,
const GlobalTrajectoryParameters helixStateAtVertex,
const FastHelix helix 
) const
inlineoverridevirtual

Implements SeedComparitor.

Definition at line 27 of file LowPtClusterShapeSeedComparitor.h.

29  {
30  return true;
31  }
void LowPtClusterShapeSeedComparitor::init ( const edm::Event e,
const edm::EventSetup es 
)
overridevirtual

Implements SeedComparitor.

Definition at line 90 of file LowPtClusterShapeSeedComparitor.cc.

References edm::EventSetup::get(), edm::Event::getByToken(), thePixelClusterShapeCache, thePixelClusterShapeCacheToken, theShapeFilter, theShapeFilterLabel_, and theTTopo.

90  {
92  es.get<TrackerTopologyRcd>().get(theTTopo);
93 
95 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
edm::ESHandle< ClusterShapeHitFilter > theShapeFilter
something
edm::ESHandle< TrackerTopology > theTTopo
edm::Handle< SiPixelClusterShapeCache > thePixelClusterShapeCache
edm::EDGetTokenT< SiPixelClusterShapeCache > thePixelClusterShapeCacheToken
T get() const
Definition: EventSetup.h:73

Member Data Documentation

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

Definition at line 38 of file LowPtClusterShapeSeedComparitor.h.

Referenced by compatible(), and init().

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

Definition at line 37 of file LowPtClusterShapeSeedComparitor.h.

Referenced by init().

edm::ESHandle<ClusterShapeHitFilter> LowPtClusterShapeSeedComparitor::theShapeFilter
private

something

Definition at line 35 of file LowPtClusterShapeSeedComparitor.h.

Referenced by compatible(), and init().

std::string LowPtClusterShapeSeedComparitor::theShapeFilterLabel_
private

Definition at line 39 of file LowPtClusterShapeSeedComparitor.h.

Referenced by init().

edm::ESHandle<TrackerTopology> LowPtClusterShapeSeedComparitor::theTTopo
private

Definition at line 36 of file LowPtClusterShapeSeedComparitor.h.

Referenced by compatible(), and init().