34 inline float sqr(
float x) {
return x*
x; }
38 float areaParallelogram
39 (
const Vector2D&
a,
const Vector2D&
b)
41 return a.x() * b.y() - a.y() * b.x();
55 if(0.
f == curvature) {
56 LogDebug(
"LowPtClusterShapeSeedComparitor")<<
"the curvature is null:" 59 <<
"\n point3: "<<g[2];
65 Vector2D
c = circle.center();
66 for(
int i=0;
i!=3;
i++)
67 p[
i] = g[
i].basicVector().xy() -
c;
70 float area =
std::abs(areaParallelogram(p[1] - p[0], p[1]));
72 float a12 = std::asin(
std::min(area*curvature*curvature,1.
f));
74 float slope = (g[1].
z() - g[0].
z()) / a12;
80 float cosTheta = cotTheta*sinTheta;
82 if (areaParallelogram(p[0], p[1] ) < 0) sinTheta = - sinTheta;
84 for(
int i = 0;
i!=3;
i++) {
85 Vector2D vl = p[
i]*(curvature*sinTheta);
101 for(
unsigned int i=0;
i!=hits.
size(); ++
i)
102 globalPoss[
i] = hits[
i]->globalPosition();
110 theShapeFilterLabel_(ps.getParameter<
std::
string>(
"clusterShapeHitFilter"))
124 assert(hits.
size()==3);
128 throw cms::Exception(
"LogicError") <<
"LowPtClusterShapeSeedComparitor: init(EventSetup) method was not called";
132 getGlobalPos(hits, globalPoss);
137 bool ok = getGlobalDirs(globalPoss,globalDirs);
144 LogDebug(
"LowPtClusterShapeSeedComparitor")<<
"curvarture 0:" 145 <<
"\nnHits: "<<hits.
size()
146 <<
" will say the seed is good anyway.";
150 for(
int i = 0;
i < 3;
i++)
156 edm::LogError(
"LowPtClusterShapeSeedComparitor")<<
"this is not a pixel cluster";
165 LogDebug(
"LowPtClusterShapeSeedComparitor")<<
"about to compute compatibility." 166 <<
"hit ptr: "<<pixelRecHit
167 <<
"global direction:"<< globalDirs[
i];
172 LogTrace(
"LowPtClusterShapeSeedComparitor")
173 <<
" clusShape is not compatible"
bool getByToken(EDGetToken token, Handle< PROD > &result) const
static const double slope[3]
edm::ESHandle< ClusterShapeHitFilter > theShapeFilter
something
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
edm::ESHandle< TrackerTopology > theTTopo
T x() const
Cartesian x coordinate.
T curvature(T InversePt, const edm::EventSetup &iSetup)
Basic2DVector< double >::MathVector Vector2D
std::string theShapeFilterLabel_
Abs< T >::type abs(const T &t)
LowPtClusterShapeSeedComparitor(const edm::ParameterSet &ps, edm::ConsumesCollector &iC)
edm::Handle< SiPixelClusterShapeCache > thePixelClusterShapeCache
virtual void init(const edm::Event &e, const edm::EventSetup &es)
virtual bool compatible(const SeedingHitSet &hits) const
edm::EDGetTokenT< SiPixelClusterShapeCache > thePixelClusterShapeCacheToken
Square< F >::type sqr(const F &f)
unsigned int size() const
static std::string getInfo(const DetId &id, const TrackerTopology *tTopo)
T const * product() const
Global3DVector GlobalVector