42 template <
class T>
T sqr(
T t) {
return t*
t;}
54 return UseMeasurementTracker::kNever;
55 if(tmp ==
"forsistrips")
56 return UseMeasurementTracker::kForSiStrips;
58 return UseMeasurementTracker::kAlways;
59 throw cms::Exception(
"Configuration") <<
"Got invalid string '" << name <<
"', valid values are 'Never', 'ForSiStrips', 'Always' (case insensitive)";
65 theLambdaRange=
Range(std::sinh(theEtaRange.min()),std::sinh(theEtaRange.max()));
66 theMeanLambda = std::sinh(theEtaRange.mean());
75 float outerred_r =
std::sqrt(
sqr(ohit.
x()-origin().x())+
sqr(ohit.
y()-origin().y()) );
78 float zMinOrigin = origin().z() - originZBound();
79 float zMaxOrigin = origin().z() + originZBound();
82 float vcotMin = (
outer.z() > zMaxOrigin) ?
83 (
outer.z()-zMaxOrigin)/(
outer.r()+originRBound())
84 : (
outer.z()-zMaxOrigin)/(
outer.r()-originRBound());
85 float vcotMax = (
outer.z() > zMinOrigin) ?
86 (
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());
100 float cotThetaOuter = theMeanLambda;
102 outerZscatt = 3.f*oSigma(
ptMin(),cotThetaOuter)*sinThetaOuterInv;
107 float zMinLine = boundL.
zAtR(0.)-outerZscatt;
108 float zMaxLine = boundR.zAtR(0.)+outerZscatt;
117 innerScatt = 3.f * ( outerlayer ?
135 auto corr = innerScatt*sinThetaInv;
139 auto corr = innerScatt*cosThetaInv;
144 std::unique_ptr<MeasurementEstimator>
157 Range detRWindow (radius-halfThickness, radius+halfThickness);
158 Range detZWindow(z0-halfLength,z0+halfLength);
164 if (hitZWindow.
empty())
return nullptr;
175 auto cotTheta = (hitZWindow.
mean()-origin().z()) * invR;
178 auto scatt = 3.f * msSigma(
ptMin(), cotTheta);
181 float hitErrRPhi = 0.;
183 float corrPhi = (scatt+ hitErrRPhi)*invR;
184 float corrZ = scatt*sinThetaInv + bendR*
std::abs(cotTheta) + hitErrZ;
200 phiRange = phiPrediction(detRWindow.
mean());
203 return std::make_unique<OuterEstimator<Algo>>(
209 std::unique_ptr<MeasurementEstimator>
216 Range detZWindow( zLayer-halfThickness, zLayer+halfThickness);
223 if (hitRWindow.
empty())
return 0;
233 float cotTheta = (detZWindow.
mean()-origin().z())/hitRWindow.
mean();
234 float cosThetaInv =
std::sqrt(1+
sqr(cotTheta))/cotTheta;
236 float scatt = 3.f * msSigma(
ptMin(),cotTheta);
238 float hitErrRPhi = 0.;
240 float corrPhi = (scatt+hitErrRPhi)/detRWindow.min();
241 float corrR = scatt*
std::abs(cosThetaInv) + bendR + hitErrR;
251 w1 = rPrediction.range(detZWindow.
min());
252 w2 = rPrediction.range(detZWindow.
max());
254 w1 = rPrediction.range(detZWindow.
max());
255 w2 = rPrediction.range(detZWindow.
min());
260 return std::make_unique<OuterEstimator<Algo>>(
270 auto phi0 = phiDirection();
273 phi0+thePhiMargin.right()),
283 float zMin = origin().z() - originZBound();
284 float zMax = origin().z() + originZBound();
285 float rMin = -originRBound();
286 float rMax = originRBound();
287 if(theEtaRange.max() > 0) {
292 if (theEtaRange.min() > 0.) {
298 pRight,theLambdaRange.max()
311 bool measurementMethod =
false;
312 if(theMeasurementTrackerUsage == UseMeasurementTracker::kAlways) measurementMethod =
true;
313 else if(theMeasurementTrackerUsage == UseMeasurementTracker::kForSiStrips &&
316 if(measurementMethod) {
324 std::unique_ptr<MeasurementEstimator> est;
336 (thePhiMargin.left()+thePhiMargin.right())*0.5
f);
339 LogDebug(
"RectangularEtaPhiTrackingRegion")<<
"use pixel specific estimator.";
340 findDetAndHits = est.get();
343 LogDebug(
"RectangularEtaPhiTrackingRegion")<<
"use generic etat phi estimator.";
347 float phi = phiDirection();
362 LayerMeasurements lm(theMeasurementTracker->measurementTracker(), *theMeasurementTracker);
365 lm.recHits(hits,*detLayer, tsos, prop, *findDetAndHits);
377 result.reserve(hits.size());
378 for (
auto h : hits) {
379 cache.emplace_back(
h);
380 result.emplace_back(
h);
383 LogDebug(
"RectangularEtaPhiTrackingRegion")<<
" found "<< hits.size()<<
" minus one measurements on layer: "<<detLayer->
subDetector();
395 auto const & hitComp = (
reinterpret_cast<OuterEstimator<Algo> const&
>(*est)).hitCompatibility();
396 auto layerHits = layer.
hits();
397 result.reserve(layerHits.size());
398 for (
auto && ih : layerHits) {
408 auto const & hitComp = (
reinterpret_cast<OuterEstimator<Algo> const&
>(*est)).hitCompatibility();
409 auto layerHits = layer.
hits();
410 result.reserve(layerHits.size());
411 for (
auto && ih : layerHits) {
426 std::ostringstream
str;
428 <<
" eta: "<<theEtaRange<<
" phi:"<<thePhiMargin
429 <<
"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
virtual const BoundSurface & surface() const final
The surface of the GeometricSearchDet.
common ppss p3p6s2 common epss epspn46 common const1 w2
std::vector< BaseTrackerRecHit * > SimpleHitContainer
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
virtual const BoundSurface & surface() const final
GeometricSearchDet interface.
const Bounds & bounds() const
virtual 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
std::unique_ptr< MeasurementEstimator > estimator(const BarrelDetLayer *layer, const edm::EventSetup &iSetup) const
float zAtR(float r) const
bool isTrackerStrip(const GeomDetEnumerators::SubDetector m)
void initEtaRange(const GlobalVector &dir, const Margin &margin)
double intersection(double r12)
T curvature(T InversePt, const edm::EventSetup &iSetup)
PixelRecoRange< float > Range
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)
OuterHitPhiPrediction phiWindow(const edm::EventSetup &iSetup) const
virtual 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
bool isTrackerPixel(const GeomDetEnumerators::SubDetector m)
std::vector< std::vector< double > > tmp
PixelRecoRange< T > intersection(const PixelRecoRange< T > &r) const
Square< F >::type sqr(const F &f)
T const * product() const
void setTolerance(const Margin &tolerance)
Range range(const float &radius) const