39 template <
class T>
T sqr(
T t) {
return t*
t;}
42 using namespace PixelRecoUtilities;
44 using namespace ctfseeding;
49 theLambdaRange=
Range(std::sinh(theEtaRange.min()),std::sinh(theEtaRange.max()));
50 theMeanLambda = std::sinh(theEtaRange.mean());
61 float outerred_r =
sqrt(
sqr(ohit.
x()-origin().x())+
sqr(ohit.
y()-origin().y()) );
65 float zMinOrigin = origin().z() - originZBound();
66 float zMaxOrigin = origin().z() + originZBound();
69 float vcotMin = (
outer.z() > zMaxOrigin) ?
70 (
outer.z()-zMaxOrigin)/(
outer.r()+originRBound())
71 : (
outer.z()-zMaxOrigin)/(
outer.r()-originRBound());
72 float vcotMax = (
outer.z() > zMinOrigin) ?
73 (
outer.z()-zMinOrigin)/(
outer.r()-originRBound())
74 : (
outer.z()-zMinOrigin)/(
outer.r()+originRBound());
75 float cotRight =
std::max(vcotMin,theLambdaRange.min());
76 float cotLeft =
std::min(vcotMax, theLambdaRange.max());
86 }
else if (
outer.z() > 0) {
95 float cotThetaOuter = theMeanLambda;
97 float outerZscatt = 3.f*oSigma(
ptMin(),cotThetaOuter) / sinThetaOuter;
101 float zMinLine = boundL.
zAtR(0.)-outerZscatt;
102 float zMaxLine = boundR.zAtR(0.)+outerZscatt;
108 float innerScatt = 3.f * iSigma(
ptMin(),vtxMean,
outer);
122 float corrZ = innerScatt/sinTheta + hitZErr;
126 float corrR = innerScatt/cosTheta + hitRErr;
142 Range detRWindow (radius-halfThickness, radius+halfThickness);
143 Range detZWindow(z0-halfLength,z0+halfLength);
149 if (hitZWindow.
empty())
return 0;
159 float cotTheta = (hitZWindow.
mean()-origin().z()) / radius;
162 float scatt = 3.f * msSigma(
ptMin(), cotTheta);
165 float hitErrRPhi = 0.;
167 float corrPhi = (scatt+ hitErrRPhi)/radius;
168 float corrZ = scatt/sinTheta + bendR*
std::abs(cotTheta) + hitErrZ;
184 phiRange = phiPrediction(detRWindow.
mean());
200 Range detZWindow( zLayer-halfThickness, zLayer+halfThickness);
207 if (hitRWindow.
empty())
return 0;
217 float cotTheta = (detZWindow.
mean()-origin().z())/hitRWindow.
mean();
220 float scatt = 3.f * msSigma(
ptMin(),cotTheta);
222 float hitErrRPhi = 0.;
224 float corrPhi = (scatt+hitErrRPhi)/detRWindow.min();
225 float corrR = scatt/
std::abs(cosTheta) + bendR + hitErrR;
235 w1 = rPrediction.range(detZWindow.
min());
236 w2 = rPrediction.range(detZWindow.
max());
238 w1 = rPrediction.range(detZWindow.
max());
239 w2 = rPrediction.range(detZWindow.
min());
254 float phi0 = phiDirection();
257 phi0+thePhiMargin.right()),
267 float zMin = origin().
z() - originZBound();
268 float zMax = origin().z() + originZBound();
269 float rMin = -originRBound();
270 float rMax = originRBound();
271 if(theEtaRange.max() > 0) {
276 if (theEtaRange.min() > 0.) {
282 pRight,theLambdaRange.max()
297 bool measurementMethod =
false;
298 if(theMeasurementTrackerUsage == UseMeasurementTracker::kAlways) measurementMethod =
true;
299 else if(theMeasurementTrackerUsage == UseMeasurementTracker::kForSiStrips &&
303 if(measurementMethod) {
313 est = estimator(&bl,es);
316 est = estimator(&fl,es);
320 (thePhiMargin.left()+thePhiMargin.right())*0.5
f);
323 LogDebug(
"RectangularEtaPhiTrackingRegion")<<
"use pixel specific estimator.";
324 findDetAndHits = est;
327 LogDebug(
"RectangularEtaPhiTrackingRegion")<<
"use generic etat phi estimator.";
331 float phi = phiDirection();
346 LayerMeasurements lm(theMeasurementTracker->measurementTracker(), *theMeasurementTracker);
349 lm.
recHits(hits,*detLayer, tsos, prop, *findDetAndHits);
361 result.reserve(hits.size());
362 for (
auto h : hits) {
363 cache.emplace_back(
h);
364 result.emplace_back(
h);
367 LogDebug(
"RectangularEtaPhiTrackingRegion")<<
" found "<< hits.size()<<
" minus one measurements on layer: "<<detLayer->
subDetector();
376 est = estimator(&bl,es);
379 est = estimator(&fl,es);
383 auto layerHits = layer.
hits();
384 result.reserve(layerHits.size());
385 for (
auto && ih : layerHits) {
387 result.emplace_back( std::move(ih) );
399 std::ostringstream str;
401 <<
" eta: "<<theEtaRange<<
" phi:"<<thePhiMargin
402 <<
"precise: "<<thePrecise;
OuterEstimator * estimator(const BarrelDetLayer *layer, const edm::EventSetup &iSetup) const
virtual float length() const =0
common ppss p3p6s2 common epss epspn46 common const1 w2
virtual Location location() const =0
Which part of the detector (barrel, endcap)
const OuterHitCompatibility & hitCompatibility() const
std::vector< BaseTrackerRecHit * > SimpleHitContainer
virtual const BoundSurface & surface() const
The surface of the GeometricSearchDet.
Sin< T >::type sin(const T &t)
Global3DPoint GlobalPoint
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap)
const Bounds & bounds() const
virtual std::string print() const
HitRZConstraint rzConstraint() const
HitRZCompatibility * checkRZOld(const DetLayer *layer, const TrackingRecHit *outerHit, const edm::EventSetup &iSetup) const
virtual float thickness() const =0
float zAtR(float r) const
bool recHits(SimpleHitContainer &result, const DetLayer &layer, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
void initEtaRange(const GlobalVector &dir, const Margin &margin)
double intersection(double r12)
T curvature(T InversePt, const edm::EventSetup &iSetup)
virtual TrackingRegion::Hits hits(const edm::Event &ev, const edm::EventSetup &es, const SeedingLayerSetsHits::SeedingLayer &layer) const override
get hits from layer compatible with region constraints
virtual const BoundDisk & specificSurface() const
Cos< T >::type cos(const T &t)
Abs< T >::type abs(const T &t)
static GlobalPoint vtxMean(const GlobalPoint &p1, const GlobalError &e1, const GlobalPoint &p2, const GlobalError &e2)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
OuterHitPhiPrediction phiWindow(const edm::EventSetup &iSetup) const
SimpleLineRZ::Point Point
PixelRecoRange< float > Range
SeedingLayerSetsHits::Hits Hits
virtual const BoundSurface & surface() const
GeometricSearchDet interface.
double longitudinalBendingCorrection(double radius, double pt, const edm::EventSetup &iSetup)
virtual const Surface::PositionType & position() const
Returns position of the surface.
T const * product() const
virtual const BoundCylinder & specificSurface() const
Extension of the interface.
const DetLayer * detLayer() const
virtual std::string print() const
PixelRecoRange< T > intersection(const PixelRecoRange< T > &r) const
Square< F >::type sqr(const F &f)
void setTolerance(const Margin &tolerance)
DetId geographicalId() const
virtual LocalPoint localPosition() const =0
void setTolerance(const Margin &tolerance)
Range range(const float &radius) const