22 inline float sqr(
float x) {
return x *
x; }
25 inline float areaParallelogram(
const Vector2D&
a,
const Vector2D&
b) {
return a.x() * b.y() - a.y() * b.x(); }
34 if (0.
f == curvature) {
35 LogDebug(
"LowPtClusterShapeSeedComparitor")
36 <<
"the curvature is null:"
37 <<
"\n point1: " << g[0] <<
"\n point2: " << g[1] <<
"\n point3: " << g[2];
43 Vector2D
c = circle.center();
44 for (
int i = 0;
i != 3;
i++)
45 p[
i] = g[
i].basicVector().xy() -
c;
47 float area =
std::abs(areaParallelogram(p[1] - p[0], p[1]));
49 float a12 = std::asin(
std::min(area * curvature * curvature, 1.
f));
51 float slope = (g[1].
z() - g[0].
z()) / a12;
57 float cosTheta = cotTheta * sinTheta;
59 if (areaParallelogram(p[0], p[1]) < 0)
62 for (
int i = 0;
i != 3;
i++) {
63 Vector2D vl = p[
i] * (curvature * sinTheta);
72 for (
unsigned int i = 0;
i != hits.size(); ++
i)
73 globalPoss[
i] = hits[
i]->globalPosition();
81 : thePixelClusterShapeCacheToken(
83 theShapeFilterLabel_(ps.getParameter<std::
string>(
"clusterShapeHitFilter")),
99 if (clusterShapeHitFilter_ ==
nullptr)
100 throw cms::Exception(
"LogicError") <<
"LowPtClusterShapeSeedComparitor: init(EventSetup) method was not called";
104 getGlobalPos(hits, globalPoss);
109 bool ok = getGlobalDirs(globalPoss, globalDirs);
115 LogDebug(
"LowPtClusterShapeSeedComparitor") <<
"curvarture 0:"
116 <<
"\nnHits: " << hits.size() <<
" will say the seed is good anyway.";
120 for (
int i = 0;
i < 3;
i++) {
124 edm::LogError(
"LowPtClusterShapeSeedComparitor") <<
"this is not a pixel cluster";
134 LogDebug(
"LowPtClusterShapeSeedComparitor") <<
"about to compute compatibility."
135 <<
"hit ptr: " << pixelRecHit <<
"global direction:" << globalDirs[
i];
137 if (!clusterShapeHitFilter_->isCompatible(*pixelRecHit, globalDirs[
i], *thePixelClusterShapeCache)) {
138 LogTrace(
"LowPtClusterShapeSeedComparitor")
const edm::EventSetup & c
bool getByToken(EDGetToken token, Handle< PROD > &result) const
bool compatible(const SeedingHitSet &hits) const override
static const double slope[3]
const TrackerTopology * trackerTopology_
Log< level::Error, false > LogError
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
T curvature(T InversePt, const MagneticField &field)
bool getData(T &iHolder) const
Basic2DVector< double >::MathVector Vector2D
const edm::ESGetToken< ClusterShapeHitFilter, CkfComponentsRecord > clusterShapeHitFilterESToken_
Abs< T >::type abs(const T &t)
LowPtClusterShapeSeedComparitor(const edm::ParameterSet &ps, edm::ConsumesCollector &iC)
edm::Handle< SiPixelClusterShapeCache > thePixelClusterShapeCache
edm::EDGetTokenT< SiPixelClusterShapeCache > thePixelClusterShapeCacheToken
void init(const edm::Event &e, const edm::EventSetup &es) override
const ClusterShapeHitFilter * clusterShapeHitFilter_
static std::string getInfo(const DetId &id, const TrackerTopology *tTopo)
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopologyESToken_
Global3DVector GlobalVector