28 inline float sqr(
float x) {
return x*
x; }
70 return a.
x() * b.
y() - a.
y() * b.
x();
75 (
const vector<GlobalPoint> &
g)
const
78 vector<Global2DVector>
p;
79 for(vector<GlobalPoint>::const_iterator ig = g.begin();
84 vector<GlobalVector> globalDirs;
93 float rad2 = (p[0] -
c).
mag2();
94 float a12 = asin(fabsf(areaParallelogram(p[0] -
c, p[1] -
c)) / rad2);
96 float slope = (g[1].z() - g[0].z()) / a12;
98 float cotTheta = slope * circle.
curvature();
99 float coshEta =
sqrt(1 +
sqr(cotTheta));
102 float sinTheta = 1. / coshEta;
103 float cosTheta = cotTheta * sinTheta;
106 if(areaParallelogram(p[0] -
c, p[1] -
c) > 0) dir = 1;
else dir = -1;
110 for(vector<Global2DVector>::const_iterator ip = p.begin();
125 (
const vector<const TrackingRecHit *> &
recHits)
const
127 vector<GlobalPoint> globalPoss;
129 for(vector<const TrackingRecHit *>::const_iterator recHit = recHits.begin();
130 recHit!= recHits.end();
133 DetId detId = (*recHit)->geographicalId();
136 theTracker->idToDet(detId)->toGlobal((*recHit)->localPosition());
138 globalPoss.push_back(gpos);
147 const vector<const TrackingRecHit *> &
recHits,
151 if(recHits.size() <= 2)
return true;
154 if(track->pt() <
ptMin ||
158 <<
" [ClusterShapeTrackFilter] pt not in range: "
159 <<
ptMin <<
" " << track->pt() <<
" " << ptMax;
164 vector<GlobalPoint> globalPoss = getGlobalPoss(recHits);
167 vector<GlobalVector> globalDirs = getGlobalDirs(globalPoss);
173 for(
unsigned int i = 0;
i < recHits.size();
i++)
183 if(! theFilter->isCompatible(*pixelRecHit, globalDirs[
i], *theClusterShapeCache) )
186 <<
" [ClusterShapeTrackFilter] clusShape problem"
T getParameter(std::string const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
static const double slope[3]
bool exists(std::string const ¶meterName) const
checks if a parameter exists
const TrackerGeometry * theTracker
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 x() const
Cartesian x coordinate.
T curvature(T InversePt, const edm::EventSetup &iSetup)
const ClusterShapeHitFilter * theFilter
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.
edm::EDGetTokenT< SiPixelClusterShapeCache > theClusterShapeCacheToken
float areaParallelogram(const Global2DVector &a, const Global2DVector &b) const
T const * product() const
T const * product() const
std::vector< GlobalVector > getGlobalDirs(const std::vector< GlobalPoint > &globalPoss) const
ClusterShapeTrackFilter(const edm::ParameterSet &ps, edm::ConsumesCollector &iC)
Square< F >::type sqr(const F &f)
virtual ~ClusterShapeTrackFilter()
const SiPixelClusterShapeCache * theClusterShapeCache
static std::string getInfo(const DetId &id, const TrackerTopology *tTopo)
T x() const
Cartesian x coordinate.
Global3DVector GlobalVector
void update(const edm::Event &ev, const edm::EventSetup &es) override