22 inline float sqr(
float x) {
return x*
x; }
54 return a.
x() * b.
y() - a.
y() * b.
x();
59 (
const vector<GlobalPoint> &
g)
const
62 vector<Global2DVector>
p;
63 for(vector<GlobalPoint>::const_iterator ig = g.begin();
68 vector<GlobalVector> globalDirs;
77 float rad2 = (p[0] -
c).
mag2();
78 float a12 = asin(fabsf(areaParallelogram(p[0] -
c, p[1] -
c)) / rad2);
80 float slope = (g[1].z() - g[0].z()) / a12;
82 float cotTheta = slope * circle.
curvature();
83 float coshEta =
sqrt(1 +
sqr(cotTheta));
86 float sinTheta = 1. / coshEta;
87 float cosTheta = cotTheta * sinTheta;
90 if(areaParallelogram(p[0] -
c, p[1] -
c) > 0) dir = 1;
else dir = -1;
94 for(vector<Global2DVector>::const_iterator ip = p.begin();
109 (
const vector<const TrackingRecHit *> & recHits)
const
111 vector<GlobalPoint> globalPoss;
113 for(vector<const TrackingRecHit *>::const_iterator recHit = recHits.begin();
114 recHit!= recHits.end();
117 DetId detId = (*recHit)->geographicalId();
120 theTracker->idToDet(detId)->toGlobal((*recHit)->localPosition());
122 globalPoss.push_back(gpos);
131 const vector<const TrackingRecHit *> & recHits)
const
134 if(recHits.size() <= 2)
return true;
137 if(track->pt() <
ptMin ||
141 <<
" [ClusterShapeTrackFilter] pt not in range: "
142 <<
ptMin <<
" " << track->pt() <<
" " <<
ptMax;
147 vector<GlobalPoint> globalPoss = getGlobalPoss(recHits);
150 vector<GlobalVector> globalDirs = getGlobalDirs(globalPoss);
156 for(
unsigned int i = 0;
i < recHits.size();
i++)
166 if(! theFilter->isCompatible(*pixelRecHit, globalDirs[
i]) )
169 <<
" [ClusterShapeTrackFilter] clusShape problem"
static std::string getInfo(const DetId &id)
T getParameter(std::string const &) const
ClusterShapeTrackFilter(const edm::ParameterSet &ps, const edm::EventSetup &es)
static const double slope[3]
bool exists(std::string const ¶meterName) const
checks if a parameter exists
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 edm::EventSetup &iSetup)
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
std::vector< GlobalPoint > getGlobalPoss(const std::vector< const TrackingRecHit * > &recHits) const
T y() const
Cartesian y coordinate.
float areaParallelogram(const Global2DVector &a, const Global2DVector &b) const
T const * product() const
std::vector< GlobalVector > getGlobalDirs(const std::vector< GlobalPoint > &globalPoss) const
Square< F >::type sqr(const F &f)
virtual ~ClusterShapeTrackFilter()
T x() const
Cartesian x coordinate.
Global3DVector GlobalVector