34 template <
class T>
T sqr(
T t) {
return t*
t;}
37 using namespace PixelRecoUtilities;
39 using namespace ctfseeding;
41 void RectangularEtaPhiTrackingRegion::
45 theEtaRange =
Range(eta-margin.left(), eta+margin.right());
56 float outerred_r =
sqrt(
sqr(ohit.
x()-origin().x())+
sqr(ohit.
y()-origin().y()) );
60 float zMinOrigin = origin().z() - originZBound();
61 float zMaxOrigin = origin().z() + originZBound();
64 double vcotMin = (
outer.z() > zMaxOrigin) ?
65 (
outer.z()-zMaxOrigin)/(
outer.r()+originRBound())
66 : (
outer.z()-zMaxOrigin)/(
outer.r()-originRBound());
67 double vcotMax = (
outer.z() > zMinOrigin) ?
68 (
outer.z()-zMinOrigin)/(
outer.r()-originRBound())
69 : (
outer.z()-zMinOrigin)/(
outer.r()+originRBound());
70 float cotRight =
max(vcotMin,(
double) sinh(theEtaRange.min()));
71 float cotLeft =
min(vcotMax, (
double) sinh(theEtaRange.max()));
72 return new HitEtaCheck( isBarrel,
outer, cotLeft, cotRight);
81 }
else if (
outer.z() > 0) {
90 float cotThetaOuter = sinh(theEtaRange.mean());
91 float sinThetaOuter = 1/
sqrt(1+
sqr(cotThetaOuter));
92 float outerZscatt = 3*oSigma(
ptMin(),cotThetaOuter) / sinThetaOuter;
96 float zMinLine = boundL.zAtR(0.)-outerZscatt;
97 float zMaxLine = boundR.zAtR(0.)+outerZscatt;
109 float cotTheta = fabs(leftLine.cotLine()+rightLine.cotLine())/2;
114 float sinTheta = 1/
sqrt(1+
sqr(cotTheta));
115 float corrZ = innerScatt/sinTheta + hitZErr;
116 return new HitZCheck(rzConstraint, HitZCheck::Margin(corrZ,corrZ));
118 float cosTheta = 1/
sqrt(1+
sqr(1/cotTheta));
119 float corrR = innerScatt/cosTheta + hitRErr;
120 return new HitRCheck( rzConstraint, HitRCheck::Margin(corrR,corrR));
135 Range detRWindow (radius-halfThickness, radius+halfThickness);
136 Range detZWindow(z0-halfLength,z0+halfLength);
139 HitZCheck zPrediction(rzConstraint());
140 Range hitZWindow = zPrediction.range(detRWindow.min()).
142 if (hitZWindow.empty())
return 0;
152 float cotTheta = (hitZWindow.mean()-origin().z()) / radius;
153 float sinTheta = 1/
sqrt(1+
sqr(cotTheta));
155 float scatt = 3 * msSigma(
ptMin(), cotTheta);
158 float hitErrRPhi = 0.;
160 float corrPhi = (scatt+ hitErrRPhi)/radius;
161 float corrZ = scatt/sinTheta + bendR*fabs(cotTheta) + hitErrZ;
164 zPrediction.setTolerance(HitZCheck::Margin(corrZ,corrZ));
172 Range w1 = zPrediction.range(detRWindow.min());
173 Range w2 = zPrediction.range(detRWindow.max());
178 phiRange = phiPrediction(detRWindow.mean());
194 Range detZWindow( zLayer-halfThickness, zLayer+halfThickness);
199 HitRCheck rPrediction(rzConstraint());
201 if (hitRWindow.empty())
return 0;
211 float cotTheta = (detZWindow.mean()-origin().z())/hitRWindow.mean();
212 float cosTheta = cotTheta/
sqrt(1+
sqr(cotTheta));
214 float scatt = 3 * msSigma(
ptMin(),cotTheta);
216 float hitErrRPhi = 0.;
218 float corrPhi = (scatt+hitErrRPhi)/detRWindow.min();
219 float corrR = scatt/fabs(cosTheta) + bendR + hitErrR;
222 rPrediction.setTolerance(HitRCheck::Margin(corrR,corrR));
229 w1 = rPrediction.range(detZWindow.min());
230 w2 = rPrediction.range(detZWindow.max());
232 w1 = rPrediction.range(detZWindow.max());
233 w2 = rPrediction.range(detZWindow.min());
246 RectangularEtaPhiTrackingRegion::phiWindow(
const edm::EventSetup& iSetup)
const
248 float phi0 = direction().phi();
251 phi0+thePhiMargin.left()),
259 RectangularEtaPhiTrackingRegion::rzConstraint()
const
262 float zMin = origin().
z() - originZBound();
263 float zMax = origin().z() + originZBound();
264 float rMin = -originRBound();
265 float rMax = originRBound();
266 if(theEtaRange.max() > 0) {
271 if (theEtaRange.min() > 0.) {
277 pRight, sinh(theEtaRange.max()) );
293 bool measurementMethod =
false;
294 if ( theMeasurementTrackerUsage > 0.5) measurementMethod =
true;
295 if ( theMeasurementTrackerUsage > -0.5 &&
299 if(measurementMethod) {
309 est = estimator(&bl,es);
312 est = estimator(&fl,es);
316 (thePhiMargin.left()+thePhiMargin.right())/2.);
319 LogDebug(
"RectangularEtaPhiTrackingRegion")<<
"use pixel specific estimator.";
320 findDetAndHits =*est;
323 LogDebug(
"RectangularEtaPhiTrackingRegion")<<
"use generic etat phi estimator.";
344 measurementTracker->update(ev);
348 vector<TrajectoryMeasurement> meas = lm.measurements(*detLayer, tsos, prop, findDetAndHits);
349 typedef vector<TrajectoryMeasurement>::const_iterator IM;
350 for (IM im = meas.begin(); im != meas.end(); im++) {
352 if (ptrHit->isValid()) result.push_back( ptrHit );
355 LogDebug(
"RectangularEtaPhiTrackingRegion")<<
" found "<< meas.size()<<
" minus one measurements on layer: "<<detLayer->
subDetector();
363 est = estimator(&bl,es);
366 est = estimator(&fl,es);
371 for (TrackingRegion::Hits::const_iterator ih= layerHits.begin(); ih != layerHits.end(); ih++) {
373 result.push_back( *ih );
383 std::ostringstream str;
385 <<
" eta: "<<theEtaRange<<
" phi:"<<thePhiMargin
386 <<
"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
const DetLayer * detLayer() const
std::string print(const Track &, edm::Verbosity=edm::Concise)
Track print utility.
Sin< T >::type sin(const T &t)
Geom::Phi< T > phi() const
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
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)
static GlobalPoint vtxMean(const GlobalPoint &p1, const GlobalError &e1, const GlobalPoint &p2, const GlobalError &e2)
SimpleLineRZ::Point Point
void hits(const edm::Event &ev, const edm::EventSetup &es, Hits &) const
PixelRecoRange< float > Range
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 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.