48 filterName_(cfg.getParameter<std::
string>(
"ClusterShapeHitFilterName")),
49 filterAtHelixStage_(cfg.getParameter<bool>(
"FilterAtHelixStage")),
50 filterPixelHits_(cfg.getParameter<bool>(
"FilterPixelHits")),
51 filterStripHits_(cfg.getParameter<bool>(
"FilterStripHits"))
70 assert(hit->isValid() && tsos.
isValid());
90 if(!helix.
isValid())
edm::LogWarning(
"InvalidHelix") <<
"PixelClusterShapeSeedComparitor helix is not valid, result is bad";
96 float x0 = vertex.
x(), y0 = vertex.
y();
97 for (
unsigned int i = 0,
n = hits.
size();
i <
n; ++
i) {
100 float x1 = pos.
x(), y1 = pos.
y(), dx1 = x1 - xc, dy1 = y1 - yc;
103 float perpx = -dy1, perpy = dx1;
104 if (perpx * (x1-x0) + perpy * (y1 - y0) < 0) {
105 perpy = -perpy; perpx = -perpx;
109 float perp2 = perpx*perpx + perpy*perpy;
110 float pmom2 = momvtx.
x()*momvtx.
x() + momvtx.
y()*momvtx.
y(), momz2 = momvtx.
z()*momvtx.
z(), mom2 = pmom2 + momz2;
111 float perpscale =
sqrt(pmom2/mom2 / perp2), zscale =
sqrt((1-pmom2/mom2));
112 GlobalVector gdir(perpx*perpscale, perpy*perpscale, (momvtx.
z() > 0 ? zscale : -zscale));
127 if (pixhit == 0)
throw cms::Exception(
"LogicError",
"Found a valid hit on the pixel detector which is not a SiPixelRecHit\n");
132 const std::type_info &tid =
typeid(*hit.
hit());
133 if (tid ==
typeid(SiStripMatchedRecHit2D)) {
134 const SiStripMatchedRecHit2D* matchedHit =
dynamic_cast<const SiStripMatchedRecHit2D *
>(hit.
hit());
135 assert(matchedHit != 0);
136 return (
filterHandle_->isCompatible(
DetId(matchedHit->monoId()), matchedHit->monoCluster(), direction) &&
137 filterHandle_->isCompatible(
DetId(matchedHit->stereoId()), matchedHit->stereoCluster(), direction));
138 }
else if (tid ==
typeid(SiStripRecHit2D)) {
139 const SiStripRecHit2D* recHit =
dynamic_cast<const SiStripRecHit2D *
>(hit.
hit());
144 assert(precHit != 0);
virtual bool compatible(const TrajectorySeed &seed) const override
virtual bool compatible(const SeedingHitSet &hits, const TrackingRegion ®ion) const override
virtual const TrackingRecHit * hit() const =0
edm::ESHandle< ClusterShapeHitFilter > filterHandle_
const FastCircle & circle() const
virtual void init(const edm::EventSetup &es) override
virtual GlobalPoint globalPosition() const =0
GlobalVector momentum() const
PixelClusterShapeSeedComparitor(const edm::ParameterSet &cfg)
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
GlobalPoint position() const
T perp2() const
Squared magnitude of transverse component.
bool compatibleHit(const TransientTrackingRecHit &hit, const GlobalVector &direction) const
unsigned int size() const
#define DEFINE_EDM_PLUGIN(factory, type, name)
DetId geographicalId() const
virtual ~PixelClusterShapeSeedComparitor()
const SiStripRecHit2D & originalHit() const
GlobalVector globalDirection() const