42 template <
class T>
T sqr(
T t) {
return t*
t;}
46 using namespace PixelRecoUtilities;
48 using namespace ctfseeding;
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()
312 bool measurementMethod =
false;
313 if(theMeasurementTrackerUsage == UseMeasurementTracker::kAlways) measurementMethod =
true;
314 else if(theMeasurementTrackerUsage == UseMeasurementTracker::kForSiStrips &&
317 if(measurementMethod) {
325 std::unique_ptr<MeasurementEstimator> est;
337 (thePhiMargin.left()+thePhiMargin.right())*0.5
f);
340 LogDebug(
"RectangularEtaPhiTrackingRegion")<<
"use pixel specific estimator.";
341 findDetAndHits = est.get();
344 LogDebug(
"RectangularEtaPhiTrackingRegion")<<
"use generic etat phi estimator.";
348 float phi = phiDirection();
363 LayerMeasurements lm(theMeasurementTracker->measurementTracker(), *theMeasurementTracker);
366 lm.
recHits(hits,*detLayer, tsos, prop, *findDetAndHits);
378 result.reserve(hits.size());
379 for (
auto h : hits) {
380 cache.emplace_back(
h);
381 result.emplace_back(
h);
384 LogDebug(
"RectangularEtaPhiTrackingRegion")<<
" found "<< hits.size()<<
" minus one measurements on layer: "<<detLayer->
subDetector();
397 auto layerHits = layer.
hits();
398 result.reserve(layerHits.size());
399 for (
auto && ih : layerHits) {
410 auto layerHits = layer.
hits();
411 result.reserve(layerHits.size());
412 for (
auto && ih : layerHits) {
427 std::ostringstream str;
429 <<
" eta: "<<theEtaRange<<
" phi:"<<thePhiMargin
430 <<
"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.
virtual Location location() const =0
Which part of the detector (barrel, endcap)
std::vector< BaseTrackerRecHit * > SimpleHitContainer
PixelRecoRange< float > Range
bool isBarrel(GeomDetEnumerators::SubDetector m)
Sin< T >::type sin(const T &t)
virtual const BoundSurface & surface() const final
GeometricSearchDet interface.
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
static UseMeasurementTracker stringToUseMeasurementTracker(const std::string &name)
HitRZConstraint rzConstraint() const
std::unique_ptr< MeasurementEstimator > estimator(const BarrelDetLayer *layer, const edm::EventSetup &iSetup) const
virtual float thickness() const =0
float zAtR(float r) const
bool isTrackerStrip(const GeomDetEnumerators::SubDetector m)
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
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
SimpleLineRZ::Point Point
SeedingLayerSetsHits::Hits Hits
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 final
Extension of the interface.
const DetLayer * detLayer() const
virtual std::string print() const
virtual const BoundSurface & surface() const final
The surface of the GeometricSearchDet.
bool isTrackerPixel(const GeomDetEnumerators::SubDetector m)
Geom::Phi< T > phi() const
std::vector< std::vector< double > > tmp
PixelRecoRange< T > intersection(const PixelRecoRange< T > &r) const
Square< F >::type sqr(const F &f)
virtual const BoundDisk & specificSurface() const final
void setTolerance(const Margin &tolerance)
Range range(const float &radius) const