55 return UseMeasurementTracker::kNever;
56 if (tmp ==
"forsistrips")
57 return UseMeasurementTracker::kForSiStrips;
59 return UseMeasurementTracker::kAlways;
60 throw cms::Exception(
"Configuration") <<
"Got invalid string '" << name
61 <<
"', valid values are 'Never', 'ForSiStrips', 'Always' (case insensitive)";
67 theLambdaRange =
Range(std::sinh(theEtaRange.min()), std::sinh(theEtaRange.max()));
68 theMeanLambda = std::sinh(theEtaRange.mean());
77 float outerred_r =
std::sqrt(
sqr(ohit.
x() - origin().x()) +
sqr(ohit.
y() - origin().y()));
80 float zMinOrigin = origin().z() - originZBound();
81 float zMaxOrigin = origin().z() + originZBound();
84 float vcotMin = (
outer.z() > zMaxOrigin) ? (
outer.z() - zMaxOrigin) / (
outer.r() + originRBound())
85 : (
outer.z() - zMaxOrigin) / (
outer.r() - originRBound());
86 float vcotMax = (
outer.z() > zMinOrigin) ? (
outer.z() - zMinOrigin) / (
outer.r() - originRBound())
87 : (
outer.z() - zMinOrigin) / (
outer.r() + originRBound());
88 float cotRight =
std::max(vcotMin, theLambdaRange.min());
89 float cotLeft =
std::min(vcotMax, theLambdaRange.max());
93 float outerZscatt = 0;
98 float cotThetaOuter = theMeanLambda;
100 outerZscatt = 3.f * oSigma(
ptMin(), cotThetaOuter) * sinThetaOuterInv;
105 float zMinLine = boundL.
zAtR(0.) - outerZscatt;
106 float zMaxLine = boundR.zAtR(0.) + outerZscatt;
131 auto corr = innerScatt * sinThetaInv;
135 auto corr = innerScatt * cosThetaInv;
151 Range detRWindow(radius - halfThickness, radius + halfThickness);
152 Range detZWindow(z0 - halfLength, z0 + halfLength);
157 if (hitZWindow.
empty())
169 auto cotTheta = (hitZWindow.
mean() - origin().z()) * invR;
172 auto scatt = 3.f * msSigma(
ptMin(), cotTheta);
175 float hitErrRPhi = 0.;
177 float corrPhi = (scatt + hitErrRPhi) * invR;
178 float corrZ = scatt * sinThetaInv + bendR *
std::abs(cotTheta) + hitErrZ;
193 phiRange = phiPrediction(detRWindow.
mean());
196 return std::make_unique<OuterEstimator<Algo>>(
OuterDetCompatibility(layer, phiRange, detRWindow, hitZWindow),
207 Range detZWindow(zLayer - halfThickness, zLayer + halfThickness);
213 if (hitRWindow.
empty())
224 float cotTheta = (detZWindow.
mean() - origin().z()) / hitRWindow.
mean();
225 float cosThetaInv =
std::sqrt(1 +
sqr(cotTheta)) / cotTheta;
227 float scatt = 3.f * msSigma(
ptMin(), cotTheta);
229 float hitErrRPhi = 0.;
231 float corrPhi = (scatt + hitErrRPhi) / detRWindow.min();
232 float corrR = scatt *
std::abs(cosThetaInv) + bendR + hitErrR;
242 w1 = rPrediction.range(detZWindow.
min());
243 w2 = rPrediction.range(detZWindow.
max());
245 w1 = rPrediction.range(detZWindow.
max());
246 w2 = rPrediction.range(detZWindow.
min());
251 return std::make_unique<OuterEstimator<Algo>>(
OuterDetCompatibility(layer, phiRange, hitRWindow, detZWindow),
257 auto phi0 = phiDirection();
266 float zMin = origin().z() - originZBound();
267 float zMax = origin().z() + originZBound();
268 float rMin = -originRBound();
269 float rMax = originRBound();
270 if (theEtaRange.max() > 0) {
275 if (theEtaRange.min() > 0.) {
280 return HitRZConstraint(pLeft, theLambdaRange.min(), pRight, theLambdaRange.max());
291 bool measurementMethod =
false;
292 if (theMeasurementTrackerUsage == UseMeasurementTracker::kAlways)
293 measurementMethod =
true;
294 else if (theMeasurementTrackerUsage == UseMeasurementTracker::kForSiStrips &&
296 measurementMethod =
true;
298 if (measurementMethod) {
306 std::unique_ptr<MeasurementEstimator> est;
320 (thePhiMargin.left() + thePhiMargin.right()) * 0.5
f);
323 LogDebug(
"RectangularEtaPhiTrackingRegion") <<
"use pixel specific estimator.";
324 findDetAndHits = est.get();
326 LogDebug(
"RectangularEtaPhiTrackingRegion") <<
"use generic etat phi estimator.";
330 float phi = phiDirection();
343 LayerMeasurements lm(theMeasurementTracker->measurementTracker(), *theMeasurementTracker);
345 auto hits = lm.recHits(*detLayer, tsos, prop, *findDetAndHits);
347 result.reserve(hits.size());
348 for (
auto h : hits) {
350 result.emplace_back(
h);
353 LogDebug(
"RectangularEtaPhiTrackingRegion")
354 <<
" found " << hits.size() <<
" minus one measurements on layer: " << detLayer->
subDetector();
368 auto layerHits = layer.
hits();
369 result.reserve(layerHits.size());
370 for (
auto&& ih : layerHits) {
382 auto layerHits = layer.
hits();
383 result.reserve(layerHits.size());
384 for (
auto&& ih : layerHits) {
397 std::ostringstream
str;
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
void setTolerance(float tolerance)
HitRZCompatibility * checkRZOld(const DetLayer *layer, const Hit &outerHit, const edm::EventSetup &iSetup, const DetLayer *outerlayer) const
virtual float length() const =0
common ppss p3p6s2 common epss epspn46 common const1 w2
PixelRecoRange< float > Range
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap)
bool isBarrel(GeomDetEnumerators::SubDetector m)
Sin< T >::type sin(const T &t)
virtual Location location() const =0
Which part of the detector (barrel, endcap)
Global3DPoint GlobalPoint
const Bounds & bounds() const
TrackingRegion::Hits hits(const edm::EventSetup &es, const SeedingLayerSetsHits::SeedingLayer &layer) const override
get hits from layer compatible with region constraints
static UseMeasurementTracker stringToUseMeasurementTracker(const std::string &name)
virtual const BoundCylinder & specificSurface() const final
Extension of the interface.
HitRZConstraint rzConstraint() const
Range range(const float &radius) const override
std::unique_ptr< MeasurementEstimator > estimator(const BarrelDetLayer *layer, const edm::EventSetup &iSetup) const
float zAtR(float r) const
void initEtaRange(const GlobalVector &dir, const Margin &margin)
double intersection(double r12)
T curvature(T InversePt, const edm::EventSetup &iSetup)
static PlanePointer build(Args &&...args)
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)
bool isEndcap(GeomDetEnumerators::SubDetector m)
bool isTrackerStrip(GeomDetEnumerators::SubDetector m)
OuterHitPhiPrediction phiWindow(const edm::EventSetup &iSetup) const
std::string print() const override
SimpleLineRZ::Point Point
virtual const BoundDisk & specificSurface() const final
SeedingLayerSetsHits::Hits Hits
double longitudinalBendingCorrection(double radius, double pt, const edm::EventSetup &iSetup)
virtual float thickness() const =0
virtual const Surface::PositionType & position() const
Returns position of the surface.
const DetLayer * detLayer() const
virtual std::string print() const
const BoundSurface & surface() const final
The surface of the GeometricSearchDet.
PixelRecoRange< T > intersection(const PixelRecoRange< T > &r) const
Square< F >::type sqr(const F &f)
T const * product() const
const BoundSurface & surface() const final
GeometricSearchDet interface.
bool isTrackerPixel(GeomDetEnumerators::SubDetector m)
void setTolerance(const Margin &tolerance)