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()
301 template <
typename T,
typename F>
313 const DetLayer * detLayer = layer.detLayer();
316 bool measurementMethod =
false;
317 if ( theMeasurementTrackerUsage > 0.5) measurementMethod =
true;
318 if ( theMeasurementTrackerUsage > -0.5 &&
322 if(measurementMethod) {
332 est = estimator(&bl,es);
335 est = estimator(&fl,es);
339 (thePhiMargin.left()+thePhiMargin.right())*0.5
f);
342 LogDebug(
"RectangularEtaPhiTrackingRegion")<<
"use pixel specific estimator.";
343 findDetAndHits = est;
346 LogDebug(
"RectangularEtaPhiTrackingRegion")<<
"use generic etat phi estimator.";
350 float phi = phiDirection();
369 vector<TrajectoryMeasurement> meas = lm.
measurements(*detLayer, tsos, prop, *findDetAndHits);
370 result.reserve(meas.size());
371 for (
auto const & im : meas) {
372 auto ptrHit = im.recHit();
373 if (ptrHit->isValid()) result.push_back( std::move(ptrHit) );
376 LogDebug(
"RectangularEtaPhiTrackingRegion")<<
" found "<< meas.size()<<
" minus one measurements on layer: "<<detLayer->
subDetector();
385 est = estimator(&bl,es);
388 est = estimator(&fl,es);
393 result.reserve(layerHits.size());
394 for (
auto const & ih : layerHits) {
396 result.push_back( std::move(ih) );
407 std::ostringstream str;
409 <<
" eta: "<<theEtaRange<<
" phi:"<<thePhiMargin
410 <<
"precise: "<<thePrecise;
std::vector< TrajectoryMeasurement > measurements(const DetLayer &layer, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
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::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
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)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
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
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
virtual LocalPoint localPosition() const =0
virtual const BoundCylinder & specificSurface() const GCC11_FINAL
Extension of the interface.