42 template <
class T>
T sqr(
T t) {
return t*
t;}
53 return UseMeasurementTracker::kNever;
54 if(tmp ==
"forsistrips")
55 return UseMeasurementTracker::kForSiStrips;
57 return UseMeasurementTracker::kAlways;
58 throw cms::Exception(
"Configuration") <<
"Got invalid string '" << name <<
"', valid values are 'Never', 'ForSiStrips', 'Always' (case insensitive)";
64 theLambdaRange=
Range(std::sinh(theEtaRange.min()),std::sinh(theEtaRange.max()));
65 theMeanLambda = std::sinh(theEtaRange.mean());
74 float outerred_r =
std::sqrt(
sqr(ohit.
x()-origin().x())+
sqr(ohit.
y()-origin().y()) );
77 float zMinOrigin = origin().z() - originZBound();
78 float zMaxOrigin = origin().z() + originZBound();
81 float vcotMin = (
outer.z() > zMaxOrigin) ?
82 (
outer.z()-zMaxOrigin)/(
outer.r()+originRBound())
83 : (
outer.z()-zMaxOrigin)/(
outer.r()-originRBound());
84 float vcotMax = (
outer.z() > zMinOrigin) ?
85 (
outer.z()-zMinOrigin)/(
outer.r()-originRBound())
86 : (
outer.z()-zMinOrigin)/(
outer.r()+originRBound());
87 float cotRight =
std::max(vcotMin,theLambdaRange.min());
88 float cotLeft =
std::min(vcotMax, theLambdaRange.max());
99 float cotThetaOuter = theMeanLambda;
101 outerZscatt = 3.f*oSigma(
ptMin(),cotThetaOuter)*sinThetaOuterInv;
106 float zMinLine = boundL.
zAtR(0.)-outerZscatt;
107 float zMaxLine = boundR.zAtR(0.)+outerZscatt;
116 innerScatt = 3.f * ( outerlayer ?
134 auto corr = innerScatt*sinThetaInv;
138 auto corr = innerScatt*cosThetaInv;
143 std::unique_ptr<MeasurementEstimator>
156 Range detRWindow (radius-halfThickness, radius+halfThickness);
157 Range detZWindow(z0-halfLength,z0+halfLength);
163 if (hitZWindow.
empty())
return nullptr;
174 auto cotTheta = (hitZWindow.
mean()-origin().z()) * invR;
177 auto scatt = 3.f * msSigma(
ptMin(), cotTheta);
180 float hitErrRPhi = 0.;
182 float corrPhi = (scatt+ hitErrRPhi)*invR;
183 float corrZ = scatt*sinThetaInv + bendR*
std::abs(cotTheta) + hitErrZ;
199 phiRange = phiPrediction(detRWindow.
mean());
202 return std::make_unique<OuterEstimator<Algo>>(
208 std::unique_ptr<MeasurementEstimator>
215 Range detZWindow( zLayer-halfThickness, zLayer+halfThickness);
222 if (hitRWindow.
empty())
return nullptr;
232 float cotTheta = (detZWindow.
mean()-origin().z())/hitRWindow.
mean();
233 float cosThetaInv =
std::sqrt(1+
sqr(cotTheta))/cotTheta;
235 float scatt = 3.f * msSigma(
ptMin(),cotTheta);
237 float hitErrRPhi = 0.;
239 float corrPhi = (scatt+hitErrRPhi)/detRWindow.min();
240 float corrR = scatt*
std::abs(cosThetaInv) + bendR + hitErrR;
250 w1 = rPrediction.range(detZWindow.
min());
251 w2 = rPrediction.range(detZWindow.
max());
253 w1 = rPrediction.range(detZWindow.
max());
254 w2 = rPrediction.range(detZWindow.
min());
259 return std::make_unique<OuterEstimator<Algo>>(
269 auto phi0 = phiDirection();
272 phi0+thePhiMargin.right()),
282 float zMin = origin().z() - originZBound();
283 float zMax = origin().z() + originZBound();
284 float rMin = -originRBound();
285 float rMax = originRBound();
286 if(theEtaRange.max() > 0) {
291 if (theEtaRange.min() > 0.) {
297 pRight,theLambdaRange.max()
310 bool measurementMethod =
false;
311 if(theMeasurementTrackerUsage == UseMeasurementTracker::kAlways) measurementMethod =
true;
312 else if(theMeasurementTrackerUsage == UseMeasurementTracker::kForSiStrips &&
315 if(measurementMethod) {
323 std::unique_ptr<MeasurementEstimator> est;
335 (thePhiMargin.left()+thePhiMargin.right())*0.5
f);
338 LogDebug(
"RectangularEtaPhiTrackingRegion")<<
"use pixel specific estimator.";
339 findDetAndHits = est.get();
342 LogDebug(
"RectangularEtaPhiTrackingRegion")<<
"use generic etat phi estimator.";
346 float phi = phiDirection();
361 LayerMeasurements lm(theMeasurementTracker->measurementTracker(), *theMeasurementTracker);
364 lm.recHits(hits,*detLayer, tsos, prop, *findDetAndHits);
376 result.reserve(hits.size());
377 for (
auto h : hits) {
379 result.emplace_back(
h);
382 LogDebug(
"RectangularEtaPhiTrackingRegion")<<
" found "<< hits.size()<<
" minus one measurements on layer: "<<detLayer->
subDetector();
394 auto const & hitComp = (
reinterpret_cast<OuterEstimator<Algo> const&
>(*est)).hitCompatibility();
395 auto layerHits = layer.
hits();
396 result.reserve(layerHits.size());
397 for (
auto && ih : layerHits) {
407 auto const & hitComp = (
reinterpret_cast<OuterEstimator<Algo> const&
>(*est)).hitCompatibility();
408 auto layerHits = layer.
hits();
409 result.reserve(layerHits.size());
410 for (
auto && ih : layerHits) {
425 std::ostringstream
str;
427 <<
" eta: "<<theEtaRange<<
" phi:"<<thePhiMargin
428 <<
"precise: "<<thePrecise;
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
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
std::vector< BaseTrackerRecHit * > SimpleHitContainer
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
std::vector< std::vector< double > > tmp
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)