49 const math::XYZPoint regOrigin(origin().
x(), origin().y(), origin().z());
50 auto phi0 = phiDirection() + 0.5 * (phiMargin().right() - phiMargin().left());
51 auto dphi = 0.5 * (phiMargin().right() + phiMargin().left());
84 return UseMeasurementTracker::kNever;
85 if (
tmp ==
"forsistrips")
86 return UseMeasurementTracker::kForSiStrips;
88 return UseMeasurementTracker::kAlways;
90 <<
"', valid values are 'Never', 'ForSiStrips', 'Always' (case insensitive)";
96 theLambdaRange =
Range(std::sinh(theEtaRange.min()), std::sinh(theEtaRange.max()));
97 theMeanLambda = std::sinh(theEtaRange.mean());
105 float outerred_r =
std::sqrt(
sqr(ohit.
x() - origin().x()) +
sqr(ohit.
y() - origin().y()));
108 float zMinOrigin = origin().z() - originZBound();
109 float zMaxOrigin = origin().z() + originZBound();
112 float vcotMin = (
outer.z() > zMaxOrigin) ? (
outer.z() - zMaxOrigin) / (
outer.r() + originRBound())
113 : (
outer.z() - zMaxOrigin) / (
outer.r() - originRBound());
114 float vcotMax = (
outer.z() > zMinOrigin) ? (
outer.z() - zMinOrigin) / (
outer.r() - originRBound())
115 : (
outer.z() - zMinOrigin) / (
outer.r() + originRBound());
116 float cotRight =
std::max(vcotMin, theLambdaRange.min());
117 float cotLeft =
std::min(vcotMax, theLambdaRange.max());
118 return std::make_unique<HitEtaCheck>(
isBarrel,
outer, cotLeft, cotRight);
121 float outerZscatt = 0;
122 float innerScatt = 0;
126 float cotThetaOuter = theMeanLambda;
127 float sinThetaOuterInv =
std::sqrt(1.
f +
sqr(cotThetaOuter));
128 outerZscatt = 3.f * oSigma(
ptMin(), cotThetaOuter) * sinThetaOuterInv;
133 float zMinLine = boundL.
zAtR(0.) - outerZscatt;
134 float zMaxLine = boundR.zAtR(0.) + outerZscatt;
159 auto corr = innerScatt * sinThetaInv;
163 auto corr = innerScatt * cosThetaInv;
172 float halfLength = 0.5f * layer->surface().bounds().length();
173 float halfThickness = 0.5f * layer->surface().bounds().thickness();
174 float z0 = layer->position().z();
175 float radius = layer->specificSurface().radius();
179 Range detZWindow(z0 - halfLength, z0 + halfLength);
184 if (hitZWindow.
empty())
196 auto cotTheta = (hitZWindow.
mean() - origin().z()) * invR;
199 auto scatt = 3.f * msSigma(
ptMin(), cotTheta);
202 float hitErrRPhi = 0.;
204 float corrPhi = (scatt + hitErrRPhi) * invR;
205 float corrZ = scatt * sinThetaInv + bendR *
std::abs(cotTheta) + hitErrZ;
220 phiRange = phiPrediction(detRWindow.
mean());
223 return std::make_unique<OuterEstimator<Algo>>(
OuterDetCompatibility(layer, phiRange, detRWindow, hitZWindow),
230 float halfThickness = 0.5f * layer->surface().bounds().thickness();
231 float zLayer = layer->position().z();
232 Range detZWindow(zLayer - halfThickness, zLayer + halfThickness);
233 Range detRWindow(layer->specificSurface().innerRadius(), layer->specificSurface().outerRadius());
238 if (hitRWindow.
empty())
249 float cotTheta = (detZWindow.
mean() - origin().z()) / hitRWindow.
mean();
250 float cosThetaInv =
std::sqrt(1 +
sqr(cotTheta)) / cotTheta;
252 float scatt = 3.f * msSigma(
ptMin(), cotTheta);
254 float hitErrRPhi = 0.;
256 float corrPhi = (scatt + hitErrRPhi) / detRWindow.min();
257 float corrR = scatt *
std::abs(cosThetaInv) + bendR + hitErrR;
267 w1 = rPrediction.range(detZWindow.
min());
268 w2 = rPrediction.range(detZWindow.
max());
270 w1 = rPrediction.range(detZWindow.
max());
271 w2 = rPrediction.range(detZWindow.
min());
276 return std::make_unique<OuterEstimator<Algo>>(
OuterDetCompatibility(layer, phiRange, hitRWindow, detZWindow),
281 auto phi0 = phiDirection();
290 float zMin = origin().z() - originZBound();
291 float zMax = origin().z() + originZBound();
292 float rMin = -originRBound();
293 float rMax = originRBound();
294 if (theEtaRange.max() > 0) {
299 if (theEtaRange.min() > 0.) {
304 return HitRZConstraint(pLeft, theLambdaRange.min(), pRight, theLambdaRange.max());
312 const DetLayer* detLayer = layer.detLayer();
314 bool measurementMethod =
false;
315 if (theMeasurementTrackerUsage == UseMeasurementTracker::kAlways)
316 measurementMethod =
true;
317 else if (theMeasurementTrackerUsage == UseMeasurementTracker::kForSiStrips &&
319 measurementMethod =
true;
321 if (measurementMethod) {
325 std::unique_ptr<MeasurementEstimator> est;
339 (thePhiMargin.left() + thePhiMargin.right()) * 0.5
f);
342 LogDebug(
"RectangularEtaPhiTrackingRegion") <<
"use pixel specific estimator.";
343 findDetAndHits = est.get();
345 LogDebug(
"RectangularEtaPhiTrackingRegion") <<
"use generic etat phi estimator.";
349 float phi = phiDirection();
362 LayerMeasurements lm(theMeasurementTracker->measurementTracker(), *theMeasurementTracker);
364 auto hits = lm.recHits(*detLayer, tsos, prop, *findDetAndHits);
367 for (
auto h :
hits) {
372 LogDebug(
"RectangularEtaPhiTrackingRegion")
373 <<
" found " <<
hits.size() <<
" minus one measurements on layer: " << detLayer->
subDetector();
387 auto layerHits = layer.hits();
388 result.reserve(layerHits.size());
389 for (
auto&& ih : layerHits) {
401 auto layerHits = layer.hits();
402 result.reserve(layerHits.size());
403 for (
auto&& ih : layerHits) {
416 std::ostringstream
str;
OuterHitPhiPrediction phiWindow(const MagneticField &field) const
std::string print() const override
void setTolerance(float tolerance)
std::unique_ptr< MeasurementEstimator > estimator(const BarrelDetLayer *layer) const
common ppss p3p6s2 common epss epspn46 common const1 w2
std::unique_ptr< HitRZCompatibility > checkRZOld(const DetLayer *layer, const Hit &outerHit, const DetLayer *outerlayer) const
TkTrackingRegionsMargin< float > Margin
PixelRecoRange< float > Range
TkTrackingRegionsMargin< float > Margin
virtual Location location() const =0
Which part of the detector (barrel, endcap)
bool isBarrel(GeomDetEnumerators::SubDetector m)
Sin< T >::type sin(const T &t)
Global3DPoint GlobalPoint
std::vector< Track > TrackCollection
collection of Tracks
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap)
static UseMeasurementTracker stringToUseMeasurementTracker(const std::string &name)
TrackingRegion::Hits hits(const SeedingLayerSetsHits::SeedingLayer &layer) const override
get hits from layer compatible with region constraints
T curvature(T InversePt, const MagneticField &field)
Range range(const float &radius) const override
constexpr T proxim(T b, T a)
static PlanePointer build(Args &&... args)
float zAtR(float r) const
void initEtaRange(const GlobalVector &dir, const Margin &margin)
double intersection(double r12)
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)
virtual std::string print() const
bool isEndcap(GeomDetEnumerators::SubDetector m)
bool isTrackerStrip(GeomDetEnumerators::SubDetector m)
SimpleLineRZ::Point Point
void checkTracks(reco::TrackCollection const &tracks, std::vector< bool > &mask) const override
SeedingLayerSetsHits::Hits Hits
weight_default_t w1[2000]
HitRZConstraint rzConstraint() const
XYZPointD XYZPoint
point in space with cartesian internal representation
PixelRecoRange< T > intersection(const PixelRecoRange< T > &r) const
Square< F >::type sqr(const F &f)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
double longitudinalBendingCorrection(double radius, double pt, const MagneticField &field)
bool isTrackerPixel(GeomDetEnumerators::SubDetector m)
void setTolerance(const Margin &tolerance)