39 template <
class T>
T sqr(
T t) {
return t*
t;}
42 using namespace PixelRecoUtilities;
44 using namespace ctfseeding;
46 void RectangularEtaPhiTrackingRegion:: initEtaRange(
const GlobalVector &
dir,
const Margin& margin) {
48 theEtaRange =
Range(eta-margin.left(), eta+margin.right());
49 theLambdaRange=
Range(std::sinh(theEtaRange.min()),std::sinh(theEtaRange.max()));
50 theMeanLambda = std::sinh(theEtaRange.mean());
61 float outerred_r =
sqrt(
sqr(ohit.
x()-origin().x())+
sqr(ohit.
y()-origin().y()) );
65 float zMinOrigin = origin().z() - originZBound();
66 float zMaxOrigin = origin().z() + originZBound();
69 float vcotMin = (
outer.z() > zMaxOrigin) ?
70 (
outer.z()-zMaxOrigin)/(
outer.r()+originRBound())
71 : (
outer.z()-zMaxOrigin)/(
outer.r()-originRBound());
72 float vcotMax = (
outer.z() > zMinOrigin) ?
73 (
outer.z()-zMinOrigin)/(
outer.r()-originRBound())
74 : (
outer.z()-zMinOrigin)/(
outer.r()+originRBound());
75 float cotRight =
std::max(vcotMin,theLambdaRange.min());
76 float cotLeft =
std::min(vcotMax, theLambdaRange.max());
77 return new HitEtaCheck( isBarrel,
outer, cotLeft, cotRight);
86 }
else if (
outer.z() > 0) {
95 float cotThetaOuter = theMeanLambda;
97 float outerZscatt = 3.f*oSigma(
ptMin(),cotThetaOuter) / sinThetaOuter;
101 float zMinLine = boundL.
zAtR(0.)-outerZscatt;
102 float zMaxLine = boundR.zAtR(0.)+outerZscatt;
114 float cotTheta =
std::abs(leftLine.cotLine()+rightLine.cotLine())*0.5
f;
122 float corrZ = innerScatt/sinTheta + hitZErr;
123 return new HitZCheck(rzConstraint, HitZCheck::Margin(corrZ,corrZ));
126 float corrR = innerScatt/cosTheta + hitRErr;
127 return new HitRCheck( rzConstraint, HitRCheck::Margin(corrR,corrR));
142 Range detRWindow (radius-halfThickness, radius+halfThickness);
143 Range detZWindow(z0-halfLength,z0+halfLength);
146 HitZCheck zPrediction(rzConstraint());
147 Range hitZWindow = zPrediction.range(detRWindow.min()).
149 if (hitZWindow.empty())
return 0;
159 float cotTheta = (hitZWindow.mean()-origin().z()) / radius;
162 float scatt = 3.f * msSigma(
ptMin(), cotTheta);
165 float hitErrRPhi = 0.;
167 float corrPhi = (scatt+ hitErrRPhi)/radius;
168 float corrZ = scatt/sinTheta + bendR*
std::abs(cotTheta) + hitErrZ;
171 zPrediction.setTolerance(HitZCheck::Margin(corrZ,corrZ));
179 Range w1 = zPrediction.range(detRWindow.min());
180 Range w2 = zPrediction.range(detRWindow.max());
184 phiRange = phiPrediction(detRWindow.mean());
200 Range detZWindow( zLayer-halfThickness, zLayer+halfThickness);
205 HitRCheck rPrediction(rzConstraint());
207 if (hitRWindow.empty())
return 0;
217 float cotTheta = (detZWindow.mean()-origin().z())/hitRWindow.mean();
220 float scatt = 3.f * msSigma(
ptMin(),cotTheta);
222 float hitErrRPhi = 0.;
224 float corrPhi = (scatt+hitErrRPhi)/detRWindow.min();
225 float corrR = scatt/
std::abs(cosTheta) + bendR + hitErrR;
228 rPrediction.setTolerance(HitRCheck::Margin(corrR,corrR));
235 w1 = rPrediction.range(detZWindow.min());
236 w2 = rPrediction.range(detZWindow.max());
238 w1 = rPrediction.range(detZWindow.max());
239 w2 = rPrediction.range(detZWindow.min());
252 RectangularEtaPhiTrackingRegion::phiWindow(
const edm::EventSetup& iSetup)
const
254 float phi0 = phiDirection();
257 phi0+thePhiMargin.right()),
265 RectangularEtaPhiTrackingRegion::rzConstraint()
const {
267 float zMin = origin().
z() - originZBound();
268 float zMax = origin().z() + originZBound();
269 float rMin = -originRBound();
270 float rMax = originRBound();
271 if(theEtaRange.max() > 0) {
276 if (theEtaRange.min() > 0.) {
282 pRight,theLambdaRange.max()
297 bool measurementMethod =
false;
298 if(theMeasurementTrackerUsage == UseMeasurementTracker::kAlways) measurementMethod =
true;
299 else if(theMeasurementTrackerUsage == UseMeasurementTracker::kForSiStrips &&
303 if(measurementMethod) {
313 est = estimator(&bl,es);
316 est = estimator(&fl,es);
320 (thePhiMargin.left()+thePhiMargin.right())*0.5
f);
323 LogDebug(
"RectangularEtaPhiTrackingRegion")<<
"use pixel specific estimator.";
324 findDetAndHits = est;
327 LogDebug(
"RectangularEtaPhiTrackingRegion")<<
"use generic etat phi estimator.";
331 float phi = phiDirection();
346 LayerMeasurements lm(theMeasurementTracker->measurementTracker(), *theMeasurementTracker);
349 lm.
recHits(hits,*detLayer, tsos, prop, *findDetAndHits);
361 result.reserve(hits.size());
362 for (
auto h : hits) {
363 cache.emplace_back(
h);
364 result.emplace_back(
h);
367 LogDebug(
"RectangularEtaPhiTrackingRegion")<<
" found "<< hits.size()<<
" minus one measurements on layer: "<<detLayer->
subDetector();
376 est = estimator(&bl,es);
379 est = estimator(&fl,es);
383 auto layerHits = layer.
hits();
384 result.reserve(layerHits.size());
385 for (
auto && ih : layerHits) {
387 result.emplace_back( std::move(ih) );
399 std::ostringstream str;
401 <<
" eta: "<<theEtaRange<<
" phi:"<<thePhiMargin
402 <<
"precise: "<<thePrecise;
virtual float length() const =0
common ppss p3p6s2 common epss epspn46 common const1 w2
virtual Location location() const =0
Which part of the detector (barrel, endcap)
const OuterHitCompatibility & hitCompatibility() const
std::vector< BaseTrackerRecHit * > SimpleHitContainer
std::string print(const Track &, edm::Verbosity=edm::Concise)
Track print utility.
Sin< T >::type sin(const T &t)
Global3DPoint GlobalPoint
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap)
virtual const BoundSurface & surface() const GCC11_FINAL
GeometricSearchDet interface.
const Bounds & bounds() const
virtual float thickness() const =0
float zAtR(float r) const
bool recHits(SimpleHitContainer &result, const DetLayer &layer, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
double intersection(double r12)
T curvature(T InversePt, const edm::EventSetup &iSetup)
const T & max(const T &a, const T &b)
virtual const BoundSurface & surface() const GCC11_FINAL
The surface of the GeometricSearchDet.
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)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
SimpleLineRZ::Point Point
PixelRecoRange< float > Range
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
const DetLayer * detLayer() const
virtual std::string print() const
virtual const BoundDisk & specificSurface() const GCC11_FINAL
PixelRecoRange< T > intersection(const PixelRecoRange< T > &r) const
tuple StraightLinePropagator
Square< F >::type sqr(const F &f)
void setTolerance(const Margin &tolerance)
DetId geographicalId() const
virtual LocalPoint localPosition() const =0
virtual const BoundCylinder & specificSurface() const GCC11_FINAL
Extension of the interface.