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 16 of file LowPtClusterShapeSeedComparitor.h.

Constructor & Destructor Documentation

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

Definition at line 100 of file LowPtClusterShapeSeedComparitor.cc.

100  :
102  theShapeFilterLabel_(ps.getParameter<std::string>("clusterShapeHitFilter"))
103 {}
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 113 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.

115 {
116  assert(hits.size()==3);
117 
119  if(filter == nullptr)
120  throw cms::Exception("LogicError") << "LowPtClusterShapeSeedComparitor: init(EventSetup) method was not called";
121 
122  // Get global positions
123  GlobalPoint globalPoss[3];
124  getGlobalPos(hits, globalPoss);
125 
126  // Get global directions
127  GlobalVector globalDirs[3];
128 
129  bool ok = getGlobalDirs(globalPoss,globalDirs);
130 
131  // Check whether shape of pixel cluster is compatible
132  // with local track direction
133 
134  if (!ok)
135  {
136  LogDebug("LowPtClusterShapeSeedComparitor")<<"curvarture 0:"
137  <<"\nnHits: "<<hits.size()
138  <<" will say the seed is good anyway.";
139  return true;
140  }
141 
142  for(int i = 0; i < 3; i++)
143  {
144  const SiPixelRecHit* pixelRecHit =
145  dynamic_cast<const SiPixelRecHit *>(hits[i]->hit());
146 
147  if (!pixelRecHit){
148  edm::LogError("LowPtClusterShapeSeedComparitor")<<"this is not a pixel cluster";
149  ok = false; break;
150  }
151 
152  if(!pixelRecHit->isValid())
153  {
154  ok = false; break;
155  }
156 
157  LogDebug("LowPtClusterShapeSeedComparitor")<<"about to compute compatibility."
158  <<"hit ptr: "<<pixelRecHit
159  <<"global direction:"<< globalDirs[i];
160 
161 
162  if(! filter->isCompatible(*pixelRecHit, globalDirs[i], *thePixelClusterShapeCache) )
163  {
164  LogTrace("LowPtClusterShapeSeedComparitor")
165  << " clusShape is not compatible"
166  << HitInfo::getInfo(*hits[i]->hit(),theTTopo.product());
167 
168  ok = false; break;
169  }
170  }
171 
172  return ok;
173 }
#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:46
static std::string getInfo(const DetId &id, const TrackerTopology *tTopo)
Definition: HitInfo.cc:23
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 23 of file LowPtClusterShapeSeedComparitor.h.

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

Implements SeedComparitor.

Definition at line 25 of file LowPtClusterShapeSeedComparitor.h.

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

Implements SeedComparitor.

Definition at line 106 of file LowPtClusterShapeSeedComparitor.cc.

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

106  {
108  es.get<TrackerTopologyRcd>().get(theTTopo);
109 
111 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
edm::ESHandle< ClusterShapeHitFilter > theShapeFilter
something
edm::ESHandle< TrackerTopology > theTTopo
edm::Handle< SiPixelClusterShapeCache > thePixelClusterShapeCache
edm::EDGetTokenT< SiPixelClusterShapeCache > thePixelClusterShapeCacheToken
T get() const
Definition: EventSetup.h:63

Member Data Documentation

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

Definition at line 34 of file LowPtClusterShapeSeedComparitor.h.

Referenced by compatible(), and init().

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

Definition at line 33 of file LowPtClusterShapeSeedComparitor.h.

Referenced by init().

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

something

Definition at line 31 of file LowPtClusterShapeSeedComparitor.h.

Referenced by compatible(), and init().

std::string LowPtClusterShapeSeedComparitor::theShapeFilterLabel_
private

Definition at line 35 of file LowPtClusterShapeSeedComparitor.h.

Referenced by init().

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

Definition at line 32 of file LowPtClusterShapeSeedComparitor.h.

Referenced by compatible(), and init().