16 template <
class T>
inline T sqr(
T t) {
return t*
t;}
18 inline T cropped_asin(
T x) {
24 inline double checked_asin(
double x,
const char *expr,
const char *
file,
int line) {
25 if (fabs(x) >= 1.0)
throw cms::Exception(
"CorruptData") <<
"asin(x) called with x = " << expr <<
" = " << x <<
"\n\tat " << file <<
":" << line <<
"\n";
35 bool precise,
float extraTolerance)
36 : thePrecise(precise),
37 ol( outlayer.seqNum()),
38 theROrigin(region.originRBound()),
41 theExtraTolerance(extraTolerance),
44 theVtxZ(region.origin().
z()),
45 thePtMin(region.
ptMin()),
46 theVtx(region.origin().x(),region.origin().
y()),
73 float zMinOrigin,
float zMaxOrigin)
80 theB = layerZ > 0 ? zMaxOrigin : zMinOrigin;
90 bool checkCrossing =
true;
94 auto dHitmag = dHit.
mag();
102 crossing = theVtx +
t*dHit;
103 rLayer = crossing.
mag();
104 dLayer =
t*dHitmag; dL =
dt * dHitmag;
105 checkCrossing =
false;
107 checkCrossing =
true;
125 auto vtxmag2 = theVtx.mag2();
126 if (vtxmag2 < 1.
e-10
f) {
131 double var_c = vtxmag2-
sqr(rLayer);
132 double var_b = theVtx.dot(dHit.
unit());
133 double var_delta =
sqr(var_b)-var_c;
134 if (var_delta <=0.) var_delta = 0;
137 crossing = theVtx+ dHit.
unit() * dLayer;
149 deltaPhi *= dLayer/(rLayer*cosCross);
153 Point2D crossing2 = theVtx + dHit.
unit()* (dLayer+dL);
154 auto phicross2 = crossing2.
barePhi();
155 auto phicross1 = crossing.
barePhi();
156 auto dphicross = phicross2-phicross1;
157 if (dphicross < -
float(
M_PI)) dphicross += float(2*
M_PI);
158 if (dphicross >
float(
M_PI)) dphicross -= float(2*
M_PI);
159 if (dphicross >
float(
M_PI/2)) dphicross = 0.;
160 phicross2 = phicross1 + dphicross;
164 auto deltaPhiOrig = cropped_asin(
theROrigin * (dHitmag-dLayer) / (dHitmag*dLayer));
165 deltaPhiOrig *= dLayer/(rLayer*cosCross);
172 auto deltaPhiHitOuter = errRPhi/hitXY.
mag();
174 auto margin =
deltaPhi+deltaPhiOrig+deltaPhiHit+deltaPhiHitOuter ;
186 std::max(phicross1,phicross2)+margin);
196 float rmin = (
theA*hitR)/(hitZ-
theB);
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
T dot(const Basic2DVector &lh) const
Scalar product, or "dot" product, with a vector of same type.
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
const Bounds & bounds() const
PixelRecoRange< float > phiRange(const Point2D &hitXY, float zHit, float errRPhi) const
Basic2DVector unit() const
virtual float thickness() const =0
float minRadius(float hitR, float hitZ) const
const T & max(const T &a, const T &b)
Abs< T >::type abs(const T &t)
float originZBound() const
bounds the particle vertex in the longitudinal plane
virtual const Surface::PositionType & position() const
Returns position of the surface.
void initBarrelLayer(const DetLayer &layer)
void initForwardLayer(const DetLayer &layer, float zMinOrigin, float zMaxOrigin)
virtual const BoundDisk & specificSurface() const GCC11_FINAL
T bendingRadius(T pt, const edm::EventSetup &iSetup)
Square< F >::type sqr(const F &f)
InnerDeltaPhi(const DetLayer &outlayer, const DetLayer &layer, const TrackingRegion ®ion, const edm::EventSetup &iSetup, bool precise=true, float extraTolerance=0.f)
virtual const BoundCylinder & specificSurface() const GCC11_FINAL
Extension of the interface.
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
MultipleScatteringParametrisation sigma